Hi
these are my config files
in httpd.conf add
LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_http_module modules/mod_proxy_http.so
LoadModule proxy_ajp_module modules/mod_proxy_ajp.so
LoadModule proxy_balancer_module modules/mod_proxy_balancer.so
and include the proxy config files
<IfModule proxy_module>
<IfModule proxy_ajp_module>
<IfModule proxy_balancer_module>
Include conf/extra/httpd-balancer.conf
</IfModule>
</IfModule>
</IfModule>
and here is the httpd-balancer.conf
ProxyRequests off
#
===============================================================================================
#
# #
# Balancer Manager in Apache #
# http://testweb.tres.bnc.ca/balancer-manager #
# #
#
===============================================================================================
#
<Location /balancer-manager>
SetHandler balancer-manager
AuthType Digest
AuthName "/server-info"
AuthDigestDomain /server-info https://testweb.tres.bnc.ca/server-info
AuthDigestProvider file
AuthUserFile /usr/local/apache2.2.4/conf/.digest_pw
Require valid-user
Order Deny,Allow
Allow from all
BrowserMatch "MSIE" AuthDigestEnableQueryStringHack=On
</Location>
#balancers
<Proxy balancer://tomcats/>
BalancerMember ajp://server1:8881 route=server1 loadfactor=1 keepalive=On
BalancerMember ajp://server2:8882 route=server2 loadfactor=1 keepalive=On
</Proxy>
#balanced application
<Location /app1/>
ProxyPass balancer://tomcats/app1/ nofailover=On lbmethod=byrequests
ProxyPassReverse balancer://tomcats/app1/
Order Deny,Allow
Allow from all
</Location>
<Location /app2/>
ProxyPass balancer://tomcats/app2/ nofailover=On lbmethod=byrequests
ProxyPassReverse balancer://tomcats/app2/
Order Deny,Allow
Allow from all
</Location>
also add the jvmroot in your tomcat server.xml in the first tomcat
<Engine name="Catalina" defaultHost="server1" jvmRoute="server1">
.........
</Engine>
and in the second tomcat
<Engine name="Catalina" defaultHost="server2" jvmRoute="server2">
.........
</Engine>
that's it
From: [email protected]
To: [email protected]; [email protected]
Date: Fri, 15 Jan 2010 03:40:21 +0000
Subject: RE: [us...@httpd] Apache 2.2: mod_proxy_balancer does not work as
documented?
English message follows
Salut Francis
Le mod_proxy fonctionne tres bien, je l'utilise en production depuis 2005 et
mon apache est configuré pour service une quinzaine de tomcats repartis sur 6
virtuels host. Le JvmRoute est tres important, ça ne marche pas sans ce
parametre. Je suis maintenant à la maison, quand j'arriverai demain au bureau
je t'enverrai ma config.
Hi Francis,
The mod_proxy works well, I'm using it in production since 2005 and my apache
is configured to service a around 15 Tomcats using 6 virtual hosts. The
JvmRoute is very important, it does not work without this parameter.
Now, I am at home, when I'll get to the office tomorrow I'll send to you my
config.
Inas
> Date: Thu, 14 Jan 2010 09:28:37 +0100
> From: [email protected]
> To: [email protected]
> Subject: [us...@httpd] Apache 2.2: mod_proxy_balancer does not work as
> documented?
>
> Hello everyone,
>
> For a production platform, we have plans to migrate to Apache 2.2,
> using mod_proxy_ajp and mod_proxy_balancer instead of mod_jk.
>
> Unfortunately, while the "single Tomcat below" case works with no
> problem, the balancer does not work at all...
>
> Here is the relevant part of the configuration:
>
> <Proxy balancer://rod-r7>
> BalancerMember
> ajp://tomcat-rod-r7.admin.one2team.rod:8009 keepalive=On
> BalancerMember
> ajp://tomcat-cdgdev-r7.admin.one2team.rod:8009 keepalive=On
> ProxySet stickysession=JSESSIONID nofailover=On
> </Proxy>
>
> RewriteEngine On
> RewriteCond %{REQUEST_URI} ^/servlet/ [OR]
> RewriteCond %{REQUEST_URI} \.jsp$
> RewriteRule ^/(.*) balancer://rod-r7/$1 [P]
>
> With this configuration, sessions do not stick :(
>
> So, looking at the documentation again, I saw that there is a
> scolonpathdelim parameter which can be set to On, in order to account
> for the part behind the ';' in the JSESSIONID. And indeed, there is
> one in the generated cookies.
>
> Unfortunately, when I add this to the ProxySet directive above, httpd
> -S says that the parameter is unknown :(
>
> Help :(
>
> --
>
> Francis Galiegue
> ONE2TEAM
> Ingénieur système
> Mob : +33 (0) 683 877 875
> Tel : +33 (0) 178 945 552
> [email protected]
> 40 avenue Raymond Poincaré
> 75116 Paris
>
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: [email protected]
> " from the digest: [email protected]
> For additional commands, e-mail: [email protected]
>
Windows 7 : Trouvez le PC qui vous convient! Découvrez notre offre !
_________________________________________________________________
Discutez en direct avec vos amis sur Messenger !
http://www.windowslive.fr/messenger