Integrating IIS with Tomcat

Friday, July 4, 2008

Steps for Integrating IIS (5 and above) with Tomcat (5 and above)



This article explains the way to integrate IIS (Version 5 and above) with Tomcat (Version 5 and above). Since IIS cannot serve dynamic java contents like servlets and JSPs, the IIS Tomcat connector delegates Tomcat servlet engine to handle servlet and JSP calls. I still couldn't find a good document which clearly explains how to use the install4iis.js (A javascript installer used to configure the IIS Tomcat connector) to make the installation process much simpler. So here's mine.

1. Download the Tomcat IIS Connector (Jk2 binaries) from one of the mirrors


2. Unzip the connector. There will be three directories namely bin, conf and doc. The bin folder has the isapi_redirector2.dll and an installation javascript file install4iis.js. I call the directory where you unzipped the IIS connector zip file as <IIS_CONNECTOR_HOME>.

3. From IIS perspective I assume that the default web site is running and you need to redirect all URIs related to Servlets and jsps for Tomcat to execute them i.e URIs of the form and to Tomcat servlet container URI and respectively.

These are the steps to be executed from Tomcat and IIS.

From Tomcat:

I assume that you installed Tomcat properly and have a running version of Tomcat at port 8080 with jk2 at 8009. Since these are the default settings in Tomcat 5, there is virtually no need to do anything from Tomcat side once you have a running version of Tomcat.

From IIS:

1. Since the default web site is running, invoking the install4iis.js

(<IIS_CONNECTOR_HOME>/bin directory) will be straightforward.

2. Configuring the jakarta filter:

To do this one should create a new virtual directory from the IIS management console.

1. Goto Settings -> Control Panel -> Administrative tools -> Internet Information Services

2. Expand the Local Computer icon.

3. Expand Web sites folder and Default Website.

4. Under the Default Web site create a new virtual directory.

1. Right click Default Web site -> Click New -> Virtual Directory -> Next

2. In the (Alias) Text field enter the name as jakarta and Click next

3. Enter <IIS_CONNECTOR_HOME>/bin as the directory path and Click Next

4. Select read, run scripts and execute access permissions, Click Next and Finish.

5. Configure file:

This file is used to configure the connector properties, the URI pattern to be filtered, and details of the IP address and the port where the Tomcat connector is listening, etc.To map URIs of the form /Servlets-examples and /jsp-examples for Tomcat, the following settings need to be specified in the file.

Create a file in <IIS_CONNECTOR_HOME>/conf directory with the following settings.

# Example socket channel, override port and host.




# define the worker



# Map the default Tomcat directory to the Web server uri space





6. Now you are set to execute the IIS Tomcat connector installation script install4iis.js. Either double click install4iis.js or execute it in command line as windows script using

Wscript //E:Jscript install4iis.js

The installation process using install4iis.js will take 10 – 15 steps. Click Ok for all messages in the message box one
after another and finally check for the message

Filter [jakarta] set. Click Ok to complete the installation.

Note: By Default the install4iis.js configures the filter (jakarta, the virtual directory configured above) for the Default
Web Site. If you want to configure the filter for other sites, you need to use the appropriate command line options.
For more help,
type Wscript //E:Jscript install4iis.js –h.

7. Restart IIS (In IIS Management console, right click Local Computer -> All tasks -> Restart IIS).

8. To check the configuration of the filter, in the IIS Management console, expand Local Computer -> Web Sites and Right click Default Web Sites and Click Properties and ISAPI Filters tab. There you should see the green status of the jakarta filter indicating that the filter is loaded.

Once the above procedures are completed correctly, then typing in browser will fetch the Tomcat page and will fetch page. Try executing the sample Servlets and jsp examples through IIS Connector and check the results.


Anonymous said...

JK 2 is unsupported. The only supported Tomcat JK connector is JK 1

Prasanna Seshadri said...


By the time this article was written first, the connector used was JK2 which I used to integrate Tomcat with IIS.

Yuriy said...

Greate article, thanks!
I'd like to add some additional notes:

1. There should be at least one filter installed at IIS before you run install4iis.js. In other case you'll get this error: "Unable to find the IIsFilters for Default Web Site". I guess the IIsFilters collection is null if no filters installed. For this you can add isapi_redirector2.dll manually, and then run install4iis.js.

2. For Tomcat 6.X you need to change configuration of Instead of these lines:

use the following:


Prasanna Seshadri said...

Thanks a lot for your time Yuriy in pointing that out, I will make the enhancements in my next update soon, its been a while I worked in Tomcat.

Anonymous said...


You mention that we need to have a running version of Tomcat at port 8080 with jk2 at 8009. My tomcat is runing at port 8080 with ajp 1.3 connector. How can i change this thing?


Prasanna Seshadri said...


The AJP connector runs at port 8009 for any Tomcat versions and its the Tomcat servlet container which listens at port 8080 so the procedure I mentioned should work out for you without any changes.

giris said...

How to send message from one machine to another machine through socket, where one application is running in C and another in Java.

I am working in C, and I wrote the client program.
Server is running in Java application.
I have the below detials of server.
1.IP address.
2.Port number.
3.Servlet: /SocketListnerServlet

My question is how to connect to the perticular application port which is running in different application in different machine.


Luis said...

Error processing install4iis.js
Unable to find ADSI object...
The 'Default Web Site' does not exists.


Prasanna Seshadri said...


I am not sure which version you are working on, in any case the writing may apply to the version of IIS and Tomcat mentioned or something near.

Onkar Paradkar said...

I am totally new to this , I checked the article sounds very informative.
just tell what exact link should i type to check if my jsp page is working thr' IIS connector?

Harish said...
This comment has been removed by the author.
Harish said...

hi..this is harish.... am new to sockets ... to be frank dnt xctly knw wats a socket.... but nw d problem is socket programming in c++ is a par of my academics... so please suggest me where to start from exactly...

Nagendra Prasad said...

Hi Prasanna,
I am working on python 2.4 and am facing one issue in socket programming.. client is a python program and server side is "C" code. I want to send structure from client side to server side "C" code.Please can you let me know how to create a structure in python and populate the data to a structure and send it to the server side.

Simha said...

Hi Prasanna,

I have a gre header, a custom header that goes in as payload of gre, followed by IP/TCP (innerlayer as the structure), I still get malformed packet as o/p.
Appreciate your help with an example.
I am learning socket programming, I have an assignment where i need to create a packet injector, which will be 1. Complete packet with a GRE Header, a custom packet structure, followed by IP, TCP layers.

Do you have any example or a sample code ?.

Anonymous said...

I have done my IIS and Tomcat integration with the BonCode connector supplied by the site.
It was pretty simple; I admit that I did not read the whole install manual; just used the installer.

John Britto said...

How to configure tomcat 6.0.26 wiht IIS 6?

Please could anyone help me

Gaurav said...

someone tell me a compiler that are capable for making tcp-scoket programming or email on

Copyright © 2016 Prasanna Seshadri,, All Rights Reserved.
No part of the content or this site may be reproduced without prior written permission of the author.