tomcat设置访问路径与实际路径

2020-12-07 15:42:34 浏览数 (1)

tomcat访问地址修改指向实际路径,修改server.xml。

在host标签下添加contest标签

代码语言:javascript复制
<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" -->
              <Context path="/*****" docBase="./ui" />
        <Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"
               prefix="localhost_access_log." suffix=".txt"
               pattern="%h %l %u %t "%r" %s %b" />

      </Host>

访问时直接端口号/path中填的文字即可。

0 人点赞