Configuring Tomcat to work with IIS
Using Windows 2000, IIS 5.0, and Tomcat 4.1.24
This is a listing of what to do with no explination of why. These steps worked for me installing on two dissimiliar boxes. If you have any questions, I’m probably not the one to ask because I don’t really understand the details of the connector.
- Install IIS. Make sure it’s working.
- Install Tomcat. Make sure it’s working on port 8080. Don’t change anything!
- Download isapi_redirect.dll from the Jakarta site. I found it at http://jakarta.apache.org/builds/jakarta-tomcat/release/v3.3/bin/win32/i386/isapi_redirect.zip.
- Put isapi_redirect.dll in %CATALINA_HOME%/bin.
- In %CATALINA_HOME%/conf/server.xml, uncomment the line:
<!--
<Connector className="org.apache.ajp.tomcat4.Ajp13Connector"
port="8009" minProcessors="5" maxProcessors="75"
acceptCount="10" debug="0"/>
-->
- If any other connector on port 8009 is uncommented – comment it out.
- In conf/server.xml just under the top-level <server …> node, add the node:
<Listener className="org.apache.ajp.tomcat4.config.IISConfig" />
- If Tomcat is running, shut it down.
- Start Tomcat.
- Delete the listener line from %CATALINA_HOME%/conf/server.xml.
- I put all of my IIS files in %CATALINA_HOME%/iis. The example here does not show that but to do that you need to:
- Copy workers.properties, uriworkermap.properties, and isapi_redirect.dll to %CATALINA_HOME%/iis.
- Edit %CATALINA_HOME%/conf/auto/iis_redirect.reg to the new file location.
- Set %CATALINA_HOME%/iis as the virtual directory for jakarta.
- Select %CATALINA_HOME%/iis/ isapi_redirect.dll as the filter.
- Run %CATALINA_HOME%/conf/auto/iis_redirect.reg.
- Create the file %CATALINA_HOME%/conf/jk/workers.properties file and in it type:
workers.java_home=C:\java\j2sdk1.4
workers.tomcat_home="C:\Program Files\Apache Group\Tomcat 4.1"
ps=\
worker.list=myworker
worker.myworker.type=ajp13
worker.myworker.port=8009
worker.myworker.host=localhost
- Start up the IIS manager and right click on Default Web Site and then select New, Virtual Directory. Press Next and you will get:
- Type in jakarta as the alias and press Next and you will get:
- Type in the directory where isapi_redirect.dll is and press Next and you will get:
- Uncheck Run Scripts and check Execute and press Next and then Finish.
- In IIS Manager, right click on the Default Web Site, Select Properties, then select the ISAPI Filters tab. Click the Add button.
- Fill out the dialog box with jakarta and the location of isapi_redirect.dll.
- Reboot your computer. (Yes shutting down and restarting IIS and Tomcat should be sufficient – but sometimes it isn’t.)
- Start IIS.
- Start Tomcat (this step is easy to forget).
- Go to http://localhost/examples/servlets/index.html. It should be the tomcat servlet examples page.
- If this doesn’t work, buy the book Professional Apache Tomcat and read chapter 14.