Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've been trying for the last couple of days to get this small (i though) scenario working.

Small drawing of my architecture.

 Apache1   Apache2
 Tomcat1   Tomcat2

So far i can get the following to work, either serving my cluster of Apache servers or serving my cluster of Tomcat servers.

The Apache cluster handles PHP sites and uses sticky sessions (works like a charm) and the Tomcat cluster handles JPS sites and this works as well.

What i need is when an request hits my load balancer (ApacheLB) and the host requested begins with say "admin" then the Tomcat cluster takes over other request handles by the Apache cluster.

Both clusters uses handles multiple sites. Some examples.

I´m using Apache 2.4, Tomcat 7, mod_proxy_balancer, all under Windows.

My config.

Apache LB
<VirtualHost *:80>

ProxyRequests Off
ProxyPreserveHost On

ProxyPass /balancer-manager !
ProxyPass / balancer://lb/ stickysession=BALANCEID nofailover=Off
ProxyPassReverse / http://windows-server1:8009/
ProxyPassReverse / http://windows-server2:8009/

<Proxy balancer://lb>
    BalancerMember http://windows-server1:8009/  route=node1 min=3 max=5
    BalancerMember http://windows-server2:8009/  route=node2
    ProxySet lbmethod=byrequests

<Location /balancer-manager>
    SetHandler balancer-manager
    AuthType Basic
    AuthName "Balancer Manager"
    AuthUserFile "C:/etc/lb/conf/.htpasswd"
    Require valid-user


<VirtualHost *:8009>
DocumentRoot "c:/etc/www/test"

<Directory "c:/etc/www/">
    AllowOverride All
    Order Allow,Deny
    Allow from all
    Require all granted


Any help would be great! Thanks!

Best regards Robert

share|improve this question
Are you looking to route requests to apache OR to tomcat depending upon uri in the request? – mahnsc Jan 21 '13 at 14:02
Hi @mahnsc, thats right, depending on URI (host) request should be handled by either the Apache cluster or the Tomcat cluster. – Robert Jan 21 '13 at 14:48
"Solved" it by creating to load balancer on different ports, handled by DNS. – Robert Jan 23 '13 at 14:56
If anyone comes up with a better solution im all ears. – Robert Jan 23 '13 at 14:56

From the comments

Solved" it by creating to load balancer on different ports, handled by DNS.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.