zoukankan      html  css  js  c++  java
  • tomcat 设置path 访问路径

    v-lhb-app01:/usr/local/apache-tomcat-7.0.55_8083/conf> cat server.xml | tail -10
                 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 "%r" %s %b" />
    		<Context docBase="zjzc-web-pay" path="" reloadable="false"/>
          </Host>
        </Engine>
      </Service>
    </Server>
    
    
    
    v-lhb-app01:/usr/local/apache-tomcat-7.0.55_8083/webapps/zjzc-web-pay> cat index.html 
    <html>
    <body>
    <h2>Hello 22222-2aaaaaaaaaa--zjzc-pay-aaaaaaaaa!</h2>
    </body>
    </html>
    
    
    
    </html>v-lhb-app01:/usr/local/apache-tomcat-7.0.55_8083/webapps> ls
    1  docs  examples  host-manager  index.html  manager  zjzc-web-pay  zjzc-web-pay.zip
    
    
    根目录下有个Index.html  应用目录下 也有Index.html 所以会进去到zjzc-web-pay去查找 index.html 
    
    
    可以通过访问:
    http://192.168.32.113/
    
    这里的path没有指定:
    
    v-lhb-app01:/usr/local/apache-tomcat-7.0.55_8083/conf> tail -10 server.xml
                 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 "%r" %s %b" />
    		<Context docBase="zjzc-web-pay" path="/api" reloadable="false"/>
          </Host>
        </Engine>
      </Service>
    </Server>
    
    
    设置path为/api:
    
    
    http://192.168.32.113/api/ 可以访问:
    
    此时http://192.168.32.113/ 无法访问
    
    
    

  • 相关阅读:
    [Poi2000]病毒
    [Zjoi2015]诸神眷顾的幻想乡
    P1663 山
    P1837 单人纸牌
    P6584 重拳出击
    CF460C Present
    10.5 学习笔记
    多项式学习笔记(一) FFT
    NOIP 2020 游记
    uva 经典习题选做(dp专项)
  • 原文地址:https://www.cnblogs.com/hzcya1995/p/13351711.html
Copyright © 2011-2022 走看看