zoukankan      html  css  js  c++  java
  • tomcat path配置

    <pre name="code" class="html">demo:/root# curl http://192.168.32.42:8082/api/
    <!DOCTYPE html><!--STATUS OK-->
    <html><head>
    <title>用户管理</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <script type="text/javascript" src="/common/js/jquery/jquery-1.11.1.min.js"></script>
    </head>
    <body>
    <h2>Welcome Scan</h2>
    </body>
    </html>
    
    
    
    https://www.zjtest4.com/api/
    
    也是返回 
    Welcome Scan
    
    
    
    
    
    修改配置:
        <Context docBase="/t/deploy/zjtest4/deployedApps/zjzc-web-api" path="/" reloadable="false"/>
    
    或者 
     <Context docBase="/t/deploy/zjtest4/deployedApps/zjzc-web-api" path="" reloadable="false"/>
    
    
    http://192.168.32.42:8082/api
    
    此时访问不到
    
    需要:
    http://192.168.32.42:8082/
    
    
    
    https://www.zjtest4.com/api/
    也访问不到
    
    
    
    继续修改:
    
    
    
    
    
     <Context docBase="/t/deploy/zjtest4/deployedApps/zjzc-web-api" path="/" reloadable="false"/>
    
    
    app01:/usr/local/apache-tomcat-7.0.55_8082/conf> ls -ltr /t/deploy/zjtest4/deployedApps/zjzc-web-api
    total 5
    -rwxrwxrwx 1 root root 2090 May  7 13:42 test.html
    drwxrwxrwx 1 root root    0 May 16 10:58 common
    drwxrwxrwx 1 root root    0 May 16 10:58 WEB-INF
    drwxrwxrwx 1 root root    0 May 16 10:58 META-INF
    -rwxrwxrwx 1 root root  292 Aug  9 16:27 index.html
    drwxrwxrwx 1 root root    0 Aug  9 16:49 api
    
    
    多创建一个api目录
    
    
    这样通过:
    
    http://192.168.32.42:8082/
    
    https://www.zjtest4.com/api/
    
    
    都可以访问


    
                                        
    
  • 相关阅读:
    c#结构体、打他table、excel、csv互转
    WPF 自定义图表(柱状图,曲线图)
    NemaStudio船舶模拟软件下载及破解
    点双连通分量
    HDU4612 Warm up
    边双连通分量
    [Jsoi2010]连通数
    Intern Day73
    Intern Day72
    Intern Day70
  • 原文地址:https://www.cnblogs.com/hzcya1995/p/13350422.html
Copyright © 2011-2022 走看看