Hier werden die Unterschiede zwischen zwei Versionen angezeigt.
Beide Seiten der vorigen Revision Vorhergehende Überarbeitung Nächste Überarbeitung | Vorhergehende Überarbeitung | ||
apache2 [2025/04/21 11:07] jango [Proxy] |
apache2 [2025/06/24 11:01] (aktuell) jango [Load balancer] |
||
---|---|---|---|
Zeile 1: | Zeile 1: | ||
- | Apache | + | Apache2 |
=====Installation===== | =====Installation===== | ||
Zeile 93: | Zeile 93: | ||
=====Proxy===== | =====Proxy===== | ||
+ | ====Linux==== | ||
< | < | ||
- | < | + | a2enmod |
- | ProxyPreserveHost On | + | a2enmod proxy_http |
- | + | systemctl restart apache2 | |
- | # Servers to proxy the connection, or; | + | |
- | # List of application servers: | + | |
- | # Usage: | + | |
- | # ProxyPass / http://[IP Addr.]: | + | |
- | # ProxyPassReverse / http://[IP Addr.]: | + | |
- | # Example: | + | |
- | ProxyPass / http:// | + | |
- | ProxyPassReverse / http:// | + | |
- | | + | |
- | | + | |
- | </ | + | |
</ | </ | ||
+ | |||
+ | ====Windows==== | ||
+ | |||
+ | Auf Windows in httpd.conf oder einer .conf-Datei im conf/ | ||
< | < | ||
- | < | + | LoadModule proxy_module modules/mod_proxy.so |
- | + | LoadModule proxy_http_module modules/mod_proxy_http.so | |
- | SSLEngine On | + | </ |
- | + | ||
- | # Set the path to SSL certificate | + | und neu starten! |
- | # Usage: SSLCertificateFile | + | ====Konfiguration==== |
- | | + | |
- | + | < | |
- | + | < | |
- | # Servers to proxy the connection, or; | + | ServerName localhost |
- | # List of application servers: | + | ProxyPreserveHost On |
- | # Usage: | + | ProxyPass / http://10.0.0.2:8080/ |
- | # ProxyPass / http://[IP Addr.]: | + | ProxyPassReverse / http://10.0.0.2:8080/ |
- | # ProxyPassReverse / http://[IP Addr.]: | + | </ |
- | # Example: | + | |
- | ProxyPass / http://0.0.0.0:8080/ | + | |
- | ProxyPassReverse / http://0.0.0.0:8080/ | + | |
- | + | ||
- | # Or, balance the load: | + | |
- | # ProxyPass / balancer:// | + | |
- | + | ||
- | | + | |
</ | </ | ||
Zeile 138: | Zeile 124: | ||
< | < | ||
- | | + | <Proxy balancer:// |
- | # Define back-end servers: | + | # Define back-end servers: |
- | | + | # Server 1 |
- | BalancerMember http://0.0.0.0:8080/ | + | BalancerMember http://10.0.0.2:8080/ |
- | + | ||
- | # Server 2 | + | # Server 2 |
- | BalancerMember http://0.0.0.0:8081/ | + | BalancerMember http://10.0.0.2:8081/ |
- | </ | + | </ |
- | + | ||
- | < | + | < |
- | # Apply VH settings as desired | + | ProxyPass / balancer:// |
- | # However, configure ProxyPass argument to | + | </ |
- | # use " | + | |
- | + | ||
- | | + | |
- | </ | + | |
</ | </ | ||
=====Handler===== | =====Handler===== |