Saturday, July 16, 2011

Configure Apache Webserver with Weblogic Server

Configure Apache Webserver with Weblogic Server


Configuring apache with weblogic server is very straight process. You have to copy module file ( plugin ) [ which comes with weblogic ( .so file ) or WLS 12 onwards you have to manually download the plugins directly from weblogic website ] to apache module directory and have to enable certain forward rules for load balancing requests to different managed servers.

Here are the exact steps -


Step 1) 

After apache installation, if needed update httpd.conf file to run apache on some specific port apart from 80, like if you want your apache to run on port 8080 then edit httpd.conf file and update Listen Port parameter from default 80 to 8080 and restart apache.

Listen 8080
Now to test if your apache is running properly or not just hit http;//<host>:8080 and you will apache default welcome message.


Step 2) 

Copy the mod_wl_20.so from Oracle_Home\WL_HOME\server\plugin\win\32 to your apache module directory ( like for me it's  C:\Program Files\Apache Group\Apache2\modules)
Step 3) 

Add below lines in the httpd.conf file
LoadModule weblogic_module modules/mod_wl_20.so
<Location />
SetHandler weblogic-handler
</Location>
<IfModule mod_weblogic.c>
WebLogicCluster localhost:7003,localhost:7005
Debug ON
WLLogFile c:/temp/wlproxy.log
WLTempDir c:/temp
</IfModule>

Here we have defined location as /, means it will redirect all requests to weblogic server ( for example, if you will modify it as /console then it will redirect only /console requests to weblogic server )

WeblogicCluster we have added all managed servers listen address and ports, apache will load balance the requests between all servers defined there  ( if there is no configuration and other issues )

Debug ON is only required for some troubleshooting purpose, otherwise it should be off

WLLogFile will create the debug log file
Step 4)

 Now, deploy you application across your weblogic cluster and restart Apache and access the application deployed on the Cluster using
http://localhost:8080/your_application_context

This will forward the request to the Weblogic Cluster

2 comments:

  1. Gr8t job bro....ur articles are really user frndly...keep up ur gud wrk !!

    ReplyDelete
  2. hi mukesh , i have a doubt . how about configuring apache with two adminservers(domains)of the weblogic server.

    ReplyDelete