linux下修改tomcat默认主页
生活随笔
收集整理的這篇文章主要介紹了
linux下修改tomcat默认主页
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
默認情況下我們輸入
http://localhost:8080/是跳轉到tomcat首頁的,首頁位置位于\webapps\ROOT下的index.html,有時候我們想輸入
?? ?<welcome-file>dwsc/wx/login.jsp</welcome-file>
??????? <welcome-file>index.html</welcome-file>
??????? <welcome-file>index.htm</welcome-file>
??????? <welcome-file>index.jsp</welcome-file>
?</welcome-file-list>
http://localhost:8080/直接調轉到我們的某個項目的登錄界面,那么要做如下兩個配置文件的修改
1.修改conf/server.xml
vi server.xml? 進入文本編輯
找到host節點 該節點一般位于server.xml末尾? 可以使用Ctrl+f進行翻頁
<Context docBase="/data/webapp/tomcat/webapps" path="" reloadable="false" debug="0">
</Context>
為防止項目中CSS,JS,JAR包引用錯誤.docBase只定位到項目的根目錄中
docBase的是你項目放在linux系統的目錄
2.修改tomcat的web.xml
web.xml 與server.xml 都在同一目錄下, 可直接使用 vi web.xml 直接進行編輯
<welcome-file-list> 一般位于末尾 可以使用Ctrl+f進行翻頁
在<welcome-file-list>加入你想要設置默認訪問項目的login.jsp
dwsc/wx是根目錄下的文件夾 與之前server.xml相結合
完整連接:/data/webapp/tomcat/webapps/dwsc/wx/login.jsp
就相當于tomcat訪問你完整連接下的login.jsp
<welcome-file-list>?? ?<welcome-file>dwsc/wx/login.jsp</welcome-file>
??????? <welcome-file>index.html</welcome-file>
??????? <welcome-file>index.htm</welcome-file>
??????? <welcome-file>index.jsp</welcome-file>
?</welcome-file-list>
總結
以上是生活随笔為你收集整理的linux下修改tomcat默认主页的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: win10开机出现D\WINDOWS\S
- 下一篇: bookxnote手机版_PDF电子书阅