项目开发的过程中,用myeclipse的tomcat运行项目的时候,访问项目通常需要带有项目的名称。本文的目的在于当tomcat运行成功的时候能够使用自定义的域名访问项目。如一个shopxx商场项目,以www.lfq.com或localhost访问。
1、myeclipse中servers窗口右键tomcat服务器,修改8080端口为80端口

2、找到工作目录workspaces下项目下的setting。把相应文档中的value修改为ROOT



3、修改域名。打开c盘,修改截图目录中的hosts。


4、从tomcat中remove项目并重新部署到tomcat中并运行,观察项目的名字有没改为ROOT

5、打开浏览器输入在hosts中设置的域名,指向成功。
图片8.png
注意:项目如果报jvm服务80端口已经被占用的话就打开服务关掉这个三w的服务。再重启。

网友评论