[prev in list] [next in list] [prev in thread] [next in thread] 

List:       apache-httpd-users
Subject:    [users@httpd] problems with mod_proxy, tomcat6/ajp and jsessionid/cookies
From:       "Michael Biebl" <mbiebl () gmail ! com>
Date:       2009-01-06 2:31:06
Message-ID: aa76cdac0901051831y3ef5a47fn68bfd1bfb7580e95 () mail ! gmail ! com
[Download RAW message or body]

Hi list,

I having problems, getting apache mod_proxy to work with tomcat6 with
regard to sessions/cookies the way I like.

First of, these are the versions I use:
tomcat 6.0.18
apache 2.2.9 (debian lenny)

I want to use mod_proxy (as replacement for mod_jk) for serving tomcat
pages via apache.

My initial configuration was

<Virtualhost *:80>
...
        ProxyRequests Off
        ProxyVia On
        ProxyPass / ajp://localhost:8009/barcooServer/
        ProxyPassReverse / ajp://localhost:8009/barcooServer/
...
</VirtualHost>

I have session support enabled in the tomcat web app.
Unfortunately, when I browse the web site that is served by apache,
the session is not stored via a cookie but a ;jsessionid=... is
appended to the url, e.g.
http://barcoo.de/presse.jsf;jsessionid=62B2D7979D569DB9826E79AB600F144D

I don't want that, as that is bad for SEO and easy bookmarking.

After googling around, I found the following directive and added it to
the above configuration

        ProxyPassReverseCookiePath /barcooServer /

This solves the problem, but only partially. The first time you browse
the web site, the jsessionid variable is still appended to the url. If
I reload the page, or click any links, the cookie is correctly set and
the variable disappears from the urls.

You can test this behaviour on: http://barcoo.de

Now my question is, how can I get mod_proxy / apache, to also set the
cookie correctly on the first page that is served.
Is there a misconfiguration on my side (either apache or tomcat) or is
there a bug somewhere.
The tomcat6 server.xml is pretty much unchanged from the default configuration.


TIA,
Michael



-- 
Why is it that all of the instruments seeking intelligent life in the
universe are pointed away from Earth?

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

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic