[ILUG] [OT] mod_proxy_ajp Apache and session cookie issues
aj.mckee at gmail.com
Fri Jan 25 17:07:20 GMT 2008
I have two application servers running tomcat 5.0.28 (has to be this
I am using Apache 2.2.3 on RHEL 5.1
Apache is using mod_proxy_ajp and mod_proxy_balancer.
So my configs look like;
BalancerMember ajp://localhost:8009 route=node01
BalancerMember ajp://node02:8009 route=node02
- Proxy Config
ProxyPass / balancer://ajpBalance/myApp/
stickysession=JSESSIONID|jsessionid nofailover=On lbmethod=byrequests
ProxyPassReverseCookieDomain localhost foo.com
ProxyPassReverse / balancer://ajpBalance/myApp/
ProxyPassReverseCookiePath /myApp /
The issue I am having is related to the jsessionid. If I say add
something to my cart, it is added no problem by the app. However when
I send another request for a page, and it appears to be served by
node02 of the app servers, It does not use my session from the
previous request. This is prob. because I am using
ProxyPassReverseCookie, which, has the effect of clearing my session.
If I disable all the ProxyPass directives in relation to my cookie the
app fails as the jsessionid is not attached to the request.
Now I reckon this is a fairly common issue, but I have not been able
to find anything on it yet. Does anyone know what I am doing wrong, so
that no matter what app node I hit, I will still get my session cookie
Its been wreaking my head all day, so it must be something simple I've missed.
More information about the ILUG