You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Mike Depot <md...@cmarket.com> on 2003/05/02 22:24:37 UTC

Session cookie path with reverse proxy

We are using Apache with mod_proxy as a reverse proxy in front of our
Tomcat.  In Tomcat we have two apps, which are (locally) accessible like
this: http://my.domain.com:8080/app1  and  http://my.domain.com:8080/app2

We have other stuff on our main web, and would like to keep these apps on a
virtual path on our web root, so we've configured the reverse proxy to
include the extra path info.  We've configured Apache something like this:

ProxyPass  /foo/bar/app1/  http://my.domain.com:8080/app1/
ProxyPass  /foo/bar/app2/  http://my.domain.com:8080/app2/
ProxyPassReverse  /foo/bar/app1/  http://my.domain.com:8080/app1/
ProxyPassReverse  /foo/bar/app2/  http://my.domain.com:8080/app2/

The proxy mechanism itself seems to work fine, but the problem is how do we
deal with the path in the session cookies that Tomcat generates?  Tomcat is
creating session cookies that contain a path for the app, like  /app1  or
/app2.  But because of the reverse proxy, what the browser actually sees as
a url is  /foo/bar/app1 or  /foo/bar/app2, and so would not send the cookie
back when it should.

What is the proper way to handle generation of session cookies when you are
using a reverse proxy which changes the url that the browser sees?

Thanks


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Installing MySQL-J connector on Linux

Posted by anton rahmadi <a_...@telkom.net>.
I'm a newbie in java, now i'm working on Linux (Mandrake)

the 1st step has been successfully done : installing java 2 sdk
the 2nd step has been successfully done too : installing apache tomcat 4.x
(all step above has been tested by java applet, javac, and jsp)

now i'm still confused to install mysql-j connector and also script to
connect database (is that still the same with an old m3sql ?), what i've
done is

creating /java/mysql-j and untar all mysql-j-3.0.6-stable files in to that
directory.
Following the instruction :
export CLASSPATH=/java/mysql-j/com:$CLASSPATH


what shoud i do next ?  how could i know that mysql-j has been installed
succesfully.

ps :
/java/j2sdk --> j2sdk folder
/java/tomcat --> apache tomcat folder
http port : 8000




---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Re: Session cookie path with reverse proxy

Posted by Tim Funk <fu...@joedog.org>.
Save yourself heartache and keep the file paths the same. Otherwise you will 
need to dynamically rewrite cookie headers. (Which doesn't sound like fun)

-Tim

Mike Depot wrote:
> We are using Apache with mod_proxy as a reverse proxy in front of our
> Tomcat.  In Tomcat we have two apps, which are (locally) accessible like
> this: http://my.domain.com:8080/app1  and  http://my.domain.com:8080/app2
> 
> We have other stuff on our main web, and would like to keep these apps on a
> virtual path on our web root, so we've configured the reverse proxy to
> include the extra path info.  We've configured Apache something like this:
> 
> ProxyPass  /foo/bar/app1/  http://my.domain.com:8080/app1/
> ProxyPass  /foo/bar/app2/  http://my.domain.com:8080/app2/
> ProxyPassReverse  /foo/bar/app1/  http://my.domain.com:8080/app1/
> ProxyPassReverse  /foo/bar/app2/  http://my.domain.com:8080/app2/
> 
> The proxy mechanism itself seems to work fine, but the problem is how do we
> deal with the path in the session cookies that Tomcat generates?  Tomcat is
> creating session cookies that contain a path for the app, like  /app1  or
> /app2.  But because of the reverse proxy, what the browser actually sees as
> a url is  /foo/bar/app1 or  /foo/bar/app2, and so would not send the cookie
> back when it should.
> 
> What is the proper way to handle generation of session cookies when you are
> using a reverse proxy which changes the url that the browser sees?
> 
> Thanks
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org