配置如下:
<Host name="www.icoolxue.com" appBase="webapps/tutorial"
unpackWARs="true" autoDeploy="true">
<Context path="" docBase="tutorial" reloadable="true" crossContext="true"/>
<!-- SingleSignOn valve, share authentication between web applications
Documentation at: /docs/config/valve.html -->
<!--
<Valve className="org.apache.catalina.authenticator.SingleSignOn" />
-->
<!-- Access log processes all example.
Documentation at: /docs/config/valve.html
Note: The pattern used is equivalent to using pattern="common" -->
<Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"
prefix="tutorial_access_log." suffix=".txt"
pattern="%h %l %u %t "%r" %s %b" />
</Host>
解释:
appBase="webapps/tutorial":对应的路径一定是想要直接访问的项目路径(tomcat的相对路劲);
docBase="tutorial":对应的是项目的路径(尽量写绝对路径)。
其他注意事项
端口:80