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:06] jango [Load bvalancer] |
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/ | ||
< | < | ||
- | Listen 443 | + | LoadModule proxy_module modules/mod_proxy.so |
- | + | LoadModule proxy_http_module modules/mod_proxy_http.so | |
- | NameVirtualHost *:443 | + | |
- | < | + | |
- | + | ||
- | SSLEngine On | + | |
- | + | ||
- | # Set the path to SSL certificate | + | |
- | # Usage: SSLCertificateFile | + | |
- | | + | |
- | + | ||
- | + | ||
- | # Servers to proxy the connection, or; | + | |
- | # List of application servers: | + | |
- | # Usage: | + | |
- | # ProxyPass / http://[IP Addr.]: | + | |
- | # ProxyPassReverse / http://[IP Addr.]: | + | |
- | # Example: | + | |
- | ProxyPass / http:// | + | |
- | ProxyPassReverse / http:// | + | |
- | + | ||
- | # Or, balance the load: | + | |
- | # ProxyPass / balancer:// | + | |
- | + | ||
- | </ | + | |
</ | </ | ||
- | =====Load baalancer===== | + | und neu starten! |
+ | ====Konfiguration==== | ||
< | < | ||
- | | + | <VirtualHost *:*> |
- | # Define back-end servers: | + | ServerName localhost |
+ | ProxyPreserveHost On | ||
+ | ProxyPass | ||
+ | ProxyPassReverse / http:// | ||
+ | </ | ||
+ | </ | ||
- | | + | =====Load balancer===== |
- | BalancerMember http://0.0.0.0:8080/ | + | |
- | + | < | |
- | # Server 2 | + | <Proxy balancer:// |
- | BalancerMember http://0.0.0.0:8081/ | + | # Define back-end servers: |
- | </ | + | |
- | + | # Server 1 | |
- | < | + | BalancerMember http://10.0.0.2:8080/ |
- | # Apply VH settings as desired | + | |
- | # However, configure ProxyPass argument to | + | # Server 2 |
- | # use " | + | BalancerMember http://10.0.0.2:8081/ |
- | + | </ | |
- | | + | |
- | </ | + | < |
+ | ProxyPass / balancer:// | ||
+ | </ | ||
</ | </ | ||
=====Handler===== | =====Handler===== |