0

First off I am running on windows for my sins.

I have two tomcat instances of the same web application running on two different ports & I can access both OK directly http://localhost:7070/foo/ and http://localhost:8080/foo/

And I want to be able to go to the following URLs: http://localhost/foo1/ and http://localhost/foo2/

If I have the following simple setup for one site all is good and I can get to http://localhost/foo/:

ProxyRequests off
ProxyPreserveHost off
RewriteEngine On
<VirtualHost *:80> ]
  ProxyPass /foo/ http://localhost:7070/foo/ 
  ProxyPassReverse /foo/ http://localhost:7070/foo/
</VirtualHost>

With the following change to the config referring to 'foo1':

ProxyRequests off
ProxyPreserveHost off
RewriteEngine On
<VirtualHost *:80> ]
  ProxyPass /foo1/ http://localhost:7070/foo/ 
  ProxyPassReverse /foo1/ http://localhost:7070/foo/
</VirtualHost>

Two odd things appear to be happening:

  1. I can then get to http://localhost/foo1/ & login OK & get to the default page, but oddly the sessionid is in the URL & I can not get to other pages within the web app.

  2. when I look on the tomcat manager page I see a large number of active sessions after a few login attempts instead of just the one per user.

If I login directly to the tomcat webpage http://localhost:7070/foo/ there is no visible sessionid but all still works.

Any ideas on how my config should be set up please?

techraf
  • 4,243
  • 8
  • 29
  • 44
Bill Comer
  • 101
  • 1

1 Answers1

0

Have a look at ProxyPassReverseCookieDomain and ProxyPassReverseCookiePath directives http://httpd.apache.org/docs/2.4/mod/mod_proxy.html#proxypass
I bet your app is setting cookies and since there is no cookie rewrite in your config it resorts to using jsessionid in url.

Dmitry Zayats
  • 1,378
  • 7
  • 7