路径IIS6.0 tomcat6.0 JK整合(8080端口和80端口共用jsp网站)

80端口  时间:2021-01-31  阅读:()

经过这么久IIS和tomcat整合实践积累了部分经验。从一开始整合项目需要放到tomcat的webapps下面而且必须需要tomcat里面ROOT的index.html的跳转到现在的可以把项目放在服务器的任何地方上而也不需要index.html只需要项目本身的index. jsp就能够进行访问。总的来说还是有一定提高。现将IIS6.0和tomcat6.0的完美整合整理如下

一、整合环境 Windows Service 2003、 JDK1.60、 IIS7.0和tomcat6.0

二、使用技术 I IS6.0和TOMCAT6.0的默认端口不用改变使用原有的80和8080即可采用isapi_redirect-1.2.27.dll文件作为iis和tomcat的接口使用http://www. zhonghuiheat.com就能访问tomcat中的jsp网站。

三、操作步骤

说明我的项目是放在E盘下名字为zhdr我的域名www. zhonghuiheat.com是和服务器绑定的在外网上输入http://www. zhonghuiheat.com:8080是可以访问到网站的输入http://www. zhonghuiheat.com:8080/zhdr是可以访问网站的。

1、下载isapi_redirect-版本号.dll文件作为IIS与TOMCAT的接口我下载的是i sapi_redirect-1.2.27.dl l然后将文件放在${TOMCAT_HOME}/conf下。

2、使用记事本建立如下.reg文件保存并执行

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Apache Software Foundation\Jakarta IsapiRedirector\1.0]

"log_file"="e://Program Files//Apache Software Foundation//Tomcat

6.0//logs"

"log_level"="info"

"worker_file"="e://Program Files//Apache Software Foundation//Tomcat

6.0//conf//workers.properties"

"worker_mount_file"="e://Program Files//Apache SoftwareFoundation//Tomcat 6.0//conf//uriworkermap.properties"

"extension_uri"="/jakarta/isapi_redirect-1.2.27.dll"

注意修改与tomcat相关的路径一定要设置成为自己tomcat的路径。

3、在tomcat/conf下建立两个文件

文件1 workers.properties

#worker. tomcat_home=E://Program Files//Apache SoftwareFoundation//Tomcat 6.0

#worker. java_home=C:\Program Files\Java\jdk1.6.0_13ps=\

#工作站的名称任意但须注意前后一致多个工作站以“, ”分割worker. list=ajp13w

#工作站的类型 ajp13是IIS与Tomcat通讯协议的名称worker.ajp13w. type=ajp13

#注意此处的host需要与主机或者设置域名的名称一致worker.ajp13w.host=www. zhonghuiheat.com#(当有多个WEB站点多个域名绑定此处设置还需研究)

#worker.ajp13w.host=localhost

# ajp13协议的通讯端口worker.ajp13w.port=8009

#负载因子worker.worker1. lbfactor=1

文件2 uriworkermap.properties

#当前域名下上下文路径为. jsp, .do的请求转发给ajp13w工作站处理/*. jsp=ajp13w

