1、配置多个项目
在tomcat的conf目录下,找到server.xml,在其中添加<Host>节点即可进行多个项目的部署
<Host name="localhost" appBase="webapps" 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" /> <Context docBase="uim" path="" /> </Host> <Host name="www.ycyoes.com" appBase="hcode" 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" /> <Context docBase="hcode" path="" /> </Host>
2、配置域名访问
在server.xml中<Host>节点的name属性输入域名即可,如: