apache
Unterschiede
Hier werden die Unterschiede zwischen zwei Versionen angezeigt.
| Beide Seiten der vorigen RevisionVorhergehende ÜberarbeitungNächste Überarbeitung | Vorhergehende Überarbeitung | ||
| apache [2021-08-04 13:19:50] – [htpasswd] david | apache [2023-06-25 00:41:25] (aktuell) – [.htaccess] david | ||
|---|---|---|---|
| Zeile 2: | Zeile 2: | ||
| [[http:// | [[http:// | ||
| + | |||
| + | |||
| + | ===== .htaccess ===== | ||
| + | |||
| + | .htaccess testen/ | ||
| + | |||
| + | * [[https:// | ||
| + | * [[https:// | ||
| + | * [[https:// | ||
| + | |||
| + | |||
| + | ==== Beispiel ==== | ||
| + | |||
| + | * Dateiauflistung deaktivieren | ||
| + | * HSTS-Header setzen | ||
| + | * HTTP zu HTTPS und WWW zu non-WWW umleiten | ||
| + | * ist nur ein einziger redirect, da das **L** und **R** Flag nur einmal vorhanden sind | ||
| + | * man kann statt dem neueren 308 auch den klassischen 301 redirect verwenden | ||
| + | * Zugriff zu versteckten Dateien (.dotfiles) verweigern | ||
| + | |||
| + | <code apache .htaccess> | ||
| + | # disable directory index | ||
| + | Options All -Indexes | ||
| + | |||
| + | # HSTS header | ||
| + | Header always set Strict-Transport-Security " | ||
| + | |||
| + | RewriteEngine on | ||
| + | |||
| + | # HTTP -> HTTPS | ||
| + | RewriteCond %{HTTPS} off [NC] | ||
| + | RewriteRule ^.*$ https:// | ||
| + | |||
| + | # WWW -> non-WWW | ||
| + | RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC] | ||
| + | RewriteRule ^.*$ https:// | ||
| + | |||
| + | # deny access to dotfiles | ||
| + | < | ||
| + | Require all denied | ||
| + | </ | ||
| + | </ | ||
| Zeile 572: | Zeile 614: | ||
| Benutzer mit Passwort anlegen: | Benutzer mit Passwort anlegen: | ||
| - | # htpasswd -c / | + | # htpasswd -BcC 13 / |
| New password: | New password: | ||
| Re-type new password: | Re-type new password: | ||
/home/http/wiki/data/attic/apache.1628083190.txt · Zuletzt geändert: von david
