Thursday, April 9, 2015

Apache webserver proxy configuration with Weblogic servers

If you want to use apache webserver as proxy for your weblogic cluster members,
we need to configure from webserver side. Please proceed below steps to achieve
proxy integration.

Step 1) Obtain webserver proxy plugins, For weblogic 11g version we will get directly from middleware home modules directory but if you are going to use weblogic 12C you need to download
modules from oracle site from here. unzip and use module file what ever you want.

ex:

 localhost lib]# ll
total 62208
-rwxr-x--- 1 root root 52761218 Apr 29  2014 libclntsh.so
-rwxr-x--- 1 root root  9740040 Apr 29  2014 libnnz11.so
-rwxr-x--- 1 root root   594709 Apr 29  2014 mod_wl_24.so
-rwxr-x--- 1 root root   594473 Apr 29  2014 mod_wl.so
[root@localhost lib]# pwd
/root/Downloads/lib
[root@localhost lib]#


Here i am using apache2.2 version so i am going to use mod_wl.so module.

step 2)  Need to configure from apache config file , i.e. httpd.conf, on httpd.conf file first we need to load this module like this: under couple of loadmodule available, so we can place weblogic module there.

EX:

LoadModule substitute_module modules/mod_substitute.so
LoadModule rewrite_module modules/mod_rewrite.so
LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_balancer_module modules/mod_proxy_balancer.so
LoadModule proxy_ftp_module modules/mod_proxy_ftp.so
LoadModule proxy_http_module modules/mod_proxy_http.so
LoadModule proxy_ajp_module modules/mod_proxy_ajp.so
LoadModule proxy_connect_module modules/mod_proxy_connect.so
LoadModule cache_module modules/mod_cache.so
LoadModule suexec_module modules/mod_suexec.so
LoadModule disk_cache_module modules/mod_disk_cache.so
LoadModule cgi_module modules/mod_cgi.so
LoadModule version_module modules/mod_version.so

#weblogic proxy plugin adding here:
LoadModule weblogic_module /root/Downloads/lib/mod_wl.so


Next step would be need to configure proxy servers for weblogic cluster.

first you can call setHandler directive(if you are not going to configure this you may not get proper output). After that you need to add under IfModule, weblogic cluster members details.

Note: you can configure below ones in page last side would be fine.

WeblogicCluster: here you need to configure managed servers hostnames or ip addresses with port numbers.
MatchExpression:  If you want to proxy any specific expressions only like (if you want only .jsp files) we can give here. or you want everything, you can provide like below example one.

ex:

<Location />
SetHandler weblogic-handler
</Location>

<IfModule mod_weblogic.c>
 WebLogicCluster 192.168.114.128:7003,192.168.114.129:7001,192.168.114.128:7001
 MatchExpression *.*
 </IfModule>

Apart from there is some more advanced options available you can check from oracle documentation here.

I will share video soon on this topic.