You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Gaston Escobar <ge...@451.com> on 2003/03/06 14:57:53 UTC

proxy and sessions problem


(tomcat 4.1.18 + apache 1.3 + mod_jk + Linux + Proxy via Apache ProxyPass)
I have the following scenario.:
A main server that runs Apache with mod_proxy:

ProxyPass /tomcat http://mytomcatserver
ProxyPassReverse /tomcat http://mytomcatserver

When someone request an URL containing "/tomcat" then apache redirects the
call to Tomcat server.

The problem is that with above approach, I lost session id?s
I also added "proxyName=mainserver" and "Proxyport=80" to the HTTP connector
under server.xml, but no luck.

Can someone help me to fix this?

Thanks a lot


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


Re: proxy and sessions problem

Posted by p niemandt <ma...@acesurfer.co.za>.
Yip: 

As far as I understand it: using proxy pass, even though your request
will be forwarded to tomcat, it is still seen as 2 separate
applications: You will then have an Apache session and a Tomcat session,
and never the twain shall meet ...

You need to configure your web application so that is seen as only one
application, and the easiest to do this is to use something like mod_jk.


On Thu, 2003-03-06 at 14:43, Gaston Escobar wrote:
> Sorry, I've made a mistake, I'm not using mod_jk, I'm just using mod_proxy.
> So, the only possibilty I have is to change from proxy pass to mod_jk?
> 
> 
> 
> 
> 
> -----Mensaje original-----
> De: p niemandt [mailto:maudib@acesurfer.co.za]
> Enviado el: Jueves, 06 de Marzo de 2003 11:36 a.m.
> Para: Tomcat Users List
> Asunto: Re: proxy and sessions problem
> 
> 
> Don't use both proxy pass and mod_jk: use either one or the other.
> 
> To keep your sessions, you will need to use mod_jk.
> 
> Sadly this is about the extend of my advice: other people on the list
> might have better advice. I know I had to change from proxy pass to
> mod_jk to keep my session
> 
> On Thu, 2003-03-06 at 13:57, Gaston Escobar wrote:
> > (tomcat 4.1.18 + apache 1.3 + mod_jk + Linux + Proxy via Apache ProxyPass)
> > I have the following scenario.:
> > A main server that runs Apache with mod_proxy:
> >
> > ProxyPass /tomcat http://mytomcatserver
> > ProxyPassReverse /tomcat http://mytomcatserver
> >
> > When someone request an URL containing "/tomcat" then apache redirects the
> > call to Tomcat server.
> >
> > The problem is that with above approach, I lost session id?s
> > I also added "proxyName=mainserver" and "Proxyport=80" to the HTTP
> connector
> > under server.xml, but no luck.
> >
> > Can someone help me to fix this?
> >
> > Thanks a lot
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
> --
> p niemandt <ma...@acesurfer.co.za>
> 
> 
> ---------------------------------------------------------------------
> 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
-- 
p niemandt <ma...@acesurfer.co.za>


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


Re: proxy and sessions problem

Posted by Fabio Mengue <fa...@ccuec.unicamp.br>.
I have the same configuration and mine works well (ie, the JSESSIONID 
get/set works fine). I have something like

<VirtualHost _default_:443>

#  General setup for the virtual host
DocumentRoot "/www/apache/htdocs"
ServerName www.myserver.unicamp.br
ServerAdmin root@myserver.unicamp.br
ErrorLog /www/apache/logs/error_log
TransferLog /www/apache/logs/access_log


ProxyRequests Off

ProxyPass / http://tomcat01.sist.unicamp.br:8080/
ProxyPassReverse / http://tomcat01.sist.unicamp.br:8080/
...
</VirtualHost>

And my Apache server is one firewall away from the Tomcat servers.

Fabio.


Gaston Escobar wrote:

