You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

Configuring Tomcat and IIS is documented at [http://jakarta.apache.org/tomcat/connectors-doc/howto/iis.html the IIS Howto page] . The instructions there work fine but there is a [http://www.apache.org/dist/jakarta/tomcat-connectors/jk/binaries/win32/jk-1.2.10/isapi_redirect-1.2.10.exe setup program] which allows you to skip steps 1 through 6 in the "Configuring the ISAPI Redirector" section of this page. Also, steps 7 and 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?num=30&hl=en&q=%22Creating+Sites+and+Virtual+Directories+Using+ADSI%22+site%3Amsdn.microsoft.com&btnG=Search 
' and http://www.google.com/search?num=30&hl=en&q=%22Enabling+ISAPI+Filters+Using+ADSI%22+site%3Amsdn.microsoft.com&btnG=Search

Option Explicit
Dim IIsPath
Dim ConnectorPath
Dim IIsWebVDirRootObj
Dim IIsWebVDirObj

Dim FiltersObj 
Dim FilterObj 
Dim LoadOrder 
Dim FilterName 
Dim FilterPath 
Dim FilterDesc

'Double-check this path
ConnectorPath = "C:\Program Files\Apache Group\Jakarta Connector\bin\"
 
'Configure the first (default) web site on a machine
IIsPath = "IIS://LocalHost/W3SVC/1/"

'=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
'SHOULDN'T NEED TO CHANGE ANYTHING BELOW THIS LINE
'=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

' Create an instance of the virtual directory object  
Set IIsWebVDirRootObj = GetObject(IIsPath & "Root") 

' Use the Windows ADSI container object "Create" method to create  
' a new virtual directory. 
Set IIsWebVDirObj = IIsWebVDirRootObj.Create("IIsWebVirtualDir", "jakarta") 

' Use the Windows ADSI object "Put" method to  
' set some required properties. 
IIsWebVDirObj.Put "Path", ConnectorPath 
IIsWebVDirObj.Put "AccessRead", True 
IIsWebVDirObj.Put "AccessScript", True 

' Use the Windows ADSI object "SetInfo" method to  
' save the data to the metabase. 
IIsWebVDirObj.SetInfo

'Configure the filter
FilterName = "jakarta" 
FilterPath = ConnectorPath & "isapi_redirect.dll"
FilterDesc = "Tomcat filter" 'This text does not appear anywhere, AFAICT

'Set 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 & FilterName 
FiltersObj.FilterLoadOrder = LoadOrder 
FiltersObj.SetInfo 

'Actually create the filter
Set FilterObj = FiltersObj.Create("IIsFilter", FilterName) 
FilterObj.FilterPath = FilterPath 
FilterObj.FilterDescription = FilterDesc 
FilterObj.SetInfo

Save this script to a file with a VBS extension, and check the path in it to make sure it matches your connector installation. Then open a command prompt and run it with the cscript interpreter: cscript filename.vbs

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 [http://jakarta.apache.org/tomcat/connectors-doc/howto/iis.html IIS Howto page], such as adding your contexts, etc.

  • No labels