problems with mod_proxy, tomcat6/ajp and jsessionid/cookies

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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


[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux