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/ 无法访问
    
    
    

  • 相关阅读:
    排序算法——快速排序
    ArrayDeque源码解析
    PriorityQueue源码解析
    HashMap源码解析
    LinkedList源码解析
    ArrayList源码解析
    获取Spring容器管理的Bean工具类
    使用Google zxing生成二维码
    解决:SpringCloud中Feign支持GET请求POJO传参
    MySQL8.0 Unable to load authentication plugin 'caching_sha2_password'
  • 原文地址:https://www.cnblogs.com/hzcya1995/p/13351711.html
Copyright © 2011-2022 走看看