IIS6.0+Tomcat7.0整合总结(推荐)

2019-10-18 15:22:04于海丽

2)        【文档】:-->添加-->【默认内容页】:比如index.jsp(对应网站默认首页) -->确定-->把其余的都删掉
ü  Web服务扩展-->右键-->添加一个新的Web服务扩展:【扩展名】:jakarta(必须)
【要求的文件】: isapi_redirect安装目录binisapi_redirect.dll (isapi_redirect.dll文件)
勾选【设置扩展状态为允许】保存

(七)   isapi_redirect的配置

打开isapi_redirect目录下conf目录,修改uriworkermap.properties文件,该文件的具体内容如下:
# uriworkermap.properties - IIS
#
# This file provides sample mappings for example wlb
# worker defined in workermap.properties.minimal
# The general syntax for this file is:
# [URL]=[Worker name]
 
/admin/*=wlb
/manager/*=wlb
/jsp-examples/*=wlb
/servlets-examples/*=wlb
/ecshoping/*=wlb
 
# Optionally filter out all .jpeg files inside that context
# For no mapping the url has to start with exclamation (!)
 
!/servlets-examples/*.jpeg=wlb
 
#
# Mount jkstatus to /jkmanager
# For production servers you will need to
# secure the access to the /jkmanager url
#
/jkmanager=jkstatus
/*.jsp=wlb
/*.action=wlb
/*.do=wlb
/*=wlb 
 
解释:wlb可理解为过滤器名称

/*.jsp等等 为请求过滤的规则,isapi_redirect判断当iis收到该请求时交给tomcat处理。/ecshoping/*=wlb  指定你要过滤的项目
打开isapi_redirect目录下conf目录,修改workers.properties.minimal文件,该文件的内入如下:
# workers.properties.minimal -
#
# This file provides minimal jk configuration properties needed to
# connect to Tomcat.
#
# The workers that jk should create and work with
#
 
worker.list=wlb,jkstatus
 
#
# Defining a worker named ajp13w and of type ajp13
# Note that the name and the type do not have to match.
#
worker.ajp13w.type=ajp13
worker.ajp13w.host=localhost
worker.ajp13w.port=8009
 
#
# Defining a load balancer

 
worker.wlb.type=lb
worker.wlb.balance_workers=ajp13w
 
#
# Define status worker
#
 
worker.jkstatus.type=status
 
该文件为默认的配置,一般不需要修改,保证跟以上一致就行
到此为止你可以倒杯咖啡来享受一下整合成功的喜悦了。此时你输入你的域名就可以直接访问你的javaweb项目了,而不用再加8080端口了。当iis接受到一个jsp网站isapi_redirect会转发到tomcat处理,然后将处理结果再返回给客户。