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
相关推荐
将IIS6与Tomcat 6整合,可以实现混合环境下的Web服务,使开发者能够利用.NET Framework的强大力量,同时运行基于Java的Web应用。 整合过程主要包括以下几个关键步骤: 1. **安装和配置Tomcat 6**:首先,下载并...
### IIS6与Tomcat6整合知识点详解 #### 一、背景介绍 在Windows Server 2003环境中,为了实现动态网页应用的部署,尤其是Java Web应用的部署,经常需要将IIS (Internet Information Services) 与 Tomcat 进行整合。...
整合IIS6与Tomcat6的主要目的是利用IIS的管理和静态内容服务功能,同时让Tomcat处理动态的JSP内容。以下是一步一步的配置过程: 1. **安装准备**:确保系统已经安装了IIS6和Tomcat6。Tomcat需要配置为Windows服务...
《IIS6与Tomcat6整合中的伪静态页面处理》 在互联网应用中,服务器配置的优化对于提升用户体验和网站性能至关重要。本文将深入探讨如何在IIS6和Tomcat6整合环境中解决伪静态页面处理的问题。IIS(Internet ...
5. **下载和安装ISAPI Redirector**: IIS6与Tomcat整合的关键组件,它允许IIS将特定的URL请求转发给Tomcat处理。可以从Apache官方网站获取。 6. **配置ISAPI Redirector**: 安装后,在IIS6管理控制台中,选择需要...
包含了所有整合所需的文档/工具,包括 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 ...
【IIS7.5与Tomcat7整合】的目的是在一个服务器上同时运行这两个服务,使得IIS能够处理静态内容,而动态内容(如Java JSP)由Tomcat处理。这通常是为了利用IIS的高性能和易管理性以及Tomcat对Java应用的良好支持。 *...
下载一个整合需要的文件isapi_redirect.dll 下载地址http://apache.justdn.org/tomcat/tomcat-connectors/jk/binaries/win32 在此我下载的是jk-1.2.23版本,以前有个人写了个教程下载的是jk-1.2.22里的,我看了...
### IIS与Tomcat整合详解 #### 一、前言 在Web开发领域,IIS (Internet Information Services) 和 Tomcat 分别是处理静态资源(如HTML、CSS、JavaScript等)和服务Java应用的重要服务器软件。随着业务的发展和技术...
### Windows2003下完美配置整合IIS 6+JDK... - 如果一切正常,则说明IIS与Tomcat整合成功。 通过以上步骤,我们可以在Windows 2003环境下成功配置IIS 6、JDK 1.6和Tomcat 6,搭建出一个功能完善的Java应用服务器平台。
**IIS6与Tomcat6.0整合教程** 在互联网应用开发中,有时我们需要将静态内容服务(如HTML、CSS、JavaScript等)与动态内容服务(如Java Web应用)结合在一起,这时IIS6(Internet Information Services 6.0)与...
《IIS6.0与Tomcat6.0的整合配置详解》 在互联网服务领域,IIS(Internet Information Services)和Tomcat都是重要的服务器软件。IIS是微软提供的一个全面的Web服务器解决方案,而Tomcat则是一个开源的、基于Java的...
- "IIS+Tomcat整合所需文件"这个压缩包中应该包含用于整合的配置文件和工具,如`JK.iis6.dll`(IIS到Tomcat的连接器)和相关的配置脚本。 3. **配置IIS** - 配置ISAPI扩展:将`JK.iis6.dll`添加为IIS的ISAPI扩展...
【IIS整合Tomcat工具】是一个实用的软件解决方案,旨在简化在Windows服务器上将Internet Information Services (IIS) 与Apache Tomcat集成的过程。通常,IIS作为一个强大的Web服务器处理静态内容,而Tomcat作为应用...
描述中提到的"isapi_redirect下载",是指IIS与Tomcat整合过程中需要用到的一个关键组件——ISAPI Redirector。ISAPI(Internet Server Application Programming Interface)是微软为IIS提供的扩展接口,ISAPI ...
【IIS6与Tomcat5.5整合详解】 在IT领域,有时我们需要将Web服务器(如IIS)与应用服务器(如Tomcat)整合,以便更好地处理动态内容和静态资源的分发。本文将详细讲解如何在Windows环境中,具体是IIS6与Tomcat5.5的...
"IIS整合多个Tomcat"是一个常见的需求,特别是在大型企业或高流量网站中,为了提高可用性和负载均衡,通常会使用多个应用服务器。IIS(Internet Information Services)是微软提供的一个强大的Web服务器,而Tomcat则...
在本文中,我们将探讨如何成功地整合IIS7.0和Tomcat6.0,以实现Windows Server 2008环境下JSP应用的部署。整合这两种服务的主要目的是利用IIS作为前端Web服务器,处理静态内容,而将动态内容如JSP交给Tomcat处理。 ...
在IIS和Tomcat整合中,我们需要对这个文件进行适当修改,比如添加AJP或HTTP Connector,以使两者能相互通信。 **vm**:这个文件名可能是不完整的,但它可能是指Java虚拟机(JVM)的配置,比如`jvm.options`,用于...