1. 程式人生 > >tomcat部署專案如何去掉專案名稱

tomcat部署專案如何去掉專案名稱

直接在server.xml中<Host></Host>間加了一句<Context path="" docBase="/test" debug="0" reloadable="true"/>,其中docBase="/test"中的/test是專案名字


把專案放到tomcat7\webapps下面

修改Host

<Host name="www.test.com"  debug="0" appBase="webapps" unpackWARs="true" autoDeploy="true" xmlValidation="false" xmlNamespaceAware="false"> 

<Context path="/" docBase="/test"  debug="0" reloadable="true"></Context> 

</Host> 

這樣就可以通過域名www.test.cn訪問test為專案名的專案了。

如果主機中繫結多個域名,直接加host即可。