修改Tomcat預設訪問根目錄
阿新 • • 發佈:2018-11-05
Tomcat安裝後,Tomcat的主目錄是webapps/root目錄。
在conf資料夾下面找到server.xml 配置檔案開啟
在<hosts> ......</hosts>中間新增一行
<Context path="" docBase="/usr/tomcat/apache-tomcat-8.5.11/webapps/guanwang" debug="0" reloadable="true"/>
docBase即為預設訪問的資料夾名稱。
- <Context docBase="D:/Tomcat 8.0/webapps/guanwang" path="" debug="0" reloadable="true"/>
Tomcat預設訪問目錄就是webapps/guanwang檔案夾了,Linux與Windows配置一樣,只是資料夾地址有差別。
我在guanwang資料夾下面上傳了一個文字檔案,可以直接訪問其內容。
1.訪問guanwang資料夾下面的video-list.html(見上圖)
2.訪問guanwang資料夾下面的文字檔案sohubiz_verify.txt
--------------------- 本文來自 小王瑞丶 的CSDN 部落格 ,全文地址請點選:https://blog.csdn.net/axela30w/article/details/76546735?utm_source=copy