Jeff's Personal Weblog

Friday, January 02, 2009

Setting up 64-bit Tomcat 6 on IIS7

Download the latest Tomcat binaries for Win64 (AMD64 or x64)
  1. Download Tomcat binaries (Windows Service Installer) from http://tomcat.apache.org/download-60.cgi

    NOTE: It appears the latest Tomcat Service Installer now supports 64 bit so the below files may no longer be needed
  2. Download 64 bit Tomcat Native binaries from http://tomcat.apache.org/download-native.cgi
  3. Download 64 bit versions of tomcat6.exe and tomcat6w.exe from http://svn.apache.org/viewvc/tomcat/tc6.0.x/tags/TOMCAT_6_0_20/res/procrun/
    (replace the 6_0_20 to reflect the version you downloaded in step 1
  4. Download 64 bit Isapi_Redirector.dll from http://tomcat.apache.org/download-connectors.cgi
Install Tomcat

NOTE: It appears the Tomcat Service Installer now supports a 64 bit installation. A typical Tomcat install should work (I haven't tried it), in which case you can skip to the Configure Tomcat section below.
  1. Run normal 32 bit Tomcat install but install as if it were a 64 bit install. Install to "Program Files" and not "Program Files (x86)". Alternately, you can install to a different location completely (ex: "C:\Tomcat"). Make sure to point Tomcat to a 64 bit JRE.
  2. If you chose to install "Tomcat Native" in the above step, replace tomcat native dll's (found in tomcat's bin directory) with 64 bit versions
  3. Replace tomcat6.exe and tomcat6w.exe (found in tomcat's bin directory) with 64 bit versions
  4. If copied from another computer, unblock the exe's (Properties -> Unblock)
  5. Allow tomcat6w.exe to run as Administrator
Configure Tomcat
  1. Set up server.xml
  2. Set up context.xml
  3. Set up isapi_redirect.properties, workers.properties, and uriworkermap.properties (see http://tomcat.apache.org/connectors-doc/reference/iis.html)
Configure IIS 7
  1. Open IIS 7 Manager
  2. Navigate to your host.
  3. Double click on the ISAPI and CGI Restrictions icon
  4. On the right hand panel, click Add...
  5. Point the path to your isapi_redirect.dll file and give it a description eg. tomcat
  6. Check "Allow extension path to execute"
  7. Now, click on the Default Website and navigate to ISAPI Filters.
  8. On the right hand panel, click on Add... and point to your isapi_redirect.dll file, give the filter a name (eg. tomcat)
  9. Navigate to your Default Website again
  10. Add a virtual directory and name it jakarta, point this to the directory containing isapi_redirect.dll
  11. Click on the newly created virtual directory jakarta
  12. Navigate into Handler Mappings, on the right hand side you will see a panel called Actions. Click on Edit Feature Permissions and tick the execute permission.
  13. Finally, navigate to your host context again and do a restart.

Labels: