Search This Blog

Friday 12 July 2013

URL Redirection implementation in Apache and Integration with weblogic


Step 1) Check whether mod_rewrite.so file is present under the below path.
C:\Program Files\Apache Software Foundation\Apache2.2\modules


Step 2) Un Comment the below line in httpd.conf file
LoadModule rewrite_module modules/mod_rewrite.so

Step 3) Comment  the following If module block in httpd.conf file
#<IfModule mod_weblogic.c>
#    WebLogicCluster localhost:9002,localhost:9003
#    Debug ON
#    WLLogFile C:/temp/wlproxy.log
#    WLTempDir C:/temp
#</IfModule>

Step 4) Write the below redirection rule in httpd.conf file
RedirectMatch 301 ^/$             /benefits
RedirectMatch 301 ^/msg$             /messaging

Step 5) Create configuration files for benefits and messaging applications.

C:\Program Files\Apache Software Foundation\Apache2.2\conf\extra\benefits.conf

<Location "/benefits">       
WebLogicCluster localhost:9002,localhost:9003
        Debug OFF
        SetHandler weblogic-handler
</Location>

C:\Program Files\Apache Software Foundation\Apache2.2\conf\extra\messaging.conf

<Location "/messaging">       
WebLogicCluster localhost:9002,localhost:9003
        Debug OFF
        SetHandler weblogic-handler
</Location>


Step 6) Include additional configuration files in httpd.conf file.

Include conf/extra/benefits.conf
Include conf/extra/messaging.conf

Step 7) Check syntax by using http –t command

Step 8) Restart apacheserver by using httpd –k restart command


Step 9) Deploy benefits.war and messaging.war application in weblogic cluster
Step 10) Access the the urls 1)http://localhost  2) http://localhost/msg
This url will redirect to http://localhost/benefits
(Install httpwatch Software to view the redirection )





This url will redirect to http://localhost/messaging




No comments: