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

    zjtest7-app:/usr/local/apache-tomcat-7.0.55_8082/logs# netstat -nap | grep 8082
    tcp        0      0 :::8082                     :::*                        LISTEN      14642/java          
    zjtest7-app:/usr/local/apache-tomcat-7.0.55_8082/logs# 
    zjtest7-app:/usr/local/apache-tomcat-7.0.55_8082/logs# ps -ef | grep java
    root     14642     1 91 14:15 pts/0    00:00:10 /usr/java/jdk1.8.0_20/bin/java -Djava.util.logging.config.file=/usr/local/apache-tomcat-7.0.55_8082/conf/logging.properties -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Xms215m -Xmx215m -Djava.rmi.server.hostname=192.168.32.73 -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=10054 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false -Djava.endorsed.dirs=/usr/local/apache-tomcat-7.0.55_8082/endorsed -classpath /usr/local/apache-tomcat-7.0.55_8082/bin/bootstrap.jar:/usr/local/apache-tomcat-7.0.55_8082/bin/tomcat-juli.jar -Dcatalina.base=/usr/local/apache-tomcat-7.0.55_8082 -Dcatalina.home=/usr/local/apache-tomcat-7.0.55_8082 -Djava.io.tmpdir=/usr/local/apache-tomcat-7.0.55_8082/temp org.apache.catalina.startup.Bootstrap start
    root     14668 14486  0 14:15 pts/0    00:00:00 grep java
    zjtest7-app:/usr/local/apache-tomcat-7.0.55_8082/logs# 
    
    zjtest7-app:/usr/local/apache-tomcat-7.0.55_8082/conf# tail -20 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 "%r" %s %b" />
                   <Context docBase="/t/deploy/zjtest7/deployedApps/zjzc-web-api" path="/api" reloadable="false"/>
          </Host>
        </Engine>
      </Service>
    </Server>
    
    
    
    测试:
    
    zjtest7-app:/t/deploy/zjtest7/deployedApps/zjzc-web-api# curl http://192.168.32.73: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</h2>
    </body>
    </html>
    
    zjtest7-app:/t/deploy/zjtest7/deployedApps/zjzc-web-api# curl http://192.168.32.73:8082
    zjtest7-app:/t/deploy/zjtest7/deployedApps/zjzc-web-api# curl http://192.168.32.73:8082
    zjtest7-app:/t/deploy/zjtest7/deployedApps/zjzc-web-api# 
    
    
    
    修改server.xml:
    
    zjtest7-app:/t/deploy/zjtest7/deployedApps/zjzc-web-api# curl http://192.168.32.73:8082/api
    zjtest7-app:/t/deploy/zjtest7/deployedApps/zjzc-web-api# curl http://192.168.32.73:8082
    <!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</h2>
    </body>
    </html>
    
    
    
    
    path 决定了你访问方式

  • 相关阅读:
    邻居子系统 之 更新neigh_update
    邻居子系统 之 邻居项查找neigh_lookup、___neigh_lookup_noref
    遍历集合的方法总结
    Java集合中List,Set以及Map等集合体系
    八大数据结构分类
    servlet和jsp的区别
    Web前端和Web后端的区分
    (转)为什么JavaWeb放弃jsp,去做前后端分离
    面向对象的三大基本特征和五大基本原则
    (转)2019年给Java编程初学者的建议(附学习大纲)
  • 原文地址:https://www.cnblogs.com/hzcya1995/p/13350613.html
Copyright © 2011-2022 走看看