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.

9 comments:

  1. Nice!! , pretty cool man , thank you!!

    May be you must to writte more articles like this related to performance upgrade,balance and maintenance.

    Good article!!

    ReplyDelete
  2. Seems has performance issues on a 64bit server with the latest isapi_redirect.dll. Was over three times slower compared with 32 bit and IIS6.

    Switching to the MS ARR seems to have restored the performance, and is easy to install and configure.

    For config info see - http://dannybaggs.wordpress.com/2010/05/14/iis7-tomcat-application-request-routing/


    For all the details see - http://www.iis.net/download/applicationrequestrouting


    Download direct from - http://www.microsoft.com/web/gallery/install.aspx?appid=ARRv2_5

    ReplyDelete
  3. I followed your steps and successfully implemented it on Win 2008 server with IIS 7 and JBoss 5.1
    Great article, kudos to your work.

    ReplyDelete
  4. where is ISAPI file in default website?

    ReplyDelete
  5. Is it same for IIS & Jboss both are on different PCs?

    ReplyDelete
  6. Hi, I`m trying to connect the JBOSS 7 with a IIS on WS2012 but the step 7 I couldn`t execute because this options don't appear please help is urgent!!!

    ReplyDelete
  7. Hey,
    Thanx for such a nice post
    I have deployed a .EAR in Jboss how can i run this App using IIS
    Regards,
    Jodat

    ReplyDelete