On 20.03.2009 18:48, János Löbb wrote:
Hi,
I have two real machines. One of them is a Windows XP running Apache
2.2.10 + mod_jk /release date of 10/30/2008/ + Tomcat 6.0.16. The other
one is a Mac with OSX 10.5.6 with Apache 2.2.9 + mod_jk 1.2.26 and
Tomcat 6.0.16.
The XP machine runs one instance of Tomcat /node4/. The Mac runs 3, -
node1,2,3. Altogether 4 tomcats and they form a cluster.
...
In front of these two machines is an Apache 2.2.10 in a VMWare Fusion
virtual Machine on Windows XP in the Mac and configured as a Reverse proxy
Here is the reverse proxy config from the httpd.conf
<snip>
ProxyRequests Off
<Proxy balancer://pathCluster>
BalancerMember http://bml0039.yalepath.org loadfactor=10
BalancerMember http://bml0073.yalepath.org loadfactor=10
ProxySet lbmethod=bytraffic
</Proxy>
ProxyPass /tc/ balancer://pathCluster/
ProxyPassReverse /tc/ balancer://pathCluster/
<Location /balancer-manager>
SetHandler balancer-manager
Order Deny,Allow
Allow from .yalepath.org
</Location>
</snip>
Here is the access_log from the reverse proxy:
<snip>
10.84.2.195 - - [20/Mar/2009:12:09:48 -0400] "GET /tc/CassetteLabeler
HTTP/1.1" 302 -
Returns with a trailing slash redirect
10.84.2.195 - - [20/Mar/2009:12:09:49 -0400] "GET /tc/CassetteLabeler/
HTTP/1.1" 200 1506
Returns Content with 1506 Bytes
10.84.2.195 - - [20/Mar/2009:12:09:49 -0400] "GET
/CassetteLabeler/pathology.labeler.labeler.Labeler/Labeler.html
HTTP/1.1" 404 260
Wrong request, Prefix /tc/ missing. You need to find out, where this
request comes from. Likely it is either generated by someone using a
link in the page returned by the previous request, or that page contains
a meta tag in the head, which triggers a redirect to this wrong URL.
So retrieve /tc/CassetteLabeler/ and have a look at the content to
identify, whether the wrong URL
"/CassetteLabeler/pathology.labeler.labeler.Labeler/Labeler.html" is in
the page.
If no, we have to think further.
If yes, you have to ask, why is this wrong URL in there. The question
is, how your application generates this URL. If it generates absolute
URLs instead of relative ones, then you can easily run into trouble,
when the path of the real application is different from the path used
from the outside.
It is not unlikely though, that in such a case the app or the framework
used has a configurable path prefix. But first check, if you can verify
the wrong URL is somewhere in the content of the page.
The request from the reverse proxy did go to the XP machine:
Here are the log entries from the access log:
<snip>
10.84.2.195 - - [20/Mar/2009:12:09:49 -0400] "GET /CassetteLabeler
HTTP/1.1" 302 -
That's only the first request, answered with the trailing slash
redirect. The next request is the interesting one (the one answered with
status 200). It also has to appear somewhere in your 2nd laqyer httpd logs.
Here are the entries from mod_jk.log of this XP machine:
<snip>
[Fri Mar 20 12:09:49.254 2009] [852:1808] [debug] jk_uri_worker_map.c
(682): Attempting to map URI '/CassetteLabeler' from 5 maps
Again that's the first request
[Fri Mar 20 12:09:49.551 2009] [852:1808] [debug] jk_ajp_common.c (608):
status = 302
[Fri Mar 20 12:09:49.551 2009] [852:1808] [debug] jk_ajp_common.c (615):
Number of headers is = 1
[Fri Mar 20 12:09:49.551 2009] [852:1808] [debug] jk_ajp_common.c (671):
Header[0] [Location] = [http://bml0039.yalepath.org/CassetteLabeler/]
Aha, we get back a redirect (302) to localtion
http://bml0039.yalepath.org/CassetteLabeler/ (which will be further
rewritten by ProxyPassReverse). But that we already know. The next
request is the interesting one.
I have a production environment - just with 3 Macs and just one tomcat
per machine forming a cluster - where a very similar configuration runs
fine. The only difference is that the sticky parameters are NOT with the
load balancer but with the real workers in the workers.properties file,
This is very likely not the cause.
and the reverse proxy configuration somewhat different. Here it is:
<snip>
<IfModule mod_proxy_balancer.c>
ProxyPass /apps/ balancer://balancer-group/ stickysession=JSESSIONID
ProxyPassReverse /apps/ balancer://balancer-group/
<Proxy "balancer://balancer-group">
BalancerMember http://pathsrv1.yalepath.org loadfactor=10
BalancerMember http://raid2b.yalepath.org loadfactor=10
BalancerMember http://reptile.yalepath.org loadfactor=10
</Proxy>
</IfModule>
Looks pretty analogous at first sight.
Regards,
Rainer
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org