Labels

Wednesday, June 27, 2012

How to Configure Apache with multiple weblogic server instances?

I came across a unique situation at work where I needed to configure Apache web server to forward requests to multiple weblogic server instances running on same box but different port numbers. Here is the scenario:

Instance A - http://test_server:7001/App1(Domain I)
Instance B - http://test_server:7003/App2 (Domain II)
Instance C - http://test_server:7005/App3 (Domain III)

I have App1 deployed on instance1 which is running in domain I. Similarly App2 deployed on instance 2, app3 deployed on instance 3. Needless to say all domains running in different ports(non-clustered environment).

Now I would like to configure my Apache to forward request to respective URLs based on what do they type in the URL.

If they type http://test_server/App1 should go to instance A.
If they type http://test_server/App2 should go to instance B.
If they type http://test_server/App3 should go to instance C.

When I use <IfModule> tag with location combination it did not work for me. But when I use <Location> tag for each app/instance in httpd.conf, it worked. Hope this information helps. 

#### for Instance 1/App1
<Location /App1>
       SetHandler weblogic-handler
       WebLogicHost test_server
       WebLogicPort 7001
       WLCookieName cookie1
       DynamicServerList OFF
       MaxPostSize     2048
       Debug ALL
       WLLogFile logs/httpd_proxy1.log
</Location>

#### for Instance2/App2

<Location /App2>
       SetHandler weblogic-handler
       WebLogicHost test_server
       WebLogicPort 7003
       WLCookieName cookie2
       DynamicServerList OFF
       MaxPostSize     2048
       Debug ALL
       WLLogFile logs/httpd_proxy1.log
</Location>


#### for Instance3/App3
<Location /App3>
       SetHandler weblogic-handler
       WebLogicHost test_server
       WebLogicPort 7005
       WLCookieName cookie3
       DynamicServerList OFF
       MaxPostSize     2048
       Debug ALL
       WLLogFile logs/httpd_proxy1.log
</Location>

No comments:

Post a Comment