Potreboval bych omezit pristup k jednomu adresari na malilinkatem webu,
co bezi u OVH a jejich zdarma 10M tarifu.
V nastaveni Hosting planu mam:
Operating system: stable64
PHP version 8.1
Engine: php
Mode: production
Aplication firewall: Enabled
SSL Certificate: Yes - LETSENCRYPT - DV
A v korenu /home/xYYYYYY/ mam soubor .htaccess pro HTTPS rewrite a dalsi
# enable HTTP/2, if available
#Protocol h2 http/1.1
SetEnv PHP_VER 8_1
SetEnv REGISTER_GLOBALS 0
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
########################################################################
Redirect permanent /mail https://mail.ovh.net/roundcube
#Header append X-FRAME-OPTIONS "DENY"
#Header set Set-Cookie HttpOnly;Secure
#Header set Set-Cookie "HttpOnly"
#Header set Set-Cookie "Secure"
########################################################################
#Header always edit Set-Cookie (.*) "$1; HTTPOnly; Secure"
########################################################################
#Header always edit Set-Cookie (.*) "$1; HTTPOnly"
#Header always edit Set-Cookie (.*) "$1; Secure"
########################################################################
Header edit Set-Cookie ^(.*)$ $1;HttpOnly;Secure
Header edit Set-Cookie ^(.*)$ $1;HttpOnly;Secure;SameSite=strict
########################################################################
Header set Content-Security-Policy "frame-ancestors none;"
Header set Content-Security-Policy "default-src 'self';"
Header set Referrer-Policy "same-origin"
#Header unset Cookie
#Header unset Set-Cookie
Header always set X-Frame-Options "SAMEORIGIN"
Header always set X-Xss-Protection "1; mode=block"
Header always set X-Content-Type-Options "nosniff"
Header always set Strict-Transport-Security "max-age=63072000; includeSubDomains; preload"
#Header always set Feature-Policy "fullscreen 'none'; microphone 'none'"
#Permissions-Policy Header
#https://scotthelme.co.uk/goodbye-feature-policy-and-hello-permissions-policy/
Header always set Permissions-Policy "geolocation=(); midi=();notifications=();push=();sync-xhr=();accelerometer=(); gyroscope=(); magnetometer=(); payment=(); camera=(); microphone=();usb=(); xr=();speaker=(self);vibrate=();fullscreen=(self);"
########################################################################
#SSLOpenSSLConfCmd Protocol "-ALL, TLSv1.2, TLSv1.3"
#SSLProtocol TLSv1.2
#SSLProtocol -all +TLSv1.2
#SSLProtocol -all +TLSv1.2 +TLSv1.3
#SSLProtocol all -SSLv2 -SSLv3 -TLSv1 -TLSv1.1
#SSLCipherSuite HIGH:!aNULL:!MD5:!3DES
#SSLHonorCipherOrder on
#SSLCompression off
########################################################################
#X-Powered-By - Apache
#https://scotthelme.co.uk/hardening-your-http-response-headers/#x-powered-by
Header unset X-Powered-By
A adresar "/home/xYYYYYY/www/soukrome" bych chtel zpristupnit jen pod heslem.
Takze jsem do neho prekopiroval:
.htpasswd
<Directory "/home/xYYYYYY/www/soukrome">
AuthType Basic
AuthName "Restricted Content - Username/Password Required"
AuthUserFile /home/xYYYYYY/www/soukrome/.htpasswd
Require valid-user
</Directory>
Vygeneroval na strankach
https://hostingcanada.org/htpasswd-generator/Apache specific salted MD1 - moje:tajne
.htaccess
moje:$apr1$kb38urah$/P2CyVygjt0ggyfQw43dI.
index.html
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=windows-1252">
<title>Test</title>
</head>
<body>
<h1>Success: test/soukrome</h1>
</body>
</html>
Ale prohlizec krici chybu 500 Internal Server Error, poradi nekdo kde delam chybu?