首页 > Java技术栈 > tomcat多个端口对应多个web应用

tomcat多个端口对应多个web应用

2016年11月2日

tomcat多个端口对应多个web应用

http://www.cnblogs.com/killbug/archive/2013/01/23/2872473.html
<?xml version=’1.0′ encoding=’utf-8′?>

<Server port=”8005″ shutdown=”SHUTDOWN”>

<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>

<Service name=”Catalina”>
<Connector port=”7777″ protocol=”HTTP/1.1″
connectionTimeout=”20000″
redirectPort=”8443″ />
<Connector port=”8009″ protocol=”AJP/1.3″ redirectPort=”8443″ />
<Engine name=”Catalina” defaultHost=”localhost”>
<Realm className=”org.apache.catalina.realm.UserDatabaseRealm”
resourceName=”UserDatabase”/>
<Host name=”localhost” appBase=”webapps”
unpackWARs=”true” autoDeploy=”true”
xmlValidation=”false” xmlNamespaceAware=”false”>
</Host>
</Engine>
</Service>

<Service name=”Catalina2″>
<Connector port=”8002″ protocol=”HTTP/1.1″
connectionTimeout=”20000″
redirectPort=”8444″/>
<Connector port=”8010″ protocol=”AJP/1.3″ redirectPort=”8444″ URIEncoding=”UTF-8″ />

<Engine name=”Catalina2″ defaultHost=”localhost”>
<Realm className=”org.apache.catalina.realm.UserDatabaseRealm”
resourceName=”UserDatabase”/>
<Host name=”localhost” appBase=”webapps”
unpackWARs=”true” autoDeploy=”true”
xmlValidation=”false” xmlNamespaceAware=”false”>
<Context path=”” docBase=”system” />

</Host>
</Engine>
</Service>

</Server>
复制代码
重新复制一个service,改掉名字,端口,如上,测试成功。

还有一点需要数以的是:<Context path=”” docBase=”system” />

path不填就可以实现直接打入网址和端口就可以进入system引用啦。

分类: Java技术栈 标签:
本文的评论功能被关闭了.