Benutzer-Werkzeuge

Webseiten-Werkzeuge


apache2

Unterschiede

Hier werden die Unterschiede zwischen zwei Versionen angezeigt.

Link zu dieser Vergleichsansicht

Beide Seiten der vorigen Revision Vorhergehende Überarbeitung
Nächste Überarbeitung
Vorhergehende Überarbeitung
apache2 [2025/04/21 11:06]
jango [Virtuelle Hosts]
apache2 [2025/06/24 11:01] (aktuell)
jango [Load balancer]
Zeile 1: Zeile 1:
-Apache ist ein quelloffener Webserver. Auf einen Umstieg auf NginX wird geraten. Siehe auch [[htaccess]], [[coding:php|PHP]] und [[mysql|MySQL]].+Apache2 ist ein quelloffener Webserver. von der [[apache|Apache Foundation]]. Auf einen Umstieg auf NginX wird geraten. Siehe auch [[htaccess]], [[coding:php|PHP]] und [[mysql|MySQL]].
  
 =====Installation===== =====Installation=====
Zeile 93: Zeile 93:
 =====Proxy===== =====Proxy=====
  
 +====Linux====
 <code> <code>
-<VirtualHost *:*> +a2enmod proxy 
-        ProxyPreserveHost On +a2enmod proxy_http 
-         +systemctl restart apache2
-        # Servers to proxy the connection, or; +
-        # List of application servers: +
-        # Usage: +
-        # ProxyPass / http://[IP Addr.]:[port]/ +
-        # ProxyPassReverse / http://[IP Addr.]:[port]/ +
-        # Example:  +
-        ProxyPass / http://0.0.0.0:8080/ +
-        ProxyPassReverse / http://0.0.0.0:8080/ +
-         +
-        ServerName localhost +
-    </VirtualHost>+
 </code> </code>
 +
 +====Windows====
 +
 +Auf Windows in httpd.conf oder einer .conf-Datei im conf/extra-Verzeichnis folgendes eintragen/auskommentieren
  
 <code> <code>
-Listen 443 +LoadModule proxy_module modules/mod_proxy.so 
-      +LoadModule proxy_http_module modules/mod_proxy_http.so
-    NameVirtualHost *:443 +
-    <VirtualHost *:443> +
-     +
-        SSLEngine On +
-         +
-        # Set the path to SSL certificate +
-        # Usage: SSLCertificateFile /path/to/cert.pem +
-        SSLCertificateFile /etc/apache2/ssl/file.pem +
-         +
-         +
-        # Servers to proxy the connection, or; +
-        # List of application servers: +
-        # Usage: +
-        # ProxyPass / http://[IP Addr.]:[port]/ +
-        # ProxyPassReverse / http://[IP Addr.]:[port]/ +
-        # Example:  +
-        ProxyPass / http://0.0.0.0:8080/ +
-        ProxyPassReverse / http://0.0.0.0:8080/ +
-         +
-        # Or, balance the load: +
-        # ProxyPass / balancer://balancer_cluster_name +
-     +
-    </VirtualHost>+
 </code> </code>
  
-=====Load bvalancer=====+und neu starten! 
 +====Konfiguration====
  
 <code> <code>
-    <Proxy balancer://mycluster> +<VirtualHost *:*> 
-        # Define back-end servers:+ ServerName localhost 
 + ProxyPreserveHost On 
 + ProxyPass http://10.0.0.2:8080
 + ProxyPassReverse / http://10.0.0.2:8080/ 
 +</VirtualHost> 
 +</code>
  
-        # Server 1 +=====Load balancer===== 
-        BalancerMember http://0.0.0.0:8080/ + 
-         +<code> 
-        # Server 2 +<Proxy balancer://mycluster> 
-        BalancerMember http://0.0.0.0:8081/ + # Define back-end servers: 
-    </Proxy> + 
-     + # Server 1 
-    <VirtualHost *:*> + BalancerMember http://10.0.0.2:8080/ 
-        # Apply VH settings as desired + 
-        # However, configure ProxyPass argument to + # Server 2 
-        # use "mycluster" to balance the load + BalancerMember http://10.0.0.2:8081/ 
-         +</Proxy> 
-        ProxyPass / balancer://mycluster + 
-    </VirtualHost>+<VirtualHost *:*> 
 + ProxyPass / balancer://mycluster 
 +</VirtualHost>
 </code> </code>
 =====Handler===== =====Handler=====
apache2.1745226379.txt.gz · Zuletzt geändert: 2025/04/21 11:06 von jango