httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nes Yarug" <nes.ya...@gmail.com>
Subject [users@httpd] Two proxy balancers in two different virtual hosts
Date Mon, 30 Jul 2007 13:00:47 GMT
Hi all,

Another proxy balancer question from me, this one has been driving me
nuts...

My setup is as follows:

1 Gateway --> 1 Webserver X ---> 1 Application server
                      1 Webserver Y -->

This setup should handle two web applications served on two different
domains. The application server is running two different instances of JBoss.
The point is to have www.domain-a.com handled by one instance of JBoss and
www.domain-b.com handled by the other instance of JBoss. I have configured
JBoss so that app-a is served on port 8080 and app-b on port 8180. This is
working correctly if I access app-a or app-b from the application server
itself.

The gateway is running Apache 2.2.4 and I have two vhosts defined, a default
one for www.domain-a.com and another one for www.domain-b.com:

<VirtualHost _default_:80>

        ServerName www.domain-a.com:80
        ServerAdmin root@domain-a.com
        DocumentRoot "/var/www/localhost/htdocs"

        <IfModule mpm_peruser_module>
                ServerEnvironment apache apache
        </IfModule>

        ProxyPass / balancer://default/ stickysession=jsessionid
        ProxyPreserveHost On

        <Proxy balancer://default/>
                BalancerMember http://192.168.0.2:80
                BalancerMember http://192.168.0.3:80
        </Proxy><VirtualHost www.novaeres.com:80>

</VirtualHost>

<VirtualHost www.domain-b.com:80>

        ServerName www.domain-b.com:80
        ServerAdmin root@domain-b.com
        DocumentRoot "/var/www/localhost/htdocs"

        ProxyPass / balancer://domain-b/ stickysession=jsessionid
        ProxyPreserveHost On

        <Proxy balancer://domain-b/>
                BalancerMember http://192.168.0.2:80
                BalancerMember http://192.168.0.3:80
        </Proxy>

</VirtualHost>

Then, webserver X and webserver Y have the following configuration:

<VirtualHost _default_:80>
        ServerName www.domain-a.com
        ServerAdmin root@domain-a.com
        DocumentRoot "/var/www/localhost/htdocs"

        ProxyPass / balancer://default/ stickysession=jsessionid
        ProxyPreserveHost On

        <Proxy balancer://default/>
                BalancerMember http://192.168.0.4:8080
        </Proxy>

        <IfModule mpm_peruser_module>
                ServerEnvironment apache apache
        </IfModule>
</VirtualHost>

<VirtualHost www.domain-b.com:80>
        ServerName www.domain-b.com:80
        ServerAdmin root@domain-b.com
        DocumentRoot "/var/www/localhost/htdocs"
        ProxyPass / balancer://domain-b/ stickysession=jsessionid
        ProxyPreserveHost On
        <Proxy balancer://domain-b/>
                BalancerMember http://192.168.0.4:8180
        </Proxy>
        <IfModule mpm_peruser_module>
                ServerEnvironment apache apache
        </IfModule>
</VirtualHost>

Can anyone comment on the above configuration? A few things that indicate
something is configured wrong:

*) When I look at the balancer manager page for BOTH domain-a (
www.domain-a.com/balancer-manager) and domain-b (
www.domain-b.com/balancer-manager) it ALWAYS only lists the domain-b
balancer.
*) Requests for www.domain-a.com AND www.domain-b.com ALWAY end up on the
JBoss instance for domain-a

Any help greatly appreciated.

Yours truly,
Nes

Mime
View raw message