tomcat修改默认主页, 前段项目放到tomcat下,浏览器输入ip加端口后,直接到项目主页

1,将 项目 放到 tomcat 的webapps 文件夹下

2, 修改conf 下的 server.xml , 找到 

<Host name="localhost" appBase="webapps"
unpackWARs="true" autoDeploy="true">

在 Host 标签 下加入 

<Context docBase="project/myProject" path="" reloadable="true" debug="0" privileged="true">
</Context>

-------   project/myProject  是前段项目 index.html 所在的文件夹位置

3, 如果 你的 前段 项目 ,主页 不叫 index.html , 修改 conf 下的 web.xml

<welcome-file-list>
<welcome-file>index.html</welcome-file>
<welcome-file>index.htm</welcome-file>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>


猜你喜欢

转载自www.cnblogs.com/angdh/p/10987738.html