Kit.Liao 荆棘鸟设计 www.kingkit.com.cn
荆棘鸟刚买了vps,环境都得自己搭建。由于服务器同时运行asp与jsp,所以必须整合IIS与TOMCAT。
环境:Windows 2003,JDK 1.6,IIS 6,TOMCAT6,isapi_redirect-1.2.14.exe
JDK,IIS,TOMCAT怎么安装我不多说了。在IIS,TOMCAT可以正常运行web应用的前提下,我们来用JK搭通IIS与TOMCAT的天地线!
1.TOMCAT新建一个名叫test的站点,启动TOMCAT,确保能运行该站点。
2.把isapi_redirect-1.2.14.exe安装,这个安装也很简单,一路NEXT就行。我的安装路径是:C:\Program Files\Apache Software Foundation\Jakarta Isapi Redirector
下面有这几个目录。
3. 右键“我的电脑”-->-管理->服务和应用程序-->Internet信息服务(IIS),右键点击默认站点的属性页面,选择ISAPI过滤器选项卡,看看有没名为Jakarta的Jakarta Isapi Redirector,如果没有的话,就添加一个筛选器,名为jakarta,可执行文件选择刚才我们安装好的Jakarta目录下的bin的isapi_redirector.dll,确定可用。
4.打开Jakarta Isapi Redirector安装目录下conf文件夹中的uriworkermap.properties,在其中添加一个你需要通过IIS运行的JSP站点的名称(该站点需要在TOMCAT下的webapps目录下,并运行良好),比如:该站点名称为test,则需要加入/test/*=wlb。
5.打开IIS管理端,点击WEB扩展服务,新建一个扩展服务,其名称建议为Jakarta,浏览Jakarta Isapi Redirector安装目录下的bin,选择isapi_redirect.dll。并允许这个服务的运行。
5.重启IIS(右键“我的电脑”-->-管理->服务和应用程序-->服务,找到IIS Admin,重新启动)
6.http://localhost/test/....
如果http://localhost:8080/test/....与http://localhost/test/....运行的结果一样,恭喜你!
如果有问题,也可参考一下这文章http://www.cflex.net/showFileDetails.cfm?ObjectID=296&Object=File&ChannelID=1
Connect IIS 6 to Tomcat 5
I needed to set up a simple distributed system consisting of an outward facing, secured IIS 6 web server and an internal, dedicated Flex server running under Tomcat 5. There is a lot of documentation out there but that in itself is a problem. It is difficult to know what really applies and what is out of date. I just successfully set up several such systems using the Tomcat <==> IIS connector. Following are the steps I took, and comments and tips about what I have learned.
Here is a link to the connector documentation index, if you want to do this the hard way:
http://jakarta.apache.org/tomcat/connectors-doc/
First the problem in a nutshell:
You can happily call your Flex applications from an IIS application (like ASP.NET) on an internal development system by using the host name (or IP address) and the port number. For example, in a custom wrapper this will work: http://myFlexServer:8080/flex/myApp/myFile.mxml. However, if you try to use that custom wrapper from outside the firewall, in other words, from the internet, you will find that port 8080, and most others, are blocked, and you cannot access your Flex application.
One solution is a "Jakarta Tomcat Connector", which directs calls to your Flex app through the IIS web server to the Flex/Tomcat server. You can do the same this with JRUN, and, I suspect, other J2EE servers as well. This connector allows you to use the IIS web server in the URL to the Flex app, without requiring any port specifications to gag the firewall. So the URL to a Flex app like in the example above becomes: http://www.myIISWebServer.com/flex/myApp/myFile.mxml.
How does a “connector” work? There are IIS and Tomcat parts. The Tomcat side is already set up for you in ...\Tomcat 5.0\conf\server.xml, whose job it is to create Tomcat "listeners" on specified ports. It sets up the normal listener on, for example, port 8080, but it also sets up a special listener on port 8009. In fact, if you have the Tomcat log level set to "Info" (the "Monitor Tomcat" menu/dialog, logging tab), you can look in the log: ...\Tomcat 5.0\logs\stdout.log, and see the line: "INFO: JK2: ajp13 listening on /0.0.0.0:8009"
But you can really just trust me, it is there.
On the IIS side, the connector works by using an "ISAPI" filter. This "filter" watches URL s for certain "contexts", and passes those contexts on to the specified handler dll. The simplest "context" is one of the folders under the Tomcat "webapps" folder. For example, /flex/, and /samples/ (yes, these are the folders you think) are Tomcat contexts in a default flex install.
Setting up IIS to use Tomcat connector
You actually have to do some work now, but not as much as you would think by reading the documentation.
Note: You want to be working with the “JK” connector, NOT the JK2 connector, which has been deprecated. Never mind that the log shows JK2, or that there is a jk2.properties file in the Tomcat\conf folder, and that a google search will turn up a lot of people still using JK2.
First, obtain the connector installer: isapi_redirect-1.2.14.exe It is available from several locations including:
http://www.devlib.org/apache/jakarta/tomcat-connectors/jk/binaries/win32/jk-1.2.14/
Now run the install. There does not appear to be any documentation for the installer, but here is a link to a document that describes the manual method of what the installer does, plus troubleshooting and general info, just FYI.
http://jakarta.apache.org/tomcat/connectors-doc/howto/iis.html
Briefly, the install creates a folder structure and adds a few files to it, sets some registry entries, creates an IIS virtual directory, adds the isapi_redirect.dll to the IIS website ISAPI filters tab. It should take care of all the steps listed in the above howto document under "Configuring the ISAPI Redirector".
Next add a Web Service Extension. This needs to be done manually because the install works for IIS 5 and 6, but “Web Service Extension” only applies to IIS 6.
· Open the … Administrative Tools, Internet Information Services console.
· In the tree on the left, click ” Web Service Extensions”
· In the right hand pane, click “Add a new Web Service Extension”
· For the Extension Name, enter: Jakarta Tomcat
· Click the “Add” button.
· Browse and select C:\Program Files\Apache Software Foundation\Jakarta Isapi Redirector\bin\isapi_redirector.dll
· Click the “Allow” button. DO NOT MISS THIS STEP!
· From the “Services” MMC, restart “IIS Admin”
Now, the install defaults to looking for a Tomcat listener on localhost. If your Tomcat is on a different server, as mine was, you will need to make a simple edit.
On the IIS web server, edit:
C:\Program Files\Apache Software Foundation\Jakarta Isapi Redirector\conf\workers.properties.minimal
Change the line that says:
worker.ajp13w.host=localhost
To:
worker.ajp13w.host=www.myIISWebServer.com
You can also use an IP address. I do not know if a machine name will work.
Restart IIS.
At this stage we can test the tomcat examples, using this URL :
http://www.myIISWebServer.com/jsp-examples/index.html
If it loads we are good to continue. If not, you will need to look at the troubleshooting section of the howto/iis.html document.
If we are good to continue, we will next add the flex “context”. The following assumes a default Flex install, with your application in:
...\Tomcat 5.0\webapps\flex
Adding the "flex" context:
On the IIS web server, edit:
C:\Program Files\Apache Software Foundation\Jakarta Isapi Redirector\conf\uriworkermap.properties
In the # [URL ]=[Worker name] section, add this line:
/flex/*=wlb
Save the file.
Restart IIS.
Finally, test the connector with Flex using an URL like this:
http://www.myIISWebServer.com/flex/myApp/myFile.mxml.
Security caveat:
In our setup, where the flex app was called from a custom wrapper in a tightly secured ASP.NET application, adding theconnector / isapi redirector had the consequence of breaking the security on the Flex app because it can be called directly from the web.
The ideal solution would have been for the Tomcat container’s authorization module to read the ASP.NET forms security token to permit access. Regretfully, I have not been able to make this work yet.
Tracy Spratt
相关推荐
WIN2003 iis6与tomcat6整合,搭建JSP运行环境
iis6与tomcat6整合配置说明文档,详细的用图文方式讲解iis6的jsp环境搭建
以前整理的一些整合资料,传上来!包括需要的DLL 与 注册表修改文件,具体的整合方法.
IIS6和Tomcat的整合
包含了所有整合所需的文档/工具,包括 jakarta-tomcat-connectors-jk2.0.4-win32-IIS.zip 修改版jk2.rar How To Configure IIS 7.0 and Tomcat with the JK 1.2 Connector How To Install Apache Tomcat with IIS ...
下载一个整合需要的文件isapi_redirect.dll 下载地址http://apache.justdn.org/tomcat/tomcat-connectors/jk/binaries/win32 在此我下载的是jk-1.2.23版本,以前有个人写了个教程下载的是jk-1.2.22里的,我看了...
详细描述了iis7.5与tomcat7的整合步奏和细节方法,url请求iis,通过jaraka拦截跳转tomcat
服务器配置 IIS6和Timcat6整合后伪静态页面处理问题
IIS和tomcat整合,适合从asp网站向jsp过渡,还想保留asp一些功能
win2003下iis6+tomcat6整合的一些所需文件及其配置步骤
自动整合IIS和tomcat 共用80端口的问题。用isapi_redirect.dll 手工配置很容易出错,改工具直接安装 ,选择需要整合TOMCAT的站点 就直接好用了!!!
tomcat6+IIS6 整合插件 直接安装版, 本插件是本人在浏览国外网站时所得.
一、整合环境:Windows Service 2008、JDK1.60、IIS7.0 和tomcat6.0 二、使用技术:IIS7.0和TOMCAT6.0的默认端口不用改变,使用原有的80和8080即可,采用isapi_redirect-1.2.26.dll文件作为iis和tomcat的接口,使用...
IIS6整合Tomcat5方案,花费了大量的时间去研究,终于研究透了。给大家分享下。
IIS与JSP整合TOMCAT,isapi_redirect下载
关于将IIS6和Tomcat整合的配置详细过程
详细介绍IIS6整合tomcat5.5 关于IIS整合tomat的文章网上有很多,不过总是因为配置过程太过繁锁,有一步出错,就配置不成功,经过不断的测试,终于成功整合iis6+tomat5.5,下面详细说一下配置的过程
windows2003 服务器上整合IIS6和Tomcat6
重启IIS6和Tomcat6。("我的电脑" - 右键 - 管理 - 服务和应用程序 - 服务 ,重新启动Tomcat6,重新启动IIS6.) 或者: 先运行net stop w3svc关闭IIS服务。 再运行net start w3svc重新启动IIS。 七、测试网站,在...
IIS6_Tomcat5_整合IIS共享80端口文档