I just followed the instruction on http://tomcat.apache.org/connectors-doc/reference/iis.html.
Installed one Tomcat 7 Instance, with all the default setting, then startup the instance by run “bin\startup.bat”
Download and Install the Mod_JK for IIS module from http://www.apache.org/dist/tomcat/tomcat-connectors/jk/binaries/, please pay attention if you are using the 64 bit windows ,please chose the 64 bit ISAP extension, otherwise IIS will ignore the extension.
then make worker.properties and uriworkermap.properties files. they are pretty simple. forward all the url like /docs to the tomcat help.
Since I am using IIS 7.5 ( the one comes with windows 7), I have to enable the IIS extension features. they are disabled by default.
after Done, Open the IIS manager, enable the ISAPI extension. (go to default site, Http Handlers mappings, Click add wildcard script map in the right action panel. )
then create one virtual directly called jakarta. and point to the directory that contains the isapi_redirect dll.
>>> this is important, later on we will config the registry to point the extension_url to /jakarta/isapi_redirect_xxx.dll
Now, fill out those defautl configurations in registry. you may just save and import the following setting, Change and apply your folder path.
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Apache Software Foundation\Jakarta Isapi Redirector\1.0]
then run “IISReset” to refresh the changes.
what happened under the Neath? then I open the redirect_log, here is the log I get.
I highlighted some parts, looks like the config did get picked up, the tomcat1 worker is right. the communication is good.
[Wed Aug 25 10:30:06.871 2010] [3868:5124] [debug] jk_set_time_fmt::jk_util.c (459): Pre-processed log time stamp format is '[%a %b %d %H:%M:%S.000 %Y] '
could not get a worker for name ajp13
that’s the error, from the log you can see the mapping is correct, from /docs to tomcat1. the request uri is /docs, that’s also correct. why it still pick up the ajp13 worker?
after I did a 3 hours research, the answer is pretty obvious.
Inside of the isapi_redirect-64.dll, there are two modules specific for IIS. they are
ISAPI extensions are true applications that run on IIS and have access to all of the functionality provided by IIS. As an example of how powerful ISAPI extensions can be, ASP pages are processed through an ISAPI extension called ASP.dll. In general, clients can access ISAPI extensions the same way they access a static HTML file or dynamic ASP file.
ISAPI extensions are implemented as DLLs that are loaded into a process that is controlled by IIS. Like ASP and HTML pages, IIS uses the virtual location of the DLL file in the file system to map the ISAPI extension into the URL namespace that is served by IIS.
Extensions and filters are the two types of applications that can be developed using ISAPI. An ISAPI extension runs when requested just like any other static HTML file or dynamic ASP file. Since ISAPI applications are compiled code, they are processed much faster than ASP files or files that call COM+ components.
ISAPI filters are DLL files that can be used to modify and enhance the functionality provided by IIS. ISAPI filters always run on an IIS server, filtering every request until they find one they need to process. The ability to examine and modify both incoming and outgoing streams of data makes ISAPI filters powerful and flexible.
Filters are registered at either the site level or the global level (that is, global filters apply to all sites on the IIS server), and are initialized when the worker process is started. A filter listens to all requests to the site on which it is installed.
when you execute one link like /jakarta/isapi_redirect-64.dll, this is called Extension. there is one method called HttpExtensionProc. Inside this method, it runs the logic of Mapping, say ,from /tomcat to tomcat1 worker1. this part is OK.
the second part, we need the ISAPI Filter Module which will be hit for every request to run the redirect logic, also it contains the mapping ( say from /tomcat1 to our extension dll /jakarta/isapi_redirect-64.dll) , this piece is missing.
what we have to do is open the ISAPI Filter Add-in in IIS. import this filter.