900字范文,内容丰富有趣,生活中的好帮手!
900字范文 > linux下修改tomcat默认访问主页

linux下修改tomcat默认访问主页

时间:2018-09-04 22:58:18

相关推荐

linux下修改tomcat默认访问主页

默认情况下我们输入  http://localhost:8080/是跳转到tomcat首页的,首页位置位于\webapps\ROOT下的index.html,有时候我们想输入 

http://localhost:8080/直接调转到我们的某个项目的登录界面,那么要做如下两个配置文件的修改

1.修改conf/server.xml

搜索"appBase="webapps""字符,定位到host节点,在host节点之间最后面加上

<Context docBase="/data/webapp/tomcat/webapps/ask/" path="" reloadable="false" debug="0">

</Context>

docBase的是你项目放在linux系统的目录

2.修改tomcat的web.xml

在<welcome-file-list>加入你想要设置默认访问项目的login.jsp

<welcome-file-list>

<welcome-file>index.html</welcome-file>

<welcome-file>index.htm</welcome-file>

<welcome-file>index.jsp</welcome-file>

<welcome-file>login.jsp</welcome-file>

</welcome-file-list>

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。