basic ubuntu with apache and modules required for load balancing with mod_proxy
1.3K
To run this image as load balancer, just run with this command, obviously use your own ips and files.
docker run -d -p 192.168.176.135:80:80 -v /home/apache/000-default.conf:/etc/apache2/sites-enabled/000-default.conf -it --name apache apache-dev /usr/sbin/apache2ctl -D FOREGROUND
I am using this configuration to know where are my tomcats, just modify what you need:
<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
ProxyRequests Off
ProxyPreserveHost On
<Proxy balancer://my_cluster>
BalancerMember http://IP:PORT route=w2 (tomcat machines)
BalancerMember http://IP:PORT route=w1 (tomcat machines)
AllowOverride None
Order allow,deny
allow from all
ProxySet lbmethod=byrequests
ProxySet stickysession=ROUTEID
</Proxy>
<Location /balancer-manager> SetHandler balancer-manager ProxyPass /balancer-manager ! ProxyPass / balancer://my_cluster/
Content type
Image
Digest
Size
88 MB
Last updated
almost 11 years ago
docker pull dockerdudu/apache