tomcat docBase 和 path

		<Context docBase="zjzc-web-api" path="/api" reloadable="false"/>

    1.修改<Host>的appBase为自己的实际开发目录,如appBase="d:/test"
      2.紧接<Host>的后面,添加:<context docBase="/" path="" reloadable="true" debug="0"></context>,docBase是指相对于appBase而言,它既

可以是相对路径,也可以是绝对路径,在这里我将它指定为"/",即位于"d:/test"下,path="",表示访问的时候直接用localhost即可,不必添加任何其它

路径,当然也可以把它设置为一个名字(可随便命名),访问时就可以使用本名字进行访问.


该web应用的文档基准目录(Document Base,也称为Context Root),或者是WAR文件的路径。可以使用绝对路径,也可以使用相对于context所属的

Host的appBase路径。


docbase是web应用和本地路径,path是tomcat访问这个应用的URL路径。


10.168.102.19 - - [09/Dec/2016:21:22:26 +0800] "POST /api/client/info HTTP/1.1" 200 482 0.062  121.40.238.78
10.168.102.19 - - [09/Dec/2016:21:22:27 +0800] "POST /api/client/holdinglistbyuser HTTP/1.1" 200 4625 0.152  120.26.75.177
10.168.255.134 - - [09/Dec/2016:21:22:27 +0800] "POST /api/notice/list HTTP/1.1" 200 28886 0.162  121.40.238.78
10.168.102.19 - - [09/Dec/2016:21:22:57 +0800] "POST /api/common/getdate HTTP/1.1" 200 171 0.046  121.40.238.78
10.168.255.134 - - [09/Dec/2016:21:22:58 +0800] "POST /api/news/index/list HTTP/1.1" 200 63 0.051  120.26.75.177
10.168.255.134 - - [09/Dec/2016:21:22:58 +0800] "POST /api/auctioncommon/npa/list HTTP/1.1" 200 142 0.067  120.26.75.177
10.168.102.19 - - [09/Dec/2016:21:22:58 +0800] "POST /api/news/list_new_page HTTP/1.1" 200 24161 0.074  121.40.238.78
10.168.102.19 - - [09/Dec/2016:21:22:59 +0800] "POST /api/index/basicdata HTTP/1.1" 200 118 0.076  121.40.238.78
10.168.102.19 - - [09/Dec/2016:21:24:19 +0800] "POST /api/common/getdate HTTP/1.1" 200 171 0.057  120.26.75.177
10.168.255.134 - - [09/Dec/2016:21:24:19 +0800] "POST /api/product/list HTTP/1.1" 200 5364 0.160  121.40.238.78
10.168.255.134 - - [09/Dec/2016:21:24:19 +0800] "POST /api/wze/user/wzeUserInfo HTTP/1.1" 200 62 0.116  120.26.75.177


api01:/usr/local/apache-tomcat-7.0.55_8082/webapps> cd zjzc-web-api
api01:/usr/local/apache-tomcat-7.0.55_8082/webapps/zjzc-web-api> ls
index.html                 manual_1480579979196.html  manual_1480988020607.html  manual_1480993231061.html  

manual_1481251530133.html  test.html     WEB-INF
manual_1480562090655.html  manual_1480659542284.html  manual_1480988329608.html  manual_1481078979827.html  META-INF                

   velocity.log  zjzc-web-api-1.1.17.war
api01:/usr/local/apache-tomcat-7.0.55_8082/webapps/zjzc-web-api> pwd
/usr/local/apache-tomcat-7.0.55_8082/webapps/zjzc-web-api

posted @ 2016-12-09 21:33  czcb  阅读(642)  评论(0编辑  收藏  举报