[tomcat] tomcat配置路径映射

tomcat配置路径映射

在server.xml中的Host节点下加入Context节点。其中path为URL路径,docBase为磁盘路径。

      <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="/file" reloadable="true" docBase="h://files"/>

      </Host>

猜你喜欢

转载自blog.csdn.net/eternally123/article/details/79971333