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@example.com
 	ErrorLog /var/www/jwsite/logs/error.log
    CustomLog /var/www/jwsite/logs/access.log combined
	DirectoryIndex index.html index.htm 
	<Proxy balancer://wscluster>
		BalancerMember ws://server1:8080 route=node01
		BalancerMember ws://server2:8080 route=node02
		Order deny,allow
		Allow from all
	</Proxy>
	ProxyPass /jw/web/applog balancer://wscluster/jw/web/applog stickysession=JSESSIONID|jsessionid
	ProxyPassReverse /jw/web/applog balancer://wscluster/jw/web/applog
	<Proxy balancer://cluster>
		BalancerMember http://server1:8080 route=node01
		BalancerMember http://server2:8080 route=node02
		Order deny,allow
		Allow from all
	</Proxy> 
	ProxyPass /jw balancer://cluster/jw stickysession=JSESSIONID|jsessionid
	ProxyPassReverse /jw balancer://cluster/jw
	ProxyPreserveHost On
</VirtualHost>

...