Tomcat静态文件访问配置

tomcat访问服务器资源

修改server.xml文件

添加

  <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 docBase="/home/ceshi/" path="/file" />
      </Host>

posted @ 2022-08-24 09:44  窃窃私语QAQ  阅读(235)  评论(0编辑  收藏  举报