<b>Windows 2003下Tomcat 5.5 整合IIS 6.0</b>[服务器安全]
本文“<b>Windows 2003下Tomcat 5.5 整合IIS 6.0</b>[服务器安全]”是由七道奇为您精心收集,来源于网络转载,文章版权归文章作者所有,本站不对其观点以及内容做任何评价,请读者自行判断,以下是其具体内容:
环境:Windows 2003 R2 + IIS 6.0 + JDK 1.5+TOMCAT5.5
1. 安装tomcat
2. 下载jk
http://archive.apache.org/dist/tomcat/tomcat-connectors/jk/binaries/win32/jk-1.2.14/isapi_redirect-1.2.14.exe
安装的好处就是配置文件都有了.只需做少量改正:
安装目录可以随便(最好让目录不带空格),安装完成后在conf里就是它的配置文件,安装完后找到目录文件\Apache Software Foundation\Jakarta Isapi Redirector 这个可以按照你自己的窜改,在conf文件里把workers.properties.minimal它改成
workers.properties,对应找到注册表里的
HKEY_LOCAL_MACHINE\SOFTWARE\Apache Software Foundation\Jakarta Isapi Redirector\1.0] 中的worker_file 点右键改正
一样去掉workers.properties.minimal 后的minimal.
3. 以下为两个文件的内容
uriworkermap.properties:
# Mapping the URI /admin, /manager, /jsp-examples and /servlets-examples and
# everything under them to Tomcat
# /admin/*=ajp3
# /manager/*=ajp13
# /jsp-examples/*=ajp13
# /servlets-examples/*=ajp13
# Mapping all URI which end with a common suffix .jsp and .do to Tomcat
# /*.jsp=ajp13
# /*.do=ajp13
# Mapping all URI to Tomcat
/*=ajp13
worker.properties:
worker.list=ajp13
worker.ajp13.type=ajp13
worker.ajp13.host=localhost
worker.ajp13.port=8009
4. 在iis里新建一个站点,指向网站所在的目录(比方$CATALINA_HOME\webapps\ROOT),然后在站点上点右键选“属性”,在弹出的页框里挑选“ISAPI挑选器”,点“增添”,挑选器名称填jakarta,可履行文件中填入你的isapi_redirector.dll的绝对途径.“肯定”后点“肯定”关闭属性页.再在“默许网站”上右键,挑选“新建”->“虚拟目录”,别名填jakarta,下一步,途径选为你的isapi_redirector.dll存放的目录.
5. 在“Internet信息服务管理器”的“网站”中的“Web服务扩大”上点右键挑选“增添一个新的Web服务扩大”,弹出的框中扩大名填Tomcat(其实无所谓的),“要求的文件”选“增添”然后找到你的isapi_redirector.dll后“肯定”.“设置扩大状况为答应”也打上勾,肯定.
6. 假如要让iis能读取index.jsp这样的jsp默许首页,还需求在IIS6.0右键单击【默许网站】,挑选【属性】,单击【主目录】选项卡中的【配置】,单击【映射】选项卡,单击【增添】,将isapi_redirector.dll的全途径写进去,扩大名要写.jsp(注意:假如你的途径包含空格,那么你需求将这个完好途径用英文的双引号括起来才能增添).
到这里就配置完了
7. 重起tomcat 重启iis 去掉端口后看看能运行了吧
总结:
说到底,这就是两种服务的一种集成,使之外部看起来像一种服务,可以这么理解:
外部拜候域名-->解析后到IP-->IIS查找呼应站点-->发现jsp文件-->转至jk衔接处理-->将呼应文件注释转给Tomcat-->将页面返回给IIS-->展示给客户端.
那么哪出了问题,就查哪,一步一步来,一定能成功的,但愿对大家有所帮忙,别的多看官方手册,多想此中的原理,网上传播的各种文档不一定就是精确的,包含本文,只是尽大概细致的给一种指导.
System Requirements
For this installation I used the following:
Windows Server 2003 Enterprise Edition
Internet Information Services (IIS) 6.0
Sun Java Runtime JRE 5.0 Update 2
Apache Jakarta Tomcat version 5.5.9
The JK Tomcat Web Server Connectors
1. Install the JDK and Tomcat and set the environment variable.
2. Configure JK
Download JK from http://archive.apache.org/dist/tomcat/tomcat-connectors/jk/binaries/win32/jk-1.2.14/isapi_redirect-1.2.14.exe
Setup the file. (It’s better that there isn’t blank space in the directory which you choose to install.)
After installing it, you could find the file “workers.properties.minimal” in \Apache Software Foundation\Jakarta Isapi Redirector, and change its name to “workers.properties”.
Open the Registry Editor; Open the “HKEY_LOCAL_MACHINE\SOFTWARE\Apache Software Foundation\Jakarta Isapi Redirector\1.0]”
Change the value “workers.properties.minimal”of worker_file to “workers.properties”
The content of worker.properties and uriworkermap.properties is follow:
worker.properties:
worker.list=ajp13
worker.ajp13.type=ajp13
worker.ajp13.host=localhost
worker.ajp13.port=8009
uriworkermap.properties:
# Mapping the URI /admin, /manager, /jsp-examples and /servlets-examples and
# everything under them to Tomcat
# /admin/*=ajp3
# /manager/*=ajp13
# /jsp-examples/*=ajp13
# /servlets-examples/*=ajp13
# Mapping all URI which end with a common suffix .jsp and .do to Tomcat
# /*.jsp=ajp13
# /*.do=ajp13
# Mapping all URI to Tomcat
/*=ajp13
3. Create a new website in IIS which point to your website (such as $CATALINA_HOME\ webapps\ROOT)
4. Configure the Tomcat ISAPI Filter
Rigth click your websiteàPropertiesàISAPI FiltersàAddàset Filter name “jakarta” and Executable choose the path of “isapi_redirector.dll”àOK
Note – If you check on its status, you may notice that the ISAPI filter hasn’t been successfully loaded at this stage, even if you have re-started IIS. This is expected behaviour and is documented in the IIS6 Operations Guide,
“In an effort to optimize resources in IIS 6.0, an ISAPI filter is not loaded until a request is made to a Web site that requires the ISAPI filter. Until this request is made, IIS Manager does not display the status of the ISAPI filter.”
http://www.microsoft.com/technet/prodtechnol/WindowsServer2003/Library/IIS/93f23233-2a47-4104-b0b4-a7ec0d3116f3.mspx
However, once IIS has served a successful request to it you will see the status of the ISAPI filter change to ‘Loaded’.
5. Create a virtual directory for the Tomcat connector to use, create a new Web Service Extension in IIS and then enable that web service extension so that it can be used.
Rigth click your websiteàNewàVirtual Directoryàset Alias: jakartaàNextàset Path: choose the path of “isapi_redirector.dll”.
6. Create and exable the tomcat Web Service Extension
Rigth click “Web Service Extension” à Add a new Web service extension àSet name: Tomcat, set Required files:choose your “isapi_redirector.dll”à click the “Set extension status to Allowed”àOK
7. Add the “.jsp”
Rigth click your websiteàPropertiesàHome DirectoryàMappingsàAddàset Executable: choose your “isapi_redirector.dll”, set Extension: .jsp (Note: if there is blank space in your path, you need to make your path in Double quotes.)
8. Set index.jsp as default content page
Rigth click your websiteàPropertiesàDocumentàAdd–>index.jsp
10. Restart tomcat and IIS. You should now be ready to test your Tomcat installation by issuing a request to the sample applications. Visit http://localhost
If show the page as http://localhost:8080, you’re successful.
以上是“<b>Windows 2003下Tomcat 5.5 整合IIS 6.0</b>[服务器安全]”的内容,如果你对以上该文章内容感兴趣,你可以看看七道奇为您推荐以下文章:
本文地址: | 与您的QQ/BBS好友分享! |