Search This Blog

Sunday, 22 November 2015

Apache HTTP Server proxy configuration with WebLogic

There are many HTTP servers which serves web requests. Apache HTTP server is one of the most widely used webserver in the IT. Different vendors providing HTTP servers but all of them originated from Apache web server only. Due to open source many contributors expanded it with more capabilities.

Apache HTTP server Proxy with WebLogic 12c

Architecture overview

Apache Proxy to WebLogic cluster

Download Apache HTTP Server


Select stable version of Web server which will give minimum guaranty to work as expected.

Install Apache HTTP Server


tar -xvf httpd-2.2.27.tar.gz
cd httpd-2.2.27/
./configure --prefix=/home/oracle/apache2.27
Apache HTTP Server Configuration Successful

Compile and Install the Apache binaries

Actually Apache HTTP server uses native C, C++ libraries to compile and the compilation utility is 'make' command. You need to run the 'make' command in the same same path where configure was ran.

make

Linking the LD_LIBRARY to HTTP Server ready to run this we can do with 'make install ' command.

make install

Apache Configuration

The HTTP server configuration is in the conf folder. It contains various sum directories. Once the installation completed you can define environment variable in the profile as :
export APACHE_HOME=/home/oracle/apache2.27
vi $APACHE_HOME/conf/httpd.conf

Apache Control

Start the Apache Web server
cd $APACHE_HOME/bin
 ./apachectl start 
 
Stop the Apache Web server
cd $APACHE_HOME/bin
 ./apachectl start 
 

Check the Apache HTTP Server working

Check Apache HTTP Server configuration Listen Port issue


Apache HTTP Server start failed when the port 80 used from non root user. 80 is reserved port in Linux OS for the web server that run as administrator.
make_sock error Fix: To over come you can use different port e.g: 8080. Modify this Listen port value in the httpd.conf file and start the web server. 
It Works!

Listen 8080

Confirmation of HTTP server accessability Open a web browser and test the following URL:

http://192.168.33.100:8080


Validation of Web Server access
Integrate Weblogic with Apache

Configure Apache HTTP Server Proxy plugin for WebLogic Server


Post 10g weblogic stopped providing the plugins along with the installation, you have to download them externally. You can download the web server plugins from the below location


http://www.oracle.com/technetwork/middleware/webtier/downloads/index-jsp-156711.html

or

Oracle - downloads - middleware - webtier - Accept the license agreement - plugin you want - Download

Once you download the plugins you will find the following files after extraction as shown below.


I am selecting Linux 64 as I am configuring it on Linux 64 bit machine, extract the Linux ZIP and go to the lib folder, you will find a plugin called mod_wl.so under lib as shown below.

copy the mod_wl.so plugin from the above location to $APACHE_HOME/modules

NOTE – The mod_wl.so file differs for different apache versions. Make sure that the name of the file you copied to modules is same in httpd.conf.(sometimes you might prefix it with
Now edit the httpd.conf file present under /home/vagrant/apache2.2/conf/httpd.conf

Add the below lines to the httpd.conf file and save it integrate your weblogic cluster with apache.


LoadModule weblogic_module /home/vagrant/apache2.2/modules/mod_wl.so


SetHandler weblogic-handler



WebLogicCluster localhost:7002,localhost:7003
Debug ON
WLLogFile /tmp/wlproxy.log
WLTempDir /tmp


You can replace the cluster with individual host, by replacing weblogicCluster with weblogic Host as shown below.

  WebLogicHost 192.168.33.100
  WebLogicPort 7001
  Debug ALL
  DebugConfigInfo ON
  WLLogFile /tmp/wl-proxy.log


Restart the apache to get the changed reflected.

go to /home/vagrant/apache2.2/bin and run the below command.

./apachectl restart


Deploy any web application that is .war/ear file to the weblogic cluster


Application deployment on WebLogic  Server

Test it by accessing thru Individual manged servers as shown below.

Application accessing with WebLogic server port

Now try accessing it thru Apache using 8080 port as shown below.

Application accessing with Apache Server port

  WebLogicHost 192.168.33.100
  WebLogicPort 7001
  Debug ALL
  DebugConfigInfo ON
  WLLogFile /tmp/wl-proxy.log


Restart the apache to get the changed reflected.

go to /home/vagrant/apache2.2/bin and run the below command.

./
./apachectl restart


Deploy any web application that is .war/ear file to the weblogic cluster


Application deployment on WebLogic  Server

Test it by accessing thru Individual manged servers as shown below.

Application accessing with WebLogic server port

Now try accessing it thru Apache using 8080 port as shown below.

Application accessing with Apache Server port

3 comments:

  1. we better use the following configuration

    # WebLogicHost 192.168.33.100
    # WebLogicPort 9013
    WebLogicCluster 192.168.33.100:9013,192.168.33.100:9014



    SetHandler weblogic-handler
    MatchExpression *.jsp
    WLSRequest On
    PathTrim /mywebapp

    ReplyDelete
  2. "
    # WebLogicHost 192.168.33.100
    # WebLogicPort 9013
    WebLogicCluster 192.168.33.100:9013,192.168.33.100:9014



    SetHandler weblogic-handler
    MatchExpression *.jsp
    WLSRequest On
    PathTrim /mywebapp

    "

    ReplyDelete
  3. oracle@myqa:~/apache/bin$ ./apachectl -t
    httpd: Syntax error on line 54 of /u01/app/oracle/apache/conf/httpd.conf: Cannot load /u01/app/oracle/wlplugins/lib/mod_wl.so into server: libonssys.so: cannot open shared object file: No such file or directory
    oracle@myqa:~/apache/bin$ ls -l /u01/app/oracle/wlplugins/lib/mod_wl.so
    -rwxr-x--- 1 oracle oinstall 568848 Nov 9 12:55 /u01/app/oracle/wlplugins/lib/mod_wl.so
    oracle@myqa:~/apache/bin$ ls -l /u01/app/oracle/wlplugins/lib/libonssys.so
    -rwxr-x--- 1 oracle oinstall 94125 Nov 9 12:55 /u01/app/oracle/wlplugins/lib/libonssys.so
    oracle@myqa:~/apache/bin$ export LD_LIBRARY_PATH=/u01/app/oracle/wlplugins/lib:$LD_LIBRARY_PATH oracle@myqa:~/apache/bin$ ./apachectl -t
    Syntax OK

    ReplyDelete

WebLogic Books

  • Oracle WebLogic Server 12c: Administration Handbook
  • WebLogic Diagnostic Framework
  • Advanced WebLogic Server Automation
  • Oracle SOA Suite 11g Administrator's Handbook

Popular Posts