第一步,点击这里下载jk2 connector,解压到{Tomcat_Home}/conf/connector 目录下
第二步,打开IIS控制台,选择网站属性,ISAPI筛选器->添加,名称添加jakarta,执行文件找到isapi_redirector2.dll确定;增加一名为jakarta的虚拟路径指向{Tomcat_Home}/conf/connector,设置为“脚本和可执行文件”
第三步,编辑workers2.properties文件内容可能如下
[shm]
# 修改成向对应你的路径
file=d:/Tomcat/logs/jk2.log
size=1048576
# Example socket channel, override port and host.
[channel.socket:localhost:8009]
# 这里对应Server.xml里面定义的端口
# 如果是默认设置不要更改
port=8009
host=127.0.0.1
# define the worker
[ajp13:reynir_net:8009]
channel=channel.socket:localhost:8009
# Uri mapping
# 映射路径
# 这里是Tomcat下面的路径映射到IIS的方法
# 需要把哪个目录放到IIS下就要写几个
[uri:/*.jsp]
[uri:/jsp-examples/*]
[uri:/my/*]
worker=ajp13:localhost:8009
# define the worker
[status:status]
# Uri mapping
[uri:/jkstatus/*]
worker=status:status
第四步,编辑isapi_redirect.2.0.reg文件,内容可能如下
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Apache Software Foundation\Jakarta Isapi Redirector]
[HKEY_LOCAL_MACHINE\SOFTWARE\Apache Software Foundation\Jakarta Isapi Redirector\2.0]
“serverRoot”=”d:\\Tomcat”
“extensionUri”=”/jakarta/isapi_redirector2.dll”
“workersFile”=”d:\\Tomcat\\conf\\connector\\workers2.properties”
“logLevel”=”DEBUG”
几个路径改成相对应你的系统下的路径
第五步,在IIS下添加虚拟目录,比如指向”D:\Tomcat\webapps\jsp-examples”(添加的这个路径必须在workers2.properties里面的映射定义过),路径名为”jsp-examples”
最后,重启tomcat和IIS(要重启整个www服务),ok现在访问 “http://localhost/jsp-examples”看看是不是出来了
