Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
sudo a2enmod headers proxy proxy_balancer proxy_http

If you are running Apache 2.4, you will need to also enable the following module.

Code Block
sudo a2enmod lbmethod_byrequests


Configure a new site with the proxy and balancer modules. Create a new file in /etc/apache2/sites-available, named jwsite

...

Code Block
NameVirtualHost *
<VirtualHost *>
	DocumentRoot "/var/www/jwsite" 
	ServerName localhost
	ServerAdmin support@mycompany.com
    ErrorLog /var/log/apache2/jwsite-error.log
    CustomLog /var/log/apache2/jwsite-access.log combined
	DirectoryIndex index.html index.htm 
	<Proxy balancer://cluster>
		BalancerMember http://server1:8080 route=node01
		BalancerMember http://server2:8080 route=node02
		Order deny,allow
		Allow from all
	</Proxy> 
	ProxyPreserveHost On
	ProxyPass /jw balancer://cluster/jw stickysession=JSESSIONID
	ProxyPassReverse /jw balancer://cluster/jw
</VirtualHost>

...