====== apache ======
**apache** ist ein [[Webserver]].
===== .htaccess =====
==== Weiterleitung ====
> Redirect /index.html /me/
==== .httpasswd erzeugen ====
//Siehe weiter unten...//
===== Proxy-Konfiguration =====
==== Unix-Sockets ====
Listen 80
ProxyPass unix:/tmp/helloHTTP.s|http://127.0.0.1/
ProxyPassReverse unix:/tmp/helloHTTP.s|http://127.0.0.1/
===== mod_rewrite =====
==== http auf http und https auf https ====
RewriteEngine On
RewriteCond %{HTTPS} on
RewriteRule ^ - [env=protoc:https]
RewriteCond %{HTTPS} off
RewriteRule ^ - [env=protoc:http]
RewriteCond %{REQUEST_URI} /api/profile/
RewriteRule ^(.*)$ %{ENV:protoc}://whatsee-profile.s3.amazonaws.com/$1 [R,L]
==== www to non-www ====
# www to nicht-www
RewriteBase /
RewriteCond %{HTTPS} on
RewriteRule ^ - [env=protoc:https]
RewriteCond %{HTTPS} off
RewriteRule ^ - [env=protoc:http]
RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
RewriteRule ^(.*)$ %{ENV:protoc}://%1/$1 [R=301,L]
===== .httpasswd erzeugen =====
Passwortdatei generieren
> htpasswd -c -b /path/to/.htpasswd username passwort
Beispiel für apache/sites-available/test.conf oder .htaccess
AuthType Basic
AuthName "My Protected Area"
AuthUserFile /path/to/.htpasswd
Require valid-user
===== mod_php =====
==== .phar-Dateien ausführen ====
Von [[texte:enable_.phar_handling_in_your_web_server|Enable .phar handling in your web server]]
/etc/apache2/mods-enabled/php5.conf öffnen und die Zeile ändern von:
>
in
>
===== Siehe auch =====
* [[linux:bots_blocken_per_.htaccess_mit_apache|Bots blocken per .htaccess mit apache]]
===== Weblinks =====
* http://apache.org
* [[wp>DE:Apache HTTP Server]]
==== Howtos ====
* [[https://ho2e.de/wallabag/?view=view&id=184|HSTS: Header Strict Transport Security für Webserver einrichten]] ([[HSTS]])