tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Simon Lau" <si...@tradeeasy.com>
Subject Re: apache + tomcat with 2 domains but same session?
Date Wed, 12 Jan 2005 02:51:43 GMT

Tim, thanks for your help. but...
I have been following your suggestion and use mod_rewrite to rewrite
bbb.abc.com to aaa.abc.com.
Here is 3 scenarios:
1)
   RewriteCond %{HTTP_HOST}          ^bbb\.(.*)$
   RewriteRule ^(.+)                 http://aaa.%1$1
Client access http://bbb.abc.com/myapp/index.jsp
Client brower address bar display http://aaa.abc.com/myapp/index.jsp (but i
want http://bbb.abc.com/myapp/index.jsp instead)
Session persist, no problem

2)
   RewriteCond %{HTTP_HOST}          ^bbb\.(.*)$
   RewriteRule ^(.+)                 http://aaa.%1$1                    [PT]
Client access http://bbb.abc.com/myapp/index.jsp
Client brower address bar display http://bbb.abc.com/myapp/index.jsp
Client brower display "400 Bad Request error"
mod_rewrite.log get "forcing 'http://aaa.abc.com/myapp/index.jsp' to get
passed through to next API URI-to-filename handler

3)
   RewriteCond %{HTTP_HOST}          ^bbb\.(.*)$
   RewriteRule ^(.+)                 http://aaa.%1$1                    [P]
Client access http://bbb.abc.com/myapp/index.jsp
Client brower address bar display http://bbb.abc.com/myapp/index.jsp
Client brower display "Forbidden, You don't have permission to access
/myapp/index.jsp"
mod_rewrite.log get "forcing proxy-throughput with
http://aaa.abc.com/myapp/index.jsp"

so all of these cases didn't give me the result i wanted.
the result i wanted is:
-Client access http://bbb.abc.com/myapp/index.jsp
-Client brower address bar display http://bbb.abc.com/myapp/index.jsp
-Session persist with http://aaa.abc.com/myapp/index.jsp

Am i on the right track? or am i doing it totally wrong? or is there way to
get around this?

please help. thanks again.

Simon


----- Original Message ----- 
From: "Tim Funk" <funkman@joedog.org>
To: "Tomcat Users List" <tomcat-user@jakarta.apache.org>
Sent: Tuesday, January 11, 2005 7:44 PM
Subject: Re: apache + tomcat with 2 domains but same session?


> You can get away with this by using URL rewriting. When you are using
> aaa.abc.com and wish to redirect or link to bbb.abc.com - you would need
to
> rewrite the URL to include the jsessionid path parameter. But you *cannot*
do
> this via response.encodeURL(..) since that method will detect your URL is
in
> another webapp. So you will need to write your own implementation of
> encodeURL to achieve this.
>
> -Tim
>
> Simon Lau wrote:
> > Hi,
> >
> > I want to setup my apache to have 2 domains, say aaa.abc.com and
> > bbb.abc.com.
> > Both of this domain goes to the same application context, say /myapp
> > So when i access both
> > http://aaa.abc.com/myapp/index.jsp
> > http://bbb.abc.com/myapp/index.jsp
> > will give me the exact same content, no problem.
> >
> > My question is how do i persist the session while i switch between
> > aaa.abc.com and bbb.abc.com?
> > For example i have a shopping basket storing with 2 products and i want
to
> > access the basket in both aaa.abc.com and bbb.abc.com
> > Btw, i am using apache2.0.52 + tomcat5.0.28
> >
>
> ---------------------------------------------------------------------
> 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


Mime
View raw message