Re: Httpd vhosts and ProxyPass/ProxyPassReverse and AJP - am I on crack?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




You might need to change the names that the tomcat servers think of them selves as being.

ie. call one server http://a.FOO.com and the other http://b.FOO.com

Proxy pass reverse matches the first-hit right argument, against headers with hostname eg. redirect etc., so they must be unique, iff you want to map said redirects to unique places (ie. to the left argument such as /a /b etc.,). Then :

ProxyPassReverse /a/ http://a.FOO.com/
ProxyPassReverse /b/ http://b.FOO.com/

Although it sounds complicated. Why not just have one virtualhost per tomcat server, then less trouble ?

Cheers
Brett

On Tue, Nov 27, 2012 at 9:55 AM, Dave Shevett <shevett@xxxxxxxxx> wrote:
This is the exact place I started, and here's what happens:

$ curl --dump - http://FOO.com/a/
HTTP/1.1 302 Moved Temporarily
Content-Language: en-US
Content-Type: text/plain; charset=UTF-8
Date: Mon, 26 Nov 2012 23:49:30 GMT
Location: http://FOO.com/public/Welcome.action
Content-Length: 0
Connection: keep-alive

Note that the Location: line no longer has the /a/ embedded.  That's because ProxyPassReverse does a right hand match on the returning URL - and remaps it if it matches.  If I change the ProxyPassReverse line back to

ProxyPassReverse /a/ http://FOO.com/

The Location tag changes to include the /a/, and it works correctly:

$ curl --dump - http://FOO.com/a/
HTTP/1.1 302 Moved Temporarily
Content-Language: en-US
Content-Type: text/plain; charset=UTF-8
Date: Mon, 26 Nov 2012 23:51:53 GMT
Location: http://FOO.com/a/public/Welcome.action
Content-Length: 0
Connection: keep-alive

But, this won't work with the second sub-path, with the /c/, because I'd need to have the same path (http://FOO.com/), which means there's a conflict.

    -d




On 11/26/12 6:41 PM, Igor Cicimov wrote:
        # Working, live production host:
        ProxyPass /a/ ajp://10.211.42.48:8009/
        ProxyPassReverse /a/ ajp://10.211.42.48:8009/

        # app test host
        ProxyPass /c/ ajp://10.122.95.146:8009/
        ProxyPassReverse /c/ ajp://10.122.95.146:8009/


-- 
Dave Shevett
shevett@xxxxxxxxx



--
The only thing that interferes with my learning is my education.

Albert Einstein



[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux