对tomcat server.xml进行修改
<!—第一个域名—>
<Host name="www.test1.com" appBase="webapps"
unpackWARs="true" autoDeploy="true">
<Context docBase="项目名称1" path="" reloadable="false" ></Context>
<Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"
prefix="localhost_access_log." suffix=".txt"
pattern="%h %l %u %t "%r" %s %b" />
</Host>
<!—第二个域名—>
<Host name=" www.test2.com " appBase="webapps"
unpackWARs="true" autoDeploy="true">
<Context docBase="项目名称2" path="" reloadable="false" ></Context>
<Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"
prefix="localhost_access_log." suffix=".txt"
pattern="%h %l %u %t "%r" %s %b" />
</Host>
<!—第一个域名—>
<Host name="www.test1.com" appBase="webapps"
unpackWARs="true" autoDeploy="true">
<Context docBase="项目名称1" path="" reloadable="false" ></Context>
<Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"
prefix="localhost_access_log." suffix=".txt"
pattern="%h %l %u %t "%r" %s %b" />
</Host>
<!—第二个域名—>
<Host name=" www.test2.com " appBase="webapps"
unpackWARs="true" autoDeploy="true">
<Context docBase="项目名称2" path="" reloadable="false" ></Context>
<Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"
prefix="localhost_access_log." suffix=".txt"
pattern="%h %l %u %t "%r" %s %b" />
</Host>