tomcat 配置访问路径为/

时间:2022-11-09 20:04:40

   <Host name="ms"  appBase="webapps"
            unpackWARs="true" autoDeploy="true">
                        <Context path="" docBase="ms" debug="0" reloadable="true" crossContext="true"/>
        <Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"
               prefix="ms_access_log." suffix=".txt"
               pattern="%h %l %u %t &quot;%r&quot; %s %b" resolveHosts="false"/>
      </Host>
   <Host name="su"  appBase="webapps"
            unpackWARs="true" autoDeploy="true">
                        <Context path="" docBase="su" debug="0" reloadable="true" crossContext="true"/>
        <Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"
               prefix="su_access_log." suffix=".txt"
               pattern="%h %l %u %t &quot;%r&quot; %s %b" resolveHosts="false"/>
      </Host>

 

 

vi /etc/hosts,添加一行内容 服务器IP地址 主机名

vi /opt/apache-tomcat-6.0.29/conf/server.xml 找到以下内容 <Host name="techproj.xx.com" appBase="webapps" unpackWARs="true" autoDeploy="true" xmlValidation="false" xmlNamespaceAware="false">

将Host name的值更改为新服务器IP地址