I wanted to follow up and provide some more detailed info on setting up the reverse proxy. My environment is ERS Apache 2.2.9, but this should work for other Apache 2.2.x as well. (Though things may change slightly for the better when 2.2.12 is released)
1. Load the proxy balancer module
=================================
I needed to add this line, as I do not think this module is loaded in the default ERS module set. Make sure the other two required modules are also loaded and not commented out: mod_proxy and mod_proxy_http.
Code:
LoadModule proxy_balancer_module "/<your install path>/apache2.2/modules/standard/mod_proxy_balancer.so"
2. Add the proxy config:
========================
Code:
#DAN PROXY LB TEST
<Proxy balancer://dan_two>
BalancerMember http://192.168.0.203:8081 route=ONE loadfactor=50
BalancerMember http://192.168.0.203:8082 route=TWO loadfactor=50
ProxySet lbmethod=byrequests
</Proxy>
ProxyPass /swf-booking-mvc balancer://dan_two/swf-booking-mvc
ProxyPassReverse /swf-booking-mvc http://192.168.0.203:8081/swf-booking-mvc
ProxyPassReverse /swf-booking-mvc http://192.168.0.203:8082/swf-booking-mvc
3. [Optional] Enable the balancer-manager to watch the activity and control the behavior
================================================== ======================================
The mod_status module must be loaded.
Add the following to the Apache httpsd.conf file:
Code:
<Location /balancer-manager>
SetHandler balancer-manager
Order Deny,Allow
Deny from all
# BE VERY RESTRICTIVE with YOUR ALLOW STATEMENT
Allow from 127.0.0.1
</Location>
4. [Optional] Enable sticky sessions by setting jvmRoute in Tomcat
================================================== ================
In each of the back end Tomcat servers, edit the server.xml and modify the <Engine> element:
Before:
Code:
<Engine defaultHost="localhost" name="Catalina">
After:
Code:
<Engine defaultHost="localhost" name="Catalina" jvmRoute="ONE">
Repeat for each tomcat instance, setting the correct and unique jvmRoute. Each jvmRoute matches the route value on the Apache side.
===END===
This should enable Apache as a load-balanced reverse proxy.
Be sure to clear browser cache frequently when testing.