localhost 在C:\WINDOWS\system32\drivers\etc\hosts中定义的


apache+tomcat不需要加端口号直接项目名称访问


Tomcat 不敲入项目名称 访问项目 转载

第一种:server.xml
   <Host name="localhost" debug="0" appBase="webapps"
       unpackWARs="true" 
       xmlValidation="false" xmlNamespaceAware="false">
        <Context path="" docBase="train_zh" debug="0" reloadable="true"/>

第二种:server.xml
 <Host name="localhost" debug="0" appBase=""
       unpackWARs="true" 
       xmlValidation="false" xmlNamespaceAware="false">
C:\Program Files\Apache Software Foundation\Tomcat5.0\conf\Catalina\localhost
删除所有文件 新建 项目名称.xml
<!--
    Context configuration file for the Tomcat Administration Web App
    $Id: admin.xml,v 1.3 2004/02/20 17:09:19 remm Exp $
-->

<Context path="" docBase="${catalina.home}/webapps/train_zh"
        debug="0" privileged="true">
  <!-- Uncomment this Valve to limit access to the Admin app to localhost
   for obvious security reasons. Allow may be a comma-separated list of
   hosts (or even regular expressions).
  <Valve className="org.apache.catalina.valves.RemoteAddrValve"
    allow="127.0.0.1"/>
  -->
  <Logger className="org.apache.catalina.logger.FileLogger"
             prefix="localhost_admin_log." suffix=".txt"
          timestamp="true"/>
</Context>