1)安裝
在此之前要安裝 好jdk和jre
下載綠色版
解壓至:D:\Program Files (x86)\tomcat9
環境變更path添加兩個值 :
新建一個系統變量:CLASSPATH,其值新增一項
cmd里執行安裝服務:
安裝: D:\Program Files (x86)\tomcat9\bin>service.bat install
刪除服務:D:\Program Files (x86)\tomcat9\bin>service.bat uninstall
把服務設置成自動啟動
2)配置
1.更改默認端口
配置文件server.xml里找到
2.把項目放在不同目錄,不是放在tomcat的webapps目錄配置
在server.xml的host節點添加
<Context path="/crm" docBase="E:/study/java/crm/WebContent"/>,使用htpp://localhost:8080/crm就可以訪問到
3.配置默認文檔
web.xml里找到相關下面代碼
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
<welcome-file>index.html</welcome-file>
<welcome-file>index.htm</welcome-file>
</welcome-file-list>