tomcat指定资源根目录

tomcat指定根目录

1.进入tomcat目录conf 中打开 serveer.xml
2.在Host 标签里面增加 (注意目录后面不带 / 哈,不然访问的时候会需要多写一次 /english)

<Context path="" docBase="/home/english" debug="0"/>

完整内容:

<Host name="localhost"  appBase="webapps"
            unpackWARs="true" autoDeploy="true">

        <!-- SingleSignOn valve, share authentication between web applications
             Documentation at: /docs/config/valve.html -->
        <!--
        <Valve className="org.apache.catalina.authenticator.SingleSignOn" />
        -->

        <!-- Access log processes all example.
             Documentation at: /docs/config/valve.html
             Note: The pattern used is equivalent to using pattern="common" -->
        <Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"
               prefix="localhost_access_log" suffix=".txt"
               pattern="%h %l %u %t &quot;%r&quot; %s %b" />

        <Context path="" docBase="/home/english" debug="0"/>
      </Host>

猜你喜欢

转载自blog.csdn.net/qq_24796239/article/details/125086769