You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Roger Hendrix at Baldor-IS <RH...@baldor.com> on 2006/10/31 18:23:49 UTC

[users@httpd] Apache2 Proxy to Tomcat backend

Greetings:

I am trying to configure an Apache front-end Proxy Service to talk to a backend Tomcat Server.

The Apache Server is:	 apache2-2.0.49-27.59
The Tomcat Server is: jakaarta-tomcat-5.0.19-29.1

The Apache Server is configured using ProxyPass and ProxyPreserveHost statements.

Users can connect to the java application.

My problem is that the java application requires COOKIES to be maintained at the user client level and these COOKIES are not being passed back to the user clients.

If I connect directly to the tomcat server locally, all works correctly.

I am sure it is something simple in the Apache Server Configuration.

Please advise.

Best regards.

Roger Hendrix
Information Services
Baldor Electric Co.
5711 R. S. Boreham, Jr. St.  72908

Phone:   479-648-5823

Internal Web.:  http://my.baldor.com
External Web:  http://www.baldor.com


---------------------------------------------------------------------
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] Apache2 Proxy to Tomcat backend

Posted by Nick Kew <ni...@webthing.com>.
On Tue, 31 Oct 2006 11:23:49 -0600
"Roger Hendrix at Baldor-IS" <RH...@baldor.com> wrote:

> Greetings:
> 
> I am trying to configure an Apache front-end Proxy Service to talk to
> a backend Tomcat Server.
> 
> The Apache Server is:	 apache2-2.0.49-27.59
> The Tomcat Server is: jakaarta-tomcat-5.0.19-29.1
> 
> The Apache Server is configured using ProxyPass and ProxyPreserveHost
> statements.
> 
> Users can connect to the java application.

Upgrade to Apache 2.2, and use whatever is necessary of its
new proxy cookie manipulation capabilities.

That also gives you the benefit of mod_proxy_ajp, for more
efficient connection to Tomcat.

-- 
Nick Kew

Application Development with Apache - the Apache Modules Book
http://www.apachetutor.org/

---------------------------------------------------------------------
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] Apache2 Proxy to Tomcat backend

Posted by Serge Dubrouski <se...@gmail.com>.
Have you tried to use AJP connector instead of proxying?

On 10/31/06, Roger Hendrix at Baldor-IS <RH...@baldor.com> wrote:
> Greetings:
>
> I am trying to configure an Apache front-end Proxy Service to talk to a backend Tomcat Server.
>
> The Apache Server is:    apache2-2.0.49-27.59
> The Tomcat Server is: jakaarta-tomcat-5.0.19-29.1
>
> The Apache Server is configured using ProxyPass and ProxyPreserveHost statements.
>
> Users can connect to the java application.
>
> My problem is that the java application requires COOKIES to be maintained at the user client level and these COOKIES are not being passed back to the user clients.
>
> If I connect directly to the tomcat server locally, all works correctly.
>
> I am sure it is something simple in the Apache Server Configuration.
>
> Please advise.
>
> Best regards.
>
> Roger Hendrix
> Information Services
> Baldor Electric Co.
> 5711 R. S. Boreham, Jr. St.  72908
>
> Phone:   479-648-5823
>
> Internal Web.:  http://my.baldor.com
> External Web:  http://www.baldor.com
>
>
> ---------------------------------------------------------------------
> 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
>
>

---------------------------------------------------------------------
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] Apache2 Proxy to Tomcat backend

Posted by Jeff McAdams <je...@iglou.com>.
Roger Hendrix at Baldor-IS wrote:
> I am trying to configure an Apache front-end Proxy Service to talk to
> a backend Tomcat Server.

> The Apache Server is:	 apache2-2.0.49-27.59
> The Tomcat Server is:  jakarta-tomcat-5.0.19-29.1

> The Apache Server is configured using ProxyPass and ProxyPreserveHost
> statements.

> Users can connect to the java application.

> My problem is that the java application requires COOKIES to be
> maintained at the user client level and these COOKIES are not being
> passed back to the user clients.

> If I connect directly to the tomcat server locally, all works
> correctly.

> I am sure it is something simple in the Apache Server Configuration.

We're doing basically this (and I respond because we're a SuSE shop and
those version numbers looked suspiciously like SuSE version
numbers...confirmed downthread, I see), but we're using JKMount with
mod_jk connectors rather than just proxying.  Well, I did have a proxy
setup as well, but it wasn't as clean of a setup...the mod_jk is better.

I see someone already suggested going to 2.2.x and using the
mod_proxy_ajp (which is the 2.2.x equivalent of mod_jk, but really much
better), but that you're having some trouble compiling 2.2.x.  You
really don't need to do that, nice though the 2.2.x stuff is.  I have a
setup using that as well...it really is nice, but I snagged packages
from ftp.suse.com for my SLES9 boxes, but I didn't turn up any s390
packages for 9.3 there, alas.

So, look into the mod_jk stuff using JKMount, it should do what you need
without the need of proxy'ing, and all the cookies will get set correctly.

Be aware that the mod_jk stuff doesn't rewrite cookie paths either, so
the URL path that the user sees will need to match the context path in
Apache, or else you'll have to change the way you're setting your
cookies in your Java code...probably just easier to make them match.
FWIW, we do a redirect on an empty path to redirect the user into the
context of the tomcat app so that the user sees the same URL path as the
tomcat app's context is set up to use.

I'm looking forward to SLES10, with pre-packaged apache 2.2.x and
switching over to the mod_proxy_ajp stuff, as it really is cleaner and
nicer all around and also has the ability to rewrite cookie paths to
match the rest of the proxy rewriting stuff.
-- 
Jeff McAdams
"They that can give up essential liberty to obtain a
little temporary safety deserve neither liberty nor safety."
                                       -- Benjamin Franklin