Permissions

The official documentation lacks a few important bits around file permissions that must be set if the application pool identity the connector is running under does not have global permissions to the servers file system:

  • The directory with your isapi_redirect.dll and associated .properties files must be at least read only to the application pool identity account
  • If you have logging enabled for the filter then the application pool identity must have read & write access to the log file
  • If you use the registry for the configuration then the application pool identity must have read access to the keys If you miss any of the above then the filter simply will not work and you will not receive any form of error messages to tell you it has not worked.

Windows 2008 / IIS 7 Step by Step

The following steps detail setting up IIS to function correctly with the connector, it assumes you have already completed the .properties or registry configuration:

Allow ISAPI Filter to run:

  • In the IIS Manager console select the computer node
  • Open the "ISAPI and CGI" restrictions panel
  • Click the "Add" button
  • Under "ISAPI or CGI path" enter the full path to the Connector ISAPI dll
  • Under "Description" add something meaningful such as "Tomcat"
  • Check "Allow extension path to execute"
  • Click "Ok"

Enable ISAPI Filter for individual sites:

  • In the IIS Manager console open the computer node and select the website to add the ISAPI filter to
  • Right click on the website node and add a new virtual directory pointing to the directory containing the dll and associated .properties files
  • Open the "ISAPI Filters" panel
  • Click the "Add" button
  • Under "Filter Name" add something meaningful such as "Tomcat"
  • Under "Executable" enter the full path to the Connector ISAPI dll
  • Click "Ok"

If you are using the website for hosting other technologies (such as asp.net) the order of execution for the filters may have to be changed for everything to work as expected. In order to do this click "View Ordered List" in the "ISAPI Filters" panel for a website and then use the "Move Up" and "Move Down" buttons to reorganise the execution order. If you would like asp.net to handle cases such as 404's then the Tomcat filter should appear BEFORE those for .net. If you are using specialist authentication filters (such as CA SiteMinder) then these should appear before Tomcat so that requests are correctly authenticated prior to being received by the connector.

Setup

Configuring Tomcat and IIS is documented at the IIS Howto page . The instructions there work fine, but there is a setup program which allows you to skip steps 1 through 7 in the "Configuring the ISAPI Redirector" section of this page. Also, step 8 can be done using a VBScript file like this:

'Taken from http://msdn.microsoft.com/library/en-us/iissdk/html/8fcd5343-07cb-49e9-a206-0c65a988dcca.asp?frame=true and
' http://msdn.microsoft.com/library/default.asp?url=/library/en-us/iissdk/html/425ff52d-9998-44a9-95dd-b46b2e390db8.asp
' or Google the Microsoft web site for "Creating Sites and Virtual Directories Using ADSI" and "Enabling ISAPI Filters Using ADSI"
' with http://www.google.com/search?q=%22Creating+Sites+and+Virtual+Directories+Using+ADSI%22+site%3Amsdn.microsoft.com
' and http://www.google.com/search?q=%22Enabling+ISAPI+Filters+Using+ADSI%22+site%3Amsdn.microsoft.com

Option Explicit
Dim IIsPath
Dim ConnectorPath

Dim FiltersObj
Dim FilterObj
Dim LoadOrder
Dim Name 'of the filter and the virtual directory
Dim DLLName

'Double-check this path
ConnectorPath = "C:\Program Files\Apache Software Foundation\Jakarta Isapi Redirector\bin\"

'Configure the first (default) web site on a machine. Change to "2" for the second web site, etc.
IIsPath = "IIS://LocalHost/W3SVC/1/"

'=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
'SHOULDN'T NEED TO CHANGE ANYTHING BELOW THIS LINE
'=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Name = "jakarta"
DLLName = "isapi_redirect.dll"

'Configure the filter order (add it at the bottom of the list)
Set FiltersObj = GetObject(IIsPath & "Filters")
LoadOrder = FiltersObj.FilterLoadOrder
If LoadOrder <> "" Then
  LoadOrder = LoadOrder & ","
End If
LoadOrder = LoadOrder & Name
FiltersObj.FilterLoadOrder = LoadOrder
FiltersObj.SetInfo

'Actually create the filter
'ToDo: set priority. This might be possible with the FilterFlags property, but the IIS doc says:
' "Because this property is internally configured by IIS, you should consider it to be read-only. Do not configure this property."
Set FilterObj = FiltersObj.Create("IIsFilter", Name)
FilterObj.FilterPath = ConnectorPath & DLLName
FilterObj.SetInfo

Save this script to a file with a VBS extension. Open it in Notepad and verify that the ConnectorPath variable is correct for your connector installation. Then open a command prompt and run it with the cscript interpreter: cscript filename.vbs . Restart IIS, and test the connector as mentioned in the Howto (go to http://localhost/servlets-examples/ ).

Corrections on the above script and suggestions on how to get it into the Setup program are welcome.

You still need to do the other steps on the IIS Howto page, such as adding your contexts, etc.


Added by SkyBristol on 4/11/2006

The setup file included here and the script to add the ISAPI filter work just fine in IIS6, but there is one additional step needed. You must also allow access to the filter through the Web Service Extensions part of IIS. To do this graphically, do the following:

1) open the IIS Manager and go to the Web Service Extensions item under the appropriate server 2) Click the "Add a new Web service extension" item under "Tasks" 3) Give it a name like "jakarta" 4) Browse to the isapi_redirect.dll file you installed above as a "Required File" 5) Check the box to enable this extension

Added by Tony.Britton on 12/11/2009:

To add the Jakarta WSE programmatically, run the following line at a command prompt: (Change the File Path/File Name as appropriate)

cscript.exe //NOLOGO iisext.vbs /AddFile "C:\Program Files\Apache Software Foundation\Jakarta Isapi Redirector\bin\isapi_redirect.dll" 1 jakarta 1 jakarta

Added by MaiPiu on 12 May 2006

IIS and Tomcat: you found also in Other links see here UsefulLinks. Little notice: Using the present help, I made working IIS 6.0 , Jk, Tomcat 5.0 on Windows2003 server... (but in link before you found works also with jk2!)


Added by JohnJames on 12 April 2011:

I have used the .net based BonCode JK connector rather than the ISAPI redirector to connect IIS6 and IIS7 to Apache Tomcat 6. This worked very easily. There is GUI installer in the distribution package that worked for me. There are also videos on how to do the setup.

  • No labels