Dee*_*low 57 port tomcat tomcat6
目前我在Tomcat 6上运行了2个web应用程序app1和app2:
我想配置Tomcat,以便它们在不同端口后面的根上下文中运行:
需要做什么?
小智 57
我想你可以在server.xml文件中配置它并放入2个服务:
<Service name="app1">
<Connector port="8081" protocol="org.apache.coyote.http11.Http11NioProtocol"
connectionTimeout="20000"
redirectPort="8443" />
<Engine name="Catalina" defaultHost="localhost">
<Host name="localhost" appBase="app1"
unpackWARs="true" autoDeploy="true">
</Host>
</Engine>
</Service>
<Service name="app2">
<Connector port="8082" protocol="org.apache.coyote.http11.Http11NioProtocol"
connectionTimeout="20000"
redirectPort="8443" />
<Engine name="Catalina" defaultHost="localhost">
<Host name="localhost" appBase="app2"
unpackWARs="true" autoDeploy="true">
</Host>
</Engine>
</Service>
Run Code Online (Sandbox Code Playgroud)
添加连接器的另一个例子:
<Service name="reciver">
<Connector port="8080" maxHttpHeaderSize="8192" maxThreads="10"
enableLookups="false" acceptCount="100"
connectionTimeout="10000" disableUploadTimeout="true"
useBodyEncodingForURI="true"/>
<Engine name="reciver" defaultHost="localhost" jvmRoute="host1">
<Realm className="org.apache.catalina.realm.UserDatabaseRealm"
resourceName="UserDatabase" />
<Host name="localhost" appBase="webapps" unpackWARs="true"
autoDeploy="false" xmlValidation="false"
xmlNamespaceAware="false">
<Context docBase="browser" path="/browser" reloadable="false"/>
</Host>
</Engine>
</Service>
<Service name="reciver2">
<Connector port="8081" maxHttpHeaderSize="8192" maxThreads="10"
enableLookups="false" acceptCount="1"
connectionTimeout="10000" disableUploadTimeout="true"
useBodyEncodingForURI="true" proxyName="example.pt" proxyPort="80"/>
<Engine name="reciver2" defaultHost="example_app" jvmRoute="host2">
<Host name="example_app" appBase="test_app/example_app" unpackWARs="true"
autoDeploy="false" xmlValidation="false"
xmlNamespaceAware="false">
<Context docBase="example_app" path="/example_app" reloadable="false"/>
</Host>
</Engine>
</Service>
(...Repeted 2 more times.)
Run Code Online (Sandbox Code Playgroud)
取自:http://www.coderanch.com/t/84172/Tomcat/listen-multiple-ports
我建议阅读整个主题,因为它讨论了使用此配置的性能命中,以及可能的竞争条件.
| 归档时间: |
|
| 查看次数: |
73975 次 |
| 最近记录: |