views:

34

answers:

2

Hi all,

I'm trying to configure an Apache 2.2 proxy server to point to multiple Weblogic instances. I'm doing fairly well with everything but a minor point.

I can get this to work: ProxyPass /QA http://IP:PORT/

by going to http://IP:PORT/QA

But I can't get this to work: ProxyPass / http://IP:PORT/

by going to http://IP:PORT/

I don't understand why I cannot have ProxyPass map to the root(/)

Thanks in advance,

Liz

A: 

I believe Apache just doesn't allow it. There's a potential problem here with the order and precedence of conflicting directives; if you get a request for /QA/ should that follow the /QA match or the / match? I guess you might be trying to map multiple managed servers on the same address/port without having to identify each sub-path, i.e. a single rule instead of many. There's still a clash with documentRoot. Arguably, if you're matching on root, then what's the point of the Apache layer - everything is being passed straight through and nothing is being served by Apache itself. (Which doesn't mean there are never valid reasons to do that, but I can see why Apache might think it).

The only way I know to do this is inside a dummy virtual host (not sure if this can be on the only listen port, but I think so):

<VirtualHost *:8080>
    ProxyPass / http://IP:PORT/
    ProxyPassReverse / http://IP:PORT/
</VirtualHost>

You could also look at the WebLogic proxy plug-in:

<Location />
    SetHandler weblogic-handler
</Location>

<IfModule mod_weblogic.c>
    WebLogicHost IP
    WebLogicPort PORT
</IfModule>
Alex Poole
A: 

Alex, thanks for your help!

For anyone else out there trying to setup a similar environment, I've paste what I've done below.

ProxyRequests OFF

LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_http_module modules/mod_proxy_http.so
LoadModule proxy_balancer_module modules/mod_proxy_balancer.so
LoadModule headers_module modules/mod_headers.so

<Proxy *>
    Order deny,allow
    Allow from all
</Proxy>

Header add Set-Cookie "ROUTEID=.%{BALANCER_WORKER_ROUTE}e; path=/" env=BALANCER_ROUTE_CHANGED
<Proxy balancer://cluster>
    BalancerMember http://IP:PORT/ route=1
    BalancerMember http://IP:PORT/ route=2
    ProxySet stickysession=ROUTEID
</Proxy>

<VirtualHost *:80>
    ProxyPass / balancer://cluster/
    ProxyPassReverse / balancer://cluster/
</VirtualHost> 
Liz N