tomcat 除去项目名访问+去端口访问+多项目配置,

除去项目名访问:

  在tomcat\cof\server.xml中 <Host>标签下加上如下代码:

  <Context path="" docBase="/项目名" debug="0" reloadable="true"/>

除去端口访问:

  <Connector>标签中 port="8080" 改成-->port=“80”

多项目配置:

  <Host name="127.0.0.1"  appBase="webapps"
            unpackWARs="true" autoDeploy="true"
            xmlValidation="false" xmlNamespaceAware="false">
        <Context path="" docBase="/项目名1" debug="0" reloadable="true"/>
      </Host>

  <Host name="localhost"  appBase="webapps"
            unpackWARs="true" autoDeploy="true"
            xmlValidation="false" xmlNamespaceAware="false">
        <Context path="" docBase="/项目名2" debug="0" reloadable="true"/>
      </Host>

  访问项目1方式:http://127.0.0.1:8080

  访问项目2方式:http://localhost:8080

 

posted @ 2016-07-29 16:04  Moka<TI  阅读(213)  评论(0编辑  收藏  举报