1、将要同时启动的项目放入不同的webapps文件夹中
2、修改tomcat安装目录下的conf-->server.xml文件,在文件的最后面添加以下内容
<!-- 第二个项目,webapps1,端口号8081 再修改redirectPort:8444、 appBase="webapps1" --> <Service name="Catalina"> <Connector port="8081" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8444" /> <Engine name="Catalina" defaultHost="localhost"> <Realm className="org.apache.catalina.realm.LockOutRealm"> <Realm className="org.apache.catalina.realm.UserDatabaseRealm" resourceName="UserDatabase"/> </Realm> <Host name="localhost" appBase="webapps1" unpackWARs="true" autoDeploy="true"> <Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs" prefix="localhost_access_log." suffix=".txt" pattern="%h %l %u %t "%r" %s %b" /> </Host> </Engine> </Service> <!-- 第三个项目,webapps2,端口号8082 再修改redirectPort:8445、 appBase="webapps2" --> <Service name="Catalina"> <Connector port="8082" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8445" /> <Engine name="Catalina" defaultHost="localhost"> <Realm className="org.apache.catalina.realm.LockOutRealm"> <Realm className="org.apache.catalina.realm.UserDatabaseRealm" resourceName="UserDatabase"/> </Realm> <Host name="localhost" appBase="webapps2" unpackWARs="true" autoDeploy="true"> <Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs" prefix="localhost_access_log." suffix=".txt" pattern="%h %l %u %t "%r" %s %b" /> </Host> </Engine> </Service>