Configure IIS 8 and Tomcat Connector ISAPI Filter on Windows Server 2012

We are going to configure IIS 8 as a frond-end for Apache Tomcat.

Instructions should also work on Windows Server 2008 R2 with IIS7.5.

Step 1

If on IIS 8, install ISAPI extensions and ISAPI Filters first thing in the Add Roles and Features of Server Roles as below screenshot:

Step 2

Download the isapi_redirect.dll from the Tomcat site:

http://www.apache.org/dist/tomcat/tomcat-connectors/jk/binaries/windows/

Unzip the file and copy the isapi_redirect.dll into the Tomcat’s installation directory:

C:\Program Files (x86)\Dashboard\Dashboard\tomcat\bin\

Be advised that Tomcat path may differ depending on your installation.

Step 3

Run Regedit as Administrator and backup the registry hive!

Create the following entry:

HKEY_LOCAL_MACHINE\SOFTWARE\Apache Software Foundation\Jakarta Isapi Redirector\1.0

If the Apache Software Foundation key does not exist in the hierarchy mentioned above, then create the path manually. So, the hierarchy will resemble the following:

[HKEY_LOCAL_MACHINE\SOFTWARE\Apache Software Foundation\Jakarta Isapi Redirector\1.0]

Add the following registry keys with values (all strings):

@=
extension_uri = /jakarta/isapi_redirect.dll
log_file = C:\Program Files (x86)\Dashboard\Dashboard\tomcat\logs\isapi_redirect.log
log_level = error
worker_file = C:\Program Files (x86)\Dashboard\Dashboard\tomcat\conf\workers.properties.minimal
worker_mount_file = C:\Program Files (x86)\Dashboard\Dashboard\tomcat\conf\uriworkermap.properties

See the image below for more info.

Step 4

Setup isapi and CGI restriction on IIS server.

Open IIS Manager and Select Your Server. From the features view open ISAPI and CGI Restrictions, click Add from the Actions bar.

For ISAPI or CGI Path click the … Button and choose isapi_redirect.dll file at the tomcat installation folder (C:\Program Files (x86)\Dashboard\Dashboard\tomcat\bin\).

In the Description Field write isapi_redirect.

Tick the Allow extension path to execute and click OK.

Step 5

Add a new IIS web site with the following details:

Site name: tomcat.example.com
Physical path: C:\inetpub\wwwroot\tomcat
Host name: tomcat.example.com
Start website immediately: untick

Add an HTTPS binding on port 443 and pick a suitable SSL certificate.

At this point we should have a new site created with bindings on ports 80 and 443. We can test the site by putting a blank index.html file to C:\inetpub\wwwroot\tomcat\.

Now, select the site we just created and double click the ISAPI Filters icon to open it. Click Add.

Type jakarta in the filter name And click … Button to to select the isapi_redirect.dll.

Click open to select the dll file and OK to close the window when done.

Step 6

Right click to the site created in step #5 and choose Add Virtual Directory.

Type jakarta in the Alias field and choose the path of the isapi_redirect.dll file (C:\Program Files (x86)\Dashboard\Dashboard\tomcat\bin\) as the Physical path. Click OK when done.

Open Handler Mappings by selecting the virtual directory Jakarta.

Select Edit Feature Permissions from the Actions bar and Check All (Read, Script, and Execute) and click OK.

Step 7

Configure Tomcat redirection.

Copy C:\Program Files (x86)\Dashboard\Dashboard\tomcat\conf\workers.properties to C:\Program Files (x86)\Dashboard\Dashboard\tomcat\conf\workers.properties.minimal.

Restart the Tomcat service. Test the configuration by opening the IIS site that was just created: http://tomcat.example.com.

References

https://ashrafhossain.wordpress.com/2010/09/20/how-to-configure-iis-7-and-tomcat-redirection-on-windows-server-2008-64-bit/
http://luan-itworld.blogspot.co.uk/2013/07/isapi-tomcat-redirector-on-iis-8-of.html

11 thoughts on “Configure IIS 8 and Tomcat Connector ISAPI Filter on Windows Server 2012

  1. I don’t find …/conf/worker.properties nor …/conf/worker.properties.minimal. How does that happen?

  2. I’m using Windows 10 and IIS 10. Got isapi_redirect from the link but I keep having error that function getfilterversion cannot be called on isapi filter E:\Tomcats\isapi_tomcat_redirect\isapi_redirect.dll

    Any idea why?

  3. Tomas, this guide is ok but incomplete and differs quite alot from the workflow described here: https://tomcat.apache.org/connectors-doc/webserver_howto/iis.html
    It would be good if you wrapped the whole thing up with a working example of how a call to IIS got redirected to an application running under Tomacat.

    @Ted: Maybe the files are missing because you did not include ‘Examples’ when installing Tomcat?

    /E

    • Thanks for your feedback! The guide is complete in a sense that it provides a working solution. I used this configuration on numerous occasions myself and I am therefore confident that it works. One thing that’s not covered in the article is the installation of Tomcat itself, but that’s not what the guide is about.

  4. This is absolutely wrong.
    “Copy C:\Program Files (x86)\Dashboard\Dashboard\tomcat\conf\workers.properties to C:\Program Files (x86)\Dashboard\Dashboard\tomcat\conf\workers.properties.minimal. Do not modify the content of the file.”
    You just copy and paste without understanding what you are doing.

    • Thanks for your time reading the post and providing feedback, much appreciated.

      I wrote this many years ago. I remember vaguely setting up Tomcat connector with IIS for the first time, that was really messy, and I didn’t know much about what I was doing at the time.

      To be honest with you, this post has little value, because I moved on to using Apache with mod_jk and worker.properties with a fully automated Puppet deployment, dropping IIS/Windows altogether. I should really delete the post.

Comments are closed.