/*.do=ajp13w

#当前域名下的所有请求都转发给ajp13w工作站处理

/*=ajp13w # 此处一定要这么改才能使用域名直接访问网站而不需要跳转

#当前域名下所有. jsp的请求都转发给ajp13w工作站处理

# /*. jsp

#当前域名下除了.html的请求其他都转发给ajp13w工作站处理

# !/*.html

Tomcat中的server.xml需要修改

<?xml version=' 1.0' encoding='utf-8'?>

<!--

Licensed to the Apache Software Foundation (ASF) under one or morecontributor license agreements. See the NOTICE file distributed withthis work for additional information regarding copyright ownership.The ASF licenses this file to Youunder the Apache License, Version 2.0(the "License") ; you may not use this file except in compliance withthe License. You may obtain a copy of the License athttp://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, softwaredistributed under the License is distributed on an "AS IS" BASIS,WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.See the License for the specific language governing permissions andlimitations under the License.

-->

<!-- Note: A "Server" is not itself a "Container", so you may notdefine subcomponents such as "Valves" at this level.

Documentation at /docs/config/server.html

-->

<Server port="8005" shutdown="SHUTDOWN">

<!--APR library loader. Documentation at /docs/apr.html --><Listener className="org.apache.catalina.core.AprLifecycleListener"

SSLEngine="on" />

<!--Initialize Jasper prior to webapps are loaded. Documentation at/docs/jasper-howto.html -->

<Listener className="org.apache.catalina.core.JasperListener" />

<!-- JMX Support for the Tomcat server. Documentation at/docs/non-existent.html -->

<ListenerclassName="org.apache.catalina.mbeans.ServerLifecycleListener" />

<ListenerclassName="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" />

<!-- Global JNDI resources

Documentation at /docs/jndi-resources-howto.html

-->

<GlobalNamingResources>

<!-- Editable user database that can also be used by

UserDatabaseRealm to authenticate users

-->

<Resource name="UserDatabase" auth="Container"type="org.apache.catalina.UserDatabase"description="User database that can be updated and saved"factory="org.apache.catalina.users.MemoryUserDatabaseFactory"pathname="conf/tomcat-users.xml" />

</GlobalNamingResources>

<!--A"Service" is a collection of one or more "Connectors" that sharea single "Container" Note: A "Service" is not itself a,so you may not define subcomponents such as "Valves"at this level.

Documentation at /docs/config/service.html

-->

<Service name="Catalina">

<!--The connectors can use a shared executor, you can define one ormore named thread pools-->

<!--

<Executor name="tomcatThreadPool" namePrefix="catalina-exec-"maxThreads="150" minSpareThreads="4"/>

-->

<!-- A "Connector" represents an endpoint by which requests are

receivedand responses are returned. Documentation at :

Java HTTP Connector: /docs/config/http.html (blocking &non-blocking)

Java AJP Connector: /docs/config/ajp.html

APR (HTTP/AJP) Connector: /docs/apr.html

Define a non-SSL HTTP/1. 1 Connector on port 8080

-->

<Connector port="8080" protocol="HTTP/1. 1"connectionTimeout="20000"redirectPort="8443" />

<!-- A "Connector" using the shared thread pool-->

<!--

<Connector executor="tomcatThreadPool"port="8080" protocol="HTTP/1. 1"connectionTimeout="20000"redirectPort="8443" />

-->

<!-- Define a SSL HTTP/1. 1 Connector on port 8443

This connector uses the JSSE configuration, when using APR, theconnector should be using the OpenSSL style configurationdescribed in the APR documentation -->

<!--

<Connector port="8443" protocol="HTTP/1. 1" SSLEnabled="true"maxThreads="150" scheme="https" secure="true"clientAuth="false" sslProtocol="TLS" />

-->

<!-- Define an AJP 1.3 Connector on port 8009 -->

<Connector port="8009" protocol="AJP/1.3" redirectPort="8443" /><!-- An Engine represents the entry point (within Catalina) thatprocessesevery request. The Engine implementation for Tomcat standaloneanalyzes the HTTP headers included with the request, and passesthemon to the appropriate Host (virtual host) .

Documentation at /docs/config/engine.html -->

<!-- You should set jvmRoute to support load-balancing via AJP ie :<Engine name="Standalone" defaultHost="localhost" jvmRoute="jvm1">-->

<Engine name="Catalina" defaultHost="localhost">

<!--For clustering, please take a look at documentation at:

/docs/cluster-howto.html (simple how to)

/docs/config/cluster.html (reference documentation) -->

<!--

<ClusterclassName="org.apache.catalina.ha. tcp.SimpleTcpCluster"/>

-->

<!-- The request dumper valve dumps useful debugging informationaboutthe request and response data received and sent by Tomcat.

Documentation at: /docs/config/valve.html -->

<!--

<ValveclassName="org.apache.catalina.valves.RequestDumperValve"/>

-->

<!--This Realmuses the UserDatabase configured in the global JNDIresources under the key "UserDatabase". Any editsthat are performed against this UserDatabase are immediatelyavailable for use by the Realm. -->

<Realm className="org.apache.catalina.realm.UserDatabaseRealm"resourceName="UserDatabase"/>

<!-- Define the default virtual host

Note: XML Schema validation will not work with Xerces 2.2.

-->

<Host name="localhost" appBase="webapps"unpackWARs="true" autoDeploy="true"xmlValidation="false" xmlNamespaceAware="false">

<!-- SingleSignOn valve, share authentication between webapplications

Documentation at: /docs/config/valve.html -->

<!--

<ValveclassName="org.apache.catalina.authenticator.SingleSignOn" />

-->

<!-- Access log processes all example.

Documentation at: /docs/config/valve.html -->

<!--

<Valve className="org.apache.catalina.valves.AccessLogValve"directory="logs"prefix="localhost_access_log. " suffix=". txt"pattern="common" resolveHosts="false"/>

-->

<Context path="" docBase="E:\zhdr\" />

<Context path="/zhdr" docBase="E:\zhdr\" debug="5"reloadable="true" crossContext="true"/>

</Host>

</Engine>

</Service>

</Server>

图 配置文件位置

三、 IIS建站

1、在IIS中建站zhonghui,并将主机头设置成www. zhonghuiheat.com;将路径设置为tomcat的webapps下的ROOT 位置无所谓并如图勾选以下执行权限。

图 建站

图 建站

2 、 并在网站 zhonghui 下新建虚拟目录 并将路径设置为isapi_redirect-1.2.27.dll所在的路径。

3、在IIS 的web扩展中添加一个名为 jakarta 的扩展 路径指向

isapi_redirect-1.2.27.dll,并将其设置为允许。 (一定要扩展否者配置后将不能成功)

图 配置web扩展

4、在IIS管理器中右键zhonghui网站点击属性在右面中的“ISAPI和CGI限制”里面右键添加isapi_redirect-1.2.27.dll,并设定“允许执行扩展路径” 描述名可取jakarta

图 ISAPI和CGI限制配置jakarta

图 ISAPI和CGI限制配置jakarta

5、右键虚拟目录 点击属性在配置里面添加.do和. jsp 目录都指向isapi_redirect-1.2.27.dll 目录用引号括起否则会出错。

Bluehost美国虚拟主机2.95美元/月,十八周年庆年付赠送顶级域名和SSL证书

Bluehost怎么样,Bluehost好不好,Bluehost成立十八周年全场虚拟主机优惠促销活动开始,购买12个月赠送主流域名和SSL证书,Bluehost是老牌虚拟主机商家了,有需要虚拟主机的朋友赶紧入手吧,活动时间:美国MST时间7月6日中午12:00到8月13日晚上11:59。Bluehost成立于2003年,主营WordPress托管、虚拟主机、VPS主机、专用服务器业务。Blueho...

Sharktech云服务器35折年付33美元起,2G内存/40G硬盘/4TB流量/多机房可选

Sharktech又称SK或者鲨鱼机房,是一家主打高防产品的国外商家,成立于2003年,提供的产品包括独立服务器租用、VPS云服务器等,自营机房在美国洛杉矶、丹佛、芝加哥和荷兰阿姆斯特丹等。之前我们经常分享商家提供的独立服务器产品,近期主机商针对云虚拟服务器(CVS)提供优惠码,优惠后XS套餐年付最低仅33.39美元起,支持使用支付宝、PayPal、信用卡等付款方式。下面以XS套餐为例,分享产品配...

HostNamaste$24 /年,美国独立日VPS优惠/1核1G/30GB/1Gbps不限流量/可选达拉斯和纽约机房/免费Windows系统/

HostNamaste是一家成立于2016年3月的印度IDC商家,目前有美国洛杉矶、达拉斯、杰克逊维尔、法国鲁贝、俄罗斯莫斯科、印度孟买、加拿大魁北克机房。其中洛杉矶是Quadranet也就是我们常说的QN机房(也有CC机房,可发工单让客服改机房);达拉斯是ColoCrossing也就是我们常说的CC机房;杰克逊维尔和法国鲁贝是OVH的高防机房。采用主流的OpenVZ和KVM架构,支持ipv6,免...

80端口为你推荐
2017年双11销售额2018年双十一(11.11)淘宝天猫一天的交易额能突破2500亿吗?少儿英语哪个好少儿英语哪个好电视直播软件哪个好目前最好的电视直播软件是什么?电视直播软件哪个好电视直播软件哪个好手机音乐播放器哪个好手机音乐播放器哪个好红茶和绿茶哪个好红茶和绿茶哪个比较好?清理手机垃圾软件哪个好什么手机清理软件最好?网页qq空间登录网页查看qq空间qq空间登录界面我的手机QQ打开应该是九个选项,什么空间,但是现在打开怎么直接是QQ登录界面,这个撇手机willyunlee最近开了007系列的第20部电影《择日再死》,看不懂剧情,不知说什么。谁能说给我听,谢谢。
花生壳域名 主机测评 香港vps99idc 安云加速器 火车票抢票攻略 万网优惠券 免费网络电视 嘟牛 dd444 100m空间 免费申请网站 美国网站服务器 如何安装服务器系统 新世界服务器 登陆空间 网页提速 上海电信测速网站 美国盐湖城 秒杀品 工信部网站备案查询 更多