Hi there, 

we are using mod_proxy, mod_proxy_ajp and mod_proxy_balancer for
loadbalancing between two tomcat servers.

We are using apache 2.2.3 (Linux/SUSE) (on suse linux enterprise server)
and two tomcats 6.0.26

Our proxy related apache configuration looks like

<Proxy balancer://mycluster/>
BalancerMember ajp://localhost:7009 route=jvmtest01
BalancerMember ajp://localhost:7010 route=jvmtest02
</Proxy>
ProxyPass / balancer://mycluster/ stickysession=JSESSIONID|jsessionid
nofailover=On
ProxyPassReverse / balancer://mycluster/

The tomcat setings.xml seems to be correct as well:

tomcat1
<Connector port="7080" protocol="HTTP/1.1" connectionTimeout="20000"
redirectPort="8443" /> 
<Connector port="7009" protocol="AJP/1.3" redirectPort="8443" /> 
<Engine name="Catalina" defaultHost="localhost" jvmRoute="jvmtest01">

tomcat2
<Connector port="7081" protocol="HTTP/1.1" connectionTimeout="20000"
redirectPort="8443" />   
<Connector port="7010" protocol="AJP/1.3" redirectPort="8443" /> 
<Engine name="Catalina" defaultHost="localhost" jvmRoute="jvmtest02">

As long as only one balancermember is defined everything works as expected.
So
<Proxy balancer://mycluster/>
# BalancerMember ajp://localhost:7009 route=jvmtest01
BalancerMember ajp://localhost:7010 route=jvmtest02
</Proxy>
As well as 
<Proxy balancer://mycluster/>
BalancerMember ajp://localhost:7009 route=jvmtest01
# BalancerMember ajp://localhost:7010 route=jvmtest02
</Proxy>
is working.

But as soon as both BalancerMember are configured we are getting an endless
loop once we try to access the app. See the following requests and
responses that the browser is performing below. Looks like the "stickyness"
somehow does not work? The funny thing is that the same setup as above
works on an ubuntu system with Apache/2.2.8 (Ubuntu)

One additional part of information is the fact that while starting
troublemaking apache (the one on suse) the error "Cannot determine host
name..." occurs. Could it be that this is the reason why it does not work?
Unfortunately I wasn't able to correct that error message because I no
longer have root access to the system.

Any other ideas of how to possibly fix this?

Request 1
GET /app-context/login.0 HTTP/1.1
Host: hostname.de
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.9.2.3)
Gecko/20100401 Firefox/3.6.3
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: de-de,de;q=0.8,en-us;q=0.5,en;q=0.3
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 115
Connection: keep-alive
Cookie: JSESSIONID=3D0A27633D06E88E58C345F687E48A84.jvmtest01

Response 1
HTTP/1.1 302 Moved Temporarily
Date: Wed, 23 Jun 2010 14:53:56 GMT
Set-Cookie: JSESSIONID=67EF7D0025583CCBEA7F8CB19E979F33.jvmtest02;
Path=/app-context
Location: http://hostname.de/app-context/login.0
Content-Length: 0
Keep-Alive: timeout=15, max=100
Connection: Keep-Alive
Content-Type: text/plain

Request 2
GET /app-context/login.0 HTTP/1.1
Host: hostname.de
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.9.2.3)
Gecko/20100401 Firefox/3.6.3
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: de-de,de;q=0.8,en-us;q=0.5,en;q=0.3
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 115
Connection: keep-alive
Cookie: JSESSIONID=67EF7D0025583CCBEA7F8CB19E979F33.jvmtest02

Response 2
HTTP/1.1 302 Moved Temporarily
Date: Wed, 23 Jun 2010 14:53:56 GMT
Set-Cookie: JSESSIONID=75965FC0843D5021F8FCAF7EE18F53F2.jvmtest01;
Path=/app-context
Location: http://hostname.de/app-context/login.0
Content-Length: 0
Keep-Alive: timeout=15, max=99
Connection: Keep-Alive
Content-Type: text/plain

Request 3
GET /app-context/login.0 HTTP/1.1
Host: hostname.de
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.9.2.3)
Gecko/20100401 Firefox/3.6.3
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: de-de,de;q=0.8,en-us;q=0.5,en;q=0.3
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 115
Connection: keep-alive
Cookie: JSESSIONID=75965FC0843D5021F8FCAF7EE18F53F2.jvmtest01

Response 3
HTTP/1.1 302 Moved Temporarily
Date: Wed, 23 Jun 2010 14:53:56 GMT
Set-Cookie: JSESSIONID=F97F81DC80CE08C086C720CFA063AFB1.jvmtest02;
Path=/app-context
Location: http://hostname.de/app-context/login.0
Content-Length: 0
Keep-Alive: timeout=15, max=98
Connection: Keep-Alive
Content-Type: text/plain




---------------------------------------------------------------------
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: users-unsubscr...@httpd.apache.org
   "   from the digest: users-digest-unsubscr...@httpd.apache.org
For additional commands, e-mail: users-h...@httpd.apache.org

Reply via email to