采用不同端口,配置多个应用方法、
1 修改tomcat conf目录下的server配置文件
增加一个service节点,节点中的端口与原service端口不一致即可。
<Service name="Catalina1">
<Connector connectionTimeout="20000" port="8090" protocol="HTTP/1.1" redirectPort="8444"/>
<!-- Define an AJP 1.3 Connector on port 8009 -->
<Connector port="8010" protocol="AJP/1.3" redirectPort="8444"/>
<Engine defaultHost="localhost" name="Catalina1">
<Realm className="org.apache.catalina.realm.LockOutRealm">
<Realm className="org.apache.catalina.realm.UserDatabaseRealm" resourceName="UserDatabase"/>
</Realm>
<Host appBase="webapps1" autoDeploy="true" name="localhost" unpackWARs="true">
<Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs" pattern="%h %l %u %t "%r" %s %b" prefix="localhost_access_log" suffix=".txt"/>
<Context docBase="D:\tool\apache-tomcat-8.0.53-tesiro\webapps1\tesiro" path="/tesiro" reloadable="true" source="org.eclipse.jst.jee.server:tesiro"/></Host>
</Engine>
</Service>
2 修改应用下web.xml
修改webAppRootKey的值,该值可以自定义。保持各个应用中此值不一致即可。
<context-param>
<param-name>webAppRootKey</param-name>
<param-value>lakecloud.root1</param-value>
</context-param>