This article explains how we can connect Apache server to Weblogic server. To make this happen you need mod_wl_XX.so plug-in. This plug-in extends an Apache Installation allowing WebLogic to handle those requests that require the dynamic functionalities of the WebLogic Server.

This plug-in has been designed for an environment in which an Apache Server serves static pages, and another part of the document tree (dynamic pages, Servlets or JavaServer Pages) is delegated to the WebLogic Server, which could be operating in a different process, possibly on a different host. In the end user – the browser – the HTTP requests delegated to the WebLogic Server will appear to come from the same source.

The Plug-In operates as an Apache module in an Apache Server. Like any other included module Apache server loads the modules at the time of boot.

 

Steps for the configuration are:
Install the Plug-in for Apache web server.
Configure apache so that the module get loaded and proxy desired requests.
Restart Apache service so that it could pick up the changes.

 

Step 1: Install the Plug-in for Apache web server.

This Apache plug-in is distributed as a shared object (.so) for use on the Aix, Solaris, Linux, and other platforms. The shared object file is distributed in separate versions, depending on the platform.

To check the apache version

[root@beingexplorer lib]# httpd -v
Server version: Apache/2.2.15 (Unix)
Server built: Oct 19 2017 16:39:55

Depending on your version of Apache, use the following plugin.

   Apache Version                    Plugin 
Apache Version 2.0.x              mod_wl_20.so
Apache Version 2.2.x              mod_wl_22.so
Apache Version 2.4.x              mod_wl_24.so

WebLogic Server installation contains shared object (.so) files for various platforms. Eg:

Solaris
WL_HOME/wlserver_xx.x/server/plugin/solaris/sparc

Linux
WL_HOME/wlserver_xx.x/server/plugin/linux/i686

 

Step 2: Configure apache so that the module get loaded and proxy desired requests.

Modifying httpd.conf file :

Now copy mod_wl_xx.so file to the APACHE_HOME\modules directory and add t line to your APACHE_HOME/conf/httpd.conf file manually:

LoadModule weblogic_module modules/mod_wl_22.so

This will load the module when you start the apache service.

We now add an IfModule block:
For a WebLogic Server without clusters, WebLogicHost and WebLogicPort parameters .
For a cluster of WebLogic Servers, WebLogicCluster parameter .

<IfModule mod_weblogic.c>
WebLogicHost beingexplorer.dev.com
WebLogicPort 7001
MatchExpression *.html
</ IfModule>

OR

<IfModule mod_weblogic.c>
WebLogicCluster 127.0.0.1:7003,127.0.0.1:7005,127.0.0.1:7007
MatchExpression *.jsp
MatchExpression *.html
</ IfModule>

Above example WebLogic specifies that all files with the MIME type .jsp will be passed.

Instead of adding this to httpd.conf you can also create a separate file named weblogic.conf and put all of the above configuration there.
But in that case you need to Inlcude the weblogic.conf file in httpd.conf by apache Include directive.

<IfModule mod_weblogic.c>
MatchExpression *.jsp 127.0.0.1:7003,127.0.0.1:7005,127.0.0.1:7007
MatchExpression *.html 127.0.0.1:7003,127.0.0.1:7005,127.0.0.1:7007
</IfModule>

Step 3 : Restart Apache service so that it could pick up the changes.

service httpd restart

 

There you go, all done . Do check the logs if things are working, reply me if you face any issue. 

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes:

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>