You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Nino Saturnino Martinez Vazquez Wael <ni...@jayway.dk> on 2008/05/27 11:25:29 UTC
[users@httpd] ProxyPass/ProxyPassreverse shared cookies?
Hi
I have two applications running in a tomcat instance, I use apaches mod
proxy to forward to them accordingly. However I have trouble getting a
share cookie to be visible in each application. Since cookies need to be
on the same path and domain. Currently no cookies are going out to the
browser from apache2 http.
I've been following this example:
http://httpd.apache.org/docs/2.2/mod/mod_proxy.html#proxypassreverse
| ProxyPass /mirror/foo/ http://backend.example.com/
ProxyPassReverse /mirror/foo/ http://backend.example.com/
ProxyPassReverseCookieDomain backend.example.com public.example.com
ProxyPassReverseCookiePath / /mirror/foo/|
I've defined two virtual hosts like this, trying to follow the above
example but cant figure it:
NameVirtualHost
*
<VirtualHost *:*
>
ServerName
beta.domain.dk
ServerAlias
*.beta.domain.dk
ServerAlias
*.beta.domain.cx
ServerAlias
beta.domain.ath.cx
ServerAdmin
admin@domain.dk
ProxyPass /images
http://10.0.0.2:8180/appA/images
ProxyPass /
http://10.0.0.2:8180/appA/
ProxyPassReverse /
http://10.0.0.2:8180/appA/
ProxyPassReverseCookiePath /appA /
| ProxyPassReverseCookieDomain appA beta.domain.dk|
<Proxy
*>
Order
deny,allow
Allow from
all
</Proxy>
</VirtualHost>
<VirtualHost *:*
>
ServerName
forum.domain.dk
ServerAlias
*.forum.domain.dk
ServerAlias
*.forum.domain.ath.cx
ServerAlias
forum.domain.ath.cx
ServerAdmin
email@domain.dk
ProxyPass /jforum-2.1.8/templates/default/images/
http://10.0.0.2:8180/jforum-2.1.8/templates/default/images/
ProxyPass /jforum-2.1.8/templates/default/styles/
http://10.0.0.2:8180/jforum-2.1.8/templates/default/styles/
ProxyPass /jforum-2.1.8/
http://10.0.0.2:8180/jforum-2.1.8/
ProxyPass /
http://10.0.0.2:8180/AppB/
ProxyPassReverse /
http://10.0.0.2:8180/AppB/
ProxyPassReverseCookiePath /AppB /
| ProxyPassReverseCookieDomain appB beta.domain.dk|
<Proxy
*>
Order
deny,allow
Allow from
all
</Proxy>
</VirtualHost>
--
-Wicket for love
Nino Martinez Wael
Java Specialist @ Jayway DK
http://www.jayway.dk
+45 2936 7684
---------------------------------------------------------------------
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@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: [users@httpd] ProxyPass/ProxyPassreverse shared cookies?
Posted by Nino Saturnino Martinez Vazquez Wael <ni...@jayway.dk>.
Okay since im not drowning in solutions for using mod proxy. I'll try to
use mod jk. But before I do so I have the following question:
How do I setup Apache HTTP to only forward to certain parts of tomcat,
depending on incomming network. Currently I have 2 application, which
needs to share a cookie these two show be available from out side using
the following mapping:
{pseudo syntax}
mydomain.dk /tomcat/appA
forum.mydomain.dk /tomcat/appB
But for some of the administrative tasks I have some admin
applications(tomcat defaults), these I do not want to be available from
the mydomain.dk but only via the internal ip address.
how do I do this?
Thanks in advance..
Nino Saturnino Martinez Vazquez Wael wrote:
>
>
> Davide Bianchi wrote:
>> Nino Saturnino Martinez Vazquez Wael wrote:
>>> Hmm, well because I'd like the configuration to be simple (which it
>>> arent really now). And wanted it to be at apache HTTP configured not
>>> a mix of HTTP and tomcat.. So no real arguments, I guess I could
>>> change it. However the only thing bothering me now are cookies. So
>>> if the only way are mod_jk i'll have to take that i guess?
>>
>> I'm not completely sure if the cookie problem is generated by the
>> proxy module or not, the proxy directives should simply 'route' the
>> connection to tomcat and back, I was just wondering the reason to
>> stick to a proxy configuration where a mod_jk one would have been
>> much simpler.
> It started out a bit simpler sticking to proxy... Where as mod_jk had
> changes two places both in tomcat and http.
>>
>> But if you connect directly with Tomcat (by using the :8080 port in
>> the URL) and have no trouble with the cookies bit, I suppose the
>> problem does lies in the proxy module.
> If I connect directly to tomcat, I do get my cookies. It's the same
> with jetty, which Im using for development. So it seems that it's
> probably my configuration of the proxy module thats lacking something.
> I just wonder what im doing wrong.
>>
>> Davide
>>
>
--
-Wicket for love
Nino Martinez Wael
Java Specialist @ Jayway DK
http://www.jayway.dk
+45 2936 7684
---------------------------------------------------------------------
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@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: [users@httpd] ProxyPass/ProxyPassreverse shared cookies?
Posted by Nino Saturnino Martinez Vazquez Wael <ni...@jayway.dk>.
Davide Bianchi wrote:
> Nino Saturnino Martinez Vazquez Wael wrote:
>> Hmm, well because I'd like the configuration to be simple (which it
>> arent really now). And wanted it to be at apache HTTP configured not
>> a mix of HTTP and tomcat.. So no real arguments, I guess I could
>> change it. However the only thing bothering me now are cookies. So if
>> the only way are mod_jk i'll have to take that i guess?
>
> I'm not completely sure if the cookie problem is generated by the
> proxy module or not, the proxy directives should simply 'route' the
> connection to tomcat and back, I was just wondering the reason to
> stick to a proxy configuration where a mod_jk one would have been much
> simpler.
It started out a bit simpler sticking to proxy... Where as mod_jk had
changes two places both in tomcat and http.
>
> But if you connect directly with Tomcat (by using the :8080 port in
> the URL) and have no trouble with the cookies bit, I suppose the
> problem does lies in the proxy module.
If I connect directly to tomcat, I do get my cookies. It's the same with
jetty, which Im using for development. So it seems that it's probably my
configuration of the proxy module thats lacking something. I just wonder
what im doing wrong.
>
> Davide
>
--
-Wicket for love
Nino Martinez Wael
Java Specialist @ Jayway DK
http://www.jayway.dk
+45 2936 7684
---------------------------------------------------------------------
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@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: [users@httpd] ProxyPass/ProxyPassreverse shared cookies?
Posted by Davide Bianchi <da...@onlyforfun.net>.
Nino Saturnino Martinez Vazquez Wael wrote:
> Hmm, well because I'd like the configuration to be simple (which it
> arent really now). And wanted it to be at apache HTTP configured not a
> mix of HTTP and tomcat.. So no real arguments, I guess I could change
> it. However the only thing bothering me now are cookies. So if the only
> way are mod_jk i'll have to take that i guess?
I'm not completely sure if the cookie problem is generated by the proxy
module or not, the proxy directives should simply 'route' the connection
to tomcat and back, I was just wondering the reason to stick to a proxy
configuration where a mod_jk one would have been much simpler.
But if you connect directly with Tomcat (by using the :8080 port in the
URL) and have no trouble with the cookies bit, I suppose the problem
does lies in the proxy module.
Davide
--
Had to give report over censorship today. So I put in a pr0n vid and
they made me turn it off. Did u get an A? I hope so, cause they kept the
video.
---------------------------------------------------------------------
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@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: [users@httpd] ProxyPass/ProxyPassreverse shared cookies?
Posted by Nino Saturnino Martinez Vazquez Wael <ni...@jayway.dk>.
Hmm, well because I'd like the configuration to be simple (which it
arent really now). And wanted it to be at apache HTTP configured not a
mix of HTTP and tomcat.. So no real arguments, I guess I could change
it. However the only thing bothering me now are cookies. So if the only
way are mod_jk i'll have to take that i guess?
Davide Bianchi wrote:
> Nino Saturnino Martinez Vazquez Wael wrote:
>> Hi
>>
>> I have two applications running in a tomcat instance, I use apaches
>> mod proxy to forward to them accordingly.
>
> mod_jk was developed to get rid of all these problems, why don't you
> use it?
>
> Davide
>
--
-Wicket for love
Nino Martinez Wael
Java Specialist @ Jayway DK
http://www.jayway.dk
+45 2936 7684
---------------------------------------------------------------------
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@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: [users@httpd] ProxyPass/ProxyPassreverse shared cookies?
Posted by Davide Bianchi <da...@onlyforfun.net>.
Nino Saturnino Martinez Vazquez Wael wrote:
> Hi
>
> I have two applications running in a tomcat instance, I use apaches mod
> proxy to forward to them accordingly.
mod_jk was developed to get rid of all these problems, why don't you use it?
Davide
--
I'm not a programmer, but I play one at Microsoft.
-- From a Slashdot.org post
---------------------------------------------------------------------
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@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: [users@httpd] ProxyPass/ProxyPassreverse shared cookies?
Posted by Nino Saturnino Martinez Vazquez Wael <ni...@jayway.dk>.
Replying inline... And thanks for your mail.
Krist van Besien wrote:
> On Tue, May 27, 2008 at 11:25 AM, Nino Saturnino Martinez Vazquez Wael
> <ni...@jayway.dk> wrote:
>
>> Hi
>>
>> I have two applications running in a tomcat instance, I use apaches mod
>> proxy to forward to them accordingly. However I have trouble getting a share
>> cookie to be visible in each application. Since cookies need to be on the
>> same path and domain. Currently no cookies are going out to the browser from
>> apache2 http.
>>
>
> Are you sure no cookies are going out? Have you looked at your http
> traffic using something like LiveHTTPHeaders or firebug?
>
>
I did check with web developer, and firecookie. However as it turns out
after doing a little deeper check it became apparent that it's probably
the domain name that's messing with stuff. So the cookies are set just
not for the current domain, but suffixed with forum and beta(like you
write). Problem is that my domain contains an æ it's something like this
: domæne.dk however there are trouble with this so forexample firefox
recognises it as domæne.dk but IE6 does xn--domne-e6a.dk. I've setup
Apache to use the xn-domne-e6a.dk, can I have two domains, so that I
also use the one with æ, it's just a matter of adding the other name as
an server alias right, I guess Apache http supports æ ø å etc?
> Normally apache just forwards cookies produced by your app to the
> client. you can ask apache to change the cookiedomain and the path,
>
I've tried todo this:
(beta)
ProxyPassReverseCookiePath /
/tomcatcontex/
ProxyPassReverseCookieDomain /tomcatcontex beta.domæne.dk
(forum)
ProxyPassReverseCookiePath /jforum-2.1.8
/
ProxyPassReverseCookieDomain /jforum-2.1.8 beta.domæne.dk
But obviously it does not work, both cookie domains are set to:
beta.xn--trningslog-e6a.dk (the tomcat cookie)
forum.xn--trningslog-e6a.dk (the forum cookie)
It looks like the domain path are being used, is only /.
> You have configured two virtual hosts, beta.domain.dk and
> forum.domain.dk, and want to share cookies between them, is that
> correct?
>
Yes excactly.
> In this case you must make sure that cookiedomain is domain.dk.
> If you set cookidomain to beta.domain.dk the cookie will only be sent
> by the browser on requests to beta.domain.dk, and not on requests to
> forum.domain.dk.
>
I am aware of this, but thanks for reminding.
>
> Krist
>
>
--
-Wicket for love
Nino Martinez Wael
Java Specialist @ Jayway DK
http://www.jayway.dk
+45 2936 7684
---------------------------------------------------------------------
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@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: [users@httpd] ProxyPass/ProxyPassreverse shared cookies?
Posted by Nino Saturnino Martinez Vazquez Wael <ni...@jayway.dk>.
After some wondering, I decided to see if changing domain name would
help, I mean going away from having the danish character æ in the
domain, and it did. And I actually did not have to use cookie rewrite or
domain.
So this works too using mod proxy..
Nino Saturnino Martinez Vazquez Wael wrote:
> Replying inline... And thanks for your mail.
>
> Krist van Besien wrote:
>> On Tue, May 27, 2008 at 11:25 AM, Nino Saturnino Martinez Vazquez Wael
>> <ni...@jayway.dk> wrote:
>>
>>> Hi
>>>
>>> I have two applications running in a tomcat instance, I use apaches mod
>>> proxy to forward to them accordingly. However I have trouble getting
>>> a share
>>> cookie to be visible in each application. Since cookies need to be
>>> on the
>>> same path and domain. Currently no cookies are going out to the
>>> browser from
>>> apache2 http.
>>>
>>
>> Are you sure no cookies are going out? Have you looked at your http
>> traffic using something like LiveHTTPHeaders or firebug?
>>
>>
> I did check with web developer, and firecookie. However as it turns
> out after doing a little deeper check it became apparent that it's
> probably the domain name that's messing with stuff. So the cookies are
> set just not for the current domain, but suffixed with forum and
> beta(like you write). Problem is that my domain contains an æ it's
> something like this : domæne.dk however there are trouble with this so
> forexample firefox recognises it as domæne.dk but IE6 does
> xn--domne-e6a.dk. I've setup Apache to use the xn-domne-e6a.dk, can I
> have two domains, so that I also use the one with æ, it's just a
> matter of adding the other name as an server alias right, I guess
> Apache http supports æ ø å etc?
>> Normally apache just forwards cookies produced by your app to the
>> client. you can ask apache to change the cookiedomain and the path,
>>
> I've tried todo this:
>
> (beta)
> ProxyPassReverseCookiePath /
> /tomcatcontex/
>
> ProxyPassReverseCookieDomain /tomcatcontex beta.domæne.dk
> (forum)
> ProxyPassReverseCookiePath /jforum-2.1.8
> /
> ProxyPassReverseCookieDomain /jforum-2.1.8 beta.domæne.dk
> But obviously it does not work, both cookie domains are set to:
> beta.xn--trningslog-e6a.dk (the tomcat cookie)
> forum.xn--trningslog-e6a.dk (the forum cookie)
>
> It looks like the domain path are being used, is only /.
>> You have configured two virtual hosts, beta.domain.dk and
>> forum.domain.dk, and want to share cookies between them, is that
>> correct?
>>
> Yes exactly.
>> In this case you must make sure that cookiedomain is domain.dk.
>> If you set cookidomain to beta.domain.dk the cookie will only be sent
>> by the browser on requests to beta.domain.dk, and not on requests to
>> forum.domain.dk.
>>
> I am aware of this, but thanks for reminding.
>>
>> Krist
>>
>>
>
--
-Wicket for love
Nino Martinez Wael
Java Specialist @ Jayway DK
http://www.jayway.dk
+45 2936 7684
---------------------------------------------------------------------
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@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: [users@httpd] ProxyPass/ProxyPassreverse shared cookies?
Posted by Nino Saturnino Martinez Vazquez Wael <ni...@jayway.dk>.
Replying inline... And thanks for your mail.
Krist van Besien wrote:
> On Tue, May 27, 2008 at 11:25 AM, Nino Saturnino Martinez Vazquez Wael
> <ni...@jayway.dk> wrote:
>
>> Hi
>>
>> I have two applications running in a tomcat instance, I use apaches mod
>> proxy to forward to them accordingly. However I have trouble getting a share
>> cookie to be visible in each application. Since cookies need to be on the
>> same path and domain. Currently no cookies are going out to the browser from
>> apache2 http.
>>
>
> Are you sure no cookies are going out? Have you looked at your http
> traffic using something like LiveHTTPHeaders or firebug?
>
>
I did check with web developer, and firecookie. However as it turns out
after doing a little deeper check it became apparent that it's probably
the domain name that's messing with stuff. So the cookies are set just
not for the current domain, but suffixed with forum and beta(like you
write). Problem is that my domain contains an æ it's something like this
: domæne.dk however there are trouble with this so forexample firefox
recognises it as domæne.dk but IE6 does xn--domne-e6a.dk. I've setup
Apache to use the xn-domne-e6a.dk, can I have two domains, so that I
also use the one with æ, it's just a matter of adding the other name as
an server alias right, I guess Apache http supports æ ø å etc?
> Normally apache just forwards cookies produced by your app to the
> client. you can ask apache to change the cookiedomain and the path,
>
I've tried todo this:
(beta)
ProxyPassReverseCookiePath /
/tomcatcontex/
ProxyPassReverseCookieDomain /tomcatcontex beta.domæne.dk
(forum)
ProxyPassReverseCookiePath /jforum-2.1.8
/
ProxyPassReverseCookieDomain /jforum-2.1.8 beta.domæne.dk
But obviously it does not work, both cookie domains are set to:
beta.xn--trningslog-e6a.dk (the tomcat cookie)
forum.xn--trningslog-e6a.dk (the forum cookie)
It looks like the domain path are being used, is only /.
> You have configured two virtual hosts, beta.domain.dk and
> forum.domain.dk, and want to share cookies between them, is that
> correct?
>
Yes exactly.
> In this case you must make sure that cookiedomain is domain.dk.
> If you set cookidomain to beta.domain.dk the cookie will only be sent
> by the browser on requests to beta.domain.dk, and not on requests to
> forum.domain.dk.
>
I am aware of this, but thanks for reminding.
>
> Krist
>
>
--
-Wicket for love
Nino Martinez Wael
Java Specialist @ Jayway DK
http://www.jayway.dk
+45 2936 7684
---------------------------------------------------------------------
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@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: [users@httpd] ProxyPass/ProxyPassreverse shared cookies?
Posted by Krist van Besien <kr...@gmail.com>.
On Tue, May 27, 2008 at 11:25 AM, Nino Saturnino Martinez Vazquez Wael
<ni...@jayway.dk> wrote:
> Hi
>
> I have two applications running in a tomcat instance, I use apaches mod
> proxy to forward to them accordingly. However I have trouble getting a share
> cookie to be visible in each application. Since cookies need to be on the
> same path and domain. Currently no cookies are going out to the browser from
> apache2 http.
Are you sure no cookies are going out? Have you looked at your http
traffic using something like LiveHTTPHeaders or firebug?
Normally apache just forwards cookies produced by your app to the
client. you can ask apache to change the cookiedomain and the path,
You have configured two virtual hosts, beta.domain.dk and
forum.domain.dk, and want to share cookies between them, is that
correct?
In this case you must make sure that cookiedomain is domain.dk.
If you set cookidomain to beta.domain.dk the cookie will only be sent
by the browser on requests to beta.domain.dk, and not on requests to
forum.domain.dk.
Krist
--
krist.vanbesien@gmail.com
krist@vanbesien.org
Bremgarten b. Bern, Switzerland
--
A: It reverses the normal flow of conversation.
Q: What's wrong with top-posting?
A: Top-posting.
Q: What's the biggest scourge on plain text email discussions?
---------------------------------------------------------------------
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@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org