參考資料web
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
首先經過./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>