1.直接访问ip:端口就可以访问到指定的工程
在tomcat的conf文件下找到server.xml文件
在<Host appBase="webapps" autoDeploy="true" name="localhost" unpackWARs="true">下增加
<Context path="" debug="0" docBase="proj" reloadable="true"/>
proj为你的工程名称
2.打开默认网页
在tomcat的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>
</web-app>
增加一个 <welcome-file>demo.jsp</welcome-file>,可以直接打开默认文件
3.设置访问端口:
在tomcat的conf文件下找到server.xml文件
<Connector port="8080" protocol="HTTP/1.1"
connectionTimeout="20000"
redirectPort="8443" />
把8080改成你想要设置的端口
本文介绍了如何修改Tomcat服务器的默认配置,包括更改访问端口、设置默认启动页面以及指定工程的访问路径。通过编辑server.xml和web.xml文件,可以实现端口8080替换为自定义端口,以及自定义欢迎页面和项目路径。

414

被折叠的 条评论
为什么被折叠?



