--1.tomcat7默认的
<Service name="Catalina">
<Connector connectionTimeout="20000" port="8080" protocol="HTTP/1.1" redirectPort="8443"/>
<Connector port="8009" protocol="AJP/1.3" redirectPort="8443"/>
<Engine defaultHost="localhost" name="Catalina">
<Realm className="org.apache.catalina.realm.LockOutRealm">
<Realm className="org.apache.catalina.realm.UserDatabaseRealm" resourceName="UserDatabase"/>
</Realm>
<Host appBase="webapps" 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="F:\tomcat\apache-tomcat-7.0.88\wtpwebapps\Test1" path="/Test1" reloadable="true" source="org.eclipse.jst.jee.server:Test1"/></Host>
</Engine>
</Service>
--2 配置的在不同文件夹下不同端口的不同项目
<Service name="Catalina2">
<Connector connectionTimeout="20000" port="80" protocol="HTTP/1.1" redirectPort="8443" />
<Connector port="8010" protocol="AJP/1.3" redirectPort="8443" />
<Engine defaultHost="localhost" name="Catalina2">
<Realm className="org.apache.catalina.realm.UserDatabaseRealm" resourceName="UserDatabase"/>
<Host appBase="webapps2" autoDeploy="true" name="localhost" unpackWARs="true" xmlNamespaceAware="false" xmlValidation="false">
<Context path="/test2" reloadable="true" docBase="/home/xb/tomcat7/webapps2/项目名称"></Context>
<Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"
prefix="localhost_access_log2_" suffix=".txt"
pattern="%h %l %u %t "%r" %s %b" />
</Host>
</Engine>
</Service>
来源:https://www.cnblogs.com/xielinjiang/p/9150056.html