myeclipse通过ip地址直接访问自定义Tomcat主页

        1、修改默认端口号为80,80端口为http访问的默认端口,tomcat主页为http://127.0.0.1:8080,修改端口号为80,可以实现不输入端口号的访问:

   找到tomcat配置文件,我用的myeclispe自带的tomcat,配置文件在工作区间的service下,编辑service.xml,找到

   <Connector connectionTimeout="20000" port="8080" protocol="HTTP/1.1" redirectPort="8443"/>

  port修改为80

      2、找到<Host></Host>标签,在标签中添加<Context path="" docBase="Tomcat下/webapps/你的项目" debug="0" reloadable="true" />

    path为你的虚拟路径,doc为你的tomcat中的项目路径

     3、找到web.xml,新增一个<welcome-file>你的首页</welcome-file>,一般为index.jsp或者其他格式,如果在文件夹下的,则/xxx/index.jsp

发布了46 篇原创文章 · 获赞 3 · 访问量 1万+

猜你喜欢

转载自blog.csdn.net/fengwuJ/article/details/81127985