localhost直接访问项目配置

访问http://localhost/
之前只知道给个跳转就可以实现,但多一步跳转肯定增加响应时间,直线路不走,走弯路?不明智!
 修改tomcat\conf\server.xml配置
1,端口号改成80
<Connector port=" 80" protocol="HTTP/1.1"
               connectionTimeout="20000"
               redirectPort="8443" />
2,在 <Host name="localhost" appBase="webapps"></Host> 里加上
 <Context path="" docBase=" D:\apache-tomcat-6.0.35\webapps\xx" debug="0" reloadable="true" /> 
docBase为项目所放的地址,其中 xx为项目名
     <Host name="localhost" appBase="webapps" 
            unpackWARs="true" autoDeploy="true"
            xmlValidation="false" xmlNamespaceAware="false">
   <Context path="" docBase="D:\apache-tomcat-6.0.35\webapps\xx" debug="0" reloadable="true" />
      </Host>
这样就ok了~

猜你喜欢

转载自blog.csdn.net/liqimo1799/article/details/17402977