>Sorry, I've made a mistake, I'm not using mod_jk, I'm just using mod_proxy.
>So, the only possibilty I have is to change from proxy pass to mod_jk?
>
>
>
>
>
>-----Mensaje original-----
>De: p niemandt [mailto:maudib@acesurfer.co.za]
>Enviado el: Jueves, 06 de Marzo de 2003 11:36 a.m.
>Para: Tomcat Users List
>Asunto: Re: proxy and sessions problem
>
>
>Don't use both proxy pass and mod_jk: use either one or the other.
>
>To keep your sessions, you will need to use mod_jk.
>
>Sadly this is about the extend of my advice: other people on the list
>might have better advice. I know I had to change from proxy pass to
>mod_jk to keep my session
>
>On Thu, 2003-03-06 at 13:57, Gaston Escobar wrote:
>  
>
>>(tomcat 4.1.18 + apache 1.3 + mod_jk + Linux + Proxy via Apache ProxyPass)
>>I have the following scenario.:
>>A main server that runs Apache with mod_proxy:
>>
>>ProxyPass /tomcat http://mytomcatserver
>>ProxyPassReverse /tomcat http://mytomcatserver
>>
>>When someone request an URL containing "/tomcat" then apache redirects the
>>call to Tomcat server.
>>
>>The problem is that with above approach, I lost session id?s
>>I also added "proxyName=mainserver" and "Proxyport=80" to the HTTP
>>    
>>
>connector
>  
>
>>under server.xml, but no luck.
>>
>>Can someone help me to fix this?
>>
>>Thanks a lot
>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
>>For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>>    
>>
>--
>p niemandt <ma...@acesurfer.co.za>
>
>
>---------------------------------------------------------------------
>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
>
>
>  
>

-- 
Fabio Mengue - Centro de Computacao - Unicamp
fabio@ccuec.unicamp.br       fabio@unicamp.br
----------------------------------------------------------------
[The First Rule of Program Optimization] Don't do it.



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


proxy and sessions problem

Posted by Gaston Escobar <ge...@451.com>.
Sorry, I've made a mistake, I'm not using mod_jk, I'm just using mod_proxy.
So, the only possibilty I have is to change from proxy pass to mod_jk?





-----Mensaje original-----
De: p niemandt [mailto:maudib@acesurfer.co.za]
Enviado el: Jueves, 06 de Marzo de 2003 11:36 a.m.
Para: Tomcat Users List
Asunto: Re: proxy and sessions problem


Don't use both proxy pass and mod_jk: use either one or the other.

To keep your sessions, you will need to use mod_jk.

Sadly this is about the extend of my advice: other people on the list
might have better advice. I know I had to change from proxy pass to
mod_jk to keep my session

On Thu, 2003-03-06 at 13:57, Gaston Escobar wrote:
> (tomcat 4.1.18 + apache 1.3 + mod_jk + Linux + Proxy via Apache ProxyPass)
> I have the following scenario.:
> A main server that runs Apache with mod_proxy:
>
> ProxyPass /tomcat http://mytomcatserver
> ProxyPassReverse /tomcat http://mytomcatserver
>
> When someone request an URL containing "/tomcat" then apache redirects the
> call to Tomcat server.
>
> The problem is that with above approach, I lost session id?s
> I also added "proxyName=mainserver" and "Proxyport=80" to the HTTP
connector
> under server.xml, but no luck.
>
> Can someone help me to fix this?
>
> Thanks a lot
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
--
p niemandt <ma...@acesurfer.co.za>


---------------------------------------------------------------------
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


Re: proxy and sessions problem

Posted by p niemandt <ma...@acesurfer.co.za>.
Don't use both proxy pass and mod_jk: use either one or the other.

To keep your sessions, you will need to use mod_jk.

Sadly this is about the extend of my advice: other people on the list
might have better advice. I know I had to change from proxy pass to
mod_jk to keep my session

On Thu, 2003-03-06 at 13:57, Gaston Escobar wrote:
> (tomcat 4.1.18 + apache 1.3 + mod_jk + Linux + Proxy via Apache ProxyPass)
> I have the following scenario.:
> A main server that runs Apache with mod_proxy:
> 
> ProxyPass /tomcat http://mytomcatserver
> ProxyPassReverse /tomcat http://mytomcatserver
> 
> When someone request an URL containing "/tomcat" then apache redirects the
> call to Tomcat server.
> 
> The problem is that with above approach, I lost session id?s
> I also added "proxyName=mainserver" and "Proxyport=80" to the HTTP connector
> under server.xml, but no luck.
> 
> Can someone help me to fix this?
> 
> Thanks a lot
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
-- 
p niemandt <ma...@acesurfer.co.za>


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