Hi,

Jay SenSharma

Jay SenSharma

Here is a Simple demonstration of using Apache Proxy Plug-In as a repository for caching Static Contents like Image files And Html pages…this helps us in improving the performance of the Backend Servers.

In the following demonstration we will see how we can Configure Apache plugin with WebLogic Server- 10.3.2, Same step can be followed with any other version of weblogic Server as well.

Step1). Install Apache proxy plugin in your Box… This is quite simple step.

Step2). Copy the “mod_wl_20.so” or “mod_wl_22.so” file from the following location of your WebLogic Server  (E:bea10_3_2wlserver_10.3serverpluginwin32)  … I m using WLS10.3.2 … I am choosing “mod_wl_20.so” for this demonstration …you can choose any of the file based on your requirements…

Getting Apache Module from WLS installation

Getting Apache Module from WLS installation

Step3). Goto the Apache Installation directory in your Box  and then Paste “mod_wl_20.so” in the following location “C:Program FilesApache GroupApache2modules”

Step4). Move inside the “C:Program FilesApache GroupApache2conf” directory to configure the Apache to provide the “LoadModule” information inside the “httpd.conf” file:

Example:   LoadModule weblogic_module modules/mod_wl_20.so

Paste the Module in the Apache Modules Directory

Paste the Module in the Apache Modules Directory

edit the "httpd.conf"

edit the "httpd.conf"

Add the LoadModule information inside "httpd.conf"

Add the LoadModule information inside "httpd.conf"

Step5). Now add the If Module information inside “httpd.conf” file to point to WebLogic Server which is running on localhost:7001 ….Just add the following line of code at the bottom of the “httpd.conf” file:

<IfModule mod_weblogic.c>
WebLogicHost 127.0.0.1
WebLogicport 7001
MatchExpression /*
</IfModule>
—–If you have a WebLogic Cluster than you can use the below configuration as well—-
<IfModule mod_weblogic.c>
WebLogicCluster  MS1HostName:7003,MS2HostName:7005
MatchExpression /*
</IfModule>
Step6). Now restart WebLogic Server and Apache Proxy as well…
Restarting Apache & WebLogic

Restarting Apache & WebLogic

Step7). Now Just test whether you are able to hit the WebLogic Server through Apache or not:

http://localhost:80/console
Accessing Admin Console through Apache

Accessing Admin Console through Apache

Step8). . Now The most important part ..we are going to add some static Pages inside the Apache Plugin…so in order to do that…Add the following configuration change inside your “C:Program FilesApache GroupApache2confhttpd.conf” file…..Add a VirtualHost Tag there like below:

<VirtualHost *:80>
ServerName myServer
DocumentRoot "C:/Program Files/Apache Group/Apache2/htdocs"
</VirtualHost>
Like Following:

I developed a very simple “welcome.html” page here
<html>
<head>
<title>Apache Static Page</title>
</head>
<body>
<h1> Hi this is a Page Coming from Apache </h1>
<img src="osho.jpg"/>
</body>
</html>
Step9). Now Add a Folder “TestAppOne” iin the following location:  “C:Program FilesApache GroupApache2htdocs” with your static contents inside it….Example:
Adding Virtual Directory in APache Configuration

Adding Virtual Directory in APache Configuration

Place all the Images/Static Files inside Apache

Place all the Images/Static Files inside Apache

Step10). Restart your Apache Plugin and then hit the following URL:

http://localhost/TestAppOne/welcome.html

Accessing Static Images from Apache

Accessing Static Images from Apache

.

.

Thanks

Jay SenSharma

If you enjoyed this post, please considerleaving a comment or subscribing to the RSS feed to have future articles delivered to your feed reader.