tomcat(7.0或8.0)默認訪問路徑設置

參考資料web

  1. First shutdown your Tomcat from the its bin directory (sh shutdown.sh). Then delete all the content of your Tomcat webapps folder (rm -fr *). Then rename your WAR file to ROOT.war, and finally start your Tomcat from the bin directory (sh startup.sh).tomcat

  2. 首先經過./shutdown腳本關閉tomcat,而後刪除掉tomcat中webapps目錄下全部的文件夾 必定要刪除ROOT目錄 ,不要把war包放到webapps文件夾下,可放到一個新建的目錄下如project,以避免重複部署。而後在$CATALINA_HOME/conf/Catalina/localhost路徑下,新建ROOT.xml文件,輸入context節點。(固然也能夠直接在server.xml節點下更改,但不推薦這麼作) ROOT.xml示例:app

<?xml version="1.0" encoding="UTF-8"?>
<Context docBase="/usr/local/tomcat-omp/project/omp-1.0.0-SNAPSHOT.war" reloadable="true"></Context>
相關文章
相關標籤/搜索