First the easy part, download the Jakarta Tomcat connector, JK1. Run the installer. Add the isapi_redirect.dll to Web Service Extensions in the IIS manager. Make sure the ISAPI redirector was added to the IIS website you plan to use for hosting your Tomcat redirection.
That's the easy part, you'll find those sorts of instructions on just about any old HOWTO going for JK1. Doing that much will probably get you running your Tomcat web apps at localhost. Here's the parts no one seems to discuss but you'd better know if you want to do more than permanently host your web apps on your DEV box...
- You don't need a connector running at all on port 8080 or 80 or whatever port you were running Tomcat on before IIS came into the picture. Edit server.xml and comment this out. While you're at it, make sure that the AJP connector XML is not commented out.
- Further down server.xml is a node for declaring your default web host resist the urge to change this to your new domain name. It is not necessary to move your Tomcat host becuase IIS will be answering calls to your domain name, not Tomcat.
- The whole point of getting IIS to help process requests for Tomcat is to run alternate websites on a different platform, this means telling IIS which domains point to your Tomcat service and using a different website for your non-Tomcat websites. This is done by adding host header names to your IIS website definitions, try this link http://www.no-ip.com/support/guides/web_servers/virtual_hosting_iis.html for more info.
- Mysteriously, to run JK1 through root you don't add a /ROOT/*=wlb definition uriworkermap.properties instead you add: /*=wlb which is not what you're in the habit of doing when running Tomcat applications at the root of the website.
In these early days I can also tell you that you need to keep your localhost folder in
{TOMCAT_HOME}\conf\Catalina and maintiain all your webapp context files in there, especially if you're using Hibernate, which I simply cannot make understand to look anywhere but localhost for MySQL database connections. That being said, if you want a website that's going to be visible from your domain name hosted in IIS, you'll need to have a new subfolder in
{TOMCAT_HOME}\conf\Catalina that matches your new domain name that contains copies of the context files in localhost, otherwise you'll get "BAD REQUEST" errors when attempting to access your Tomcat app through the new domain name.
This is early days so far. Some of this information will likely change as I get more familiar with the platform but with any luck if you stumple upon this blog you'll get enough info from it to fill in the gaps left behind by the dozens of web pages I looked at.
Tags: iis, tomcat, jakarta, apache, java, installation