Translate

Wednesday, January 5, 2011

Configuring JBOSS 4.2.2 with IIS 7

In real time scenario's it is required to provide the access to the application via web-server instead of directly on the app server, to secure the application server from direct access.

One such common configuration is using IIS web server with JBOSS app server, this post describes how to configure JBOSS 4.2.2 apps with IIS 7.



For Configuring JBOSS with IIS7 follow the below mentioned steps :-


1. Download ISAPI_redirect.dll from the below mentioned location http://opensource.become.com/apache//tomcat/tomcat-connectors/jk/binaries/
and rename the file to isapi_redirect.dll


2. Create a folder ISAPI with three sub folders bin, conf and log
In bin folder copy the dll downloaded in the first step.
In conf folder create 3 files jakarta.reg, uriworkermap.properties, workers.properties
copy the content mentioned below in jakarta.reg file
REGEDIT4
[HKEY_LOCAL_MACHINE\SOFTWARE\Apache Software Foundation]
[HKEY_LOCAL_MACHINE\SOFTWARE\Apache Software Foundation\Jakarta Isapi Redirector]
[HKEY_LOCAL_MACHINE\SOFTWARE\Apache Software Foundation\Jakarta Isapi Redirector\1.0]

"extension_uri"="/jakarta/isapi_redirect.dll"
"log_file"="E:\\ISAPI\\log\\jakarta.log"
"log_level"="debug"
"worker_file"="E:\\ISAPI\\conf\\workers.properties"
"worker_mount_file"="E:\\ISAPI\\conf\\uriworkermap.properties"


uriworkmap.properties - This file contains URL executed by jboss
# uriworkermap.properties - IIS
## This file provides sample mappings for example wlb# worker defined in workermap.properties.minimal
# The general syntax for this file is:# [URL]=[Worker name]
/admin/*=wlb

/manager/*=wlb
/jsp-examples/*=wlb
/servlets-examples/*=wlb
/jmx-console/*=wlb
/images/*=wlb*.ico=wlb
# Optionally filter out all .jpeg files inside that context# For no mapping the url has to start with exclamation (!)
!/servlets-examples/*.jpeg=wlb
## Mount jkstatus to /jkmanager
# For production servers you will need to# secure the access to the /jkmanagerurl#

/jkmanager=jkstatus

Worker.properties - This file defines the path to jboss
# workers.properties.minimal -## This file provides minimal jk configuration properties needed to# connect to Tomcat.## The workers that jk should create and work with#
worker.list=wlb,jkstatus
## Defining a worker named ajp13w and of type ajp13# Note that the name and the type do not have to match.#

worker.ajp13w.type=ajp13
worker.ajp13w.host=localhost
worker.ajp13w.port=8009
## Defining a load balancer#
worker.wlb.type=lb

worker.wlb.balance_workers=ajp13w
## Define status worker#
worker.jkstatus.type=status


3. After the folder and files are create double click the jakarta.reg file and create the registry entry.


4. Open the IIS 7 console click on server name and go to ISAPI and CGI Restrictions. Click add to add a new filter and configure path up to the dll file copied in first step.


5.Go to default website in IIS console, and select ISAPI filter. Add a new filter with path till isapi_redirect.dll copied in first step.


6. Right click on default website and go to Add virtual directory. Create a virtual directory with name Jakarta and path till bin folder copied in first step.


7.Right click on the new virtual directory created and go to Handler Mappings and enable the ISAPI-dll if it is in disabled state.


8. Now create a new virtual directory with name of your applications and path till the default.html or index.html.

That's it your are done restart the iis and access the application using IIS.

No comments:

Post a Comment