读书人

tomcat 直连通过IP访问web项目

发布时间: 2012-08-26 16:48:06 作者: rapoo

tomcat 直接通过IP访问web项目

1:在开发时访问web项目是这样的http://localhost:8080/项目名称

也可以直接通过IP访问web项目:http://localhost/项目名称

方法为

? 1:修改tomcat端口为80

??

修改server.xml

?改为

?<Connector port="80" protocol="HTTP/1.1"

?

2:

在server.xml??里,<host>...</host>的标签之间添加<Context path="" docBase="项目名称" debug="0"/>

?

重新启动tomcat,输入http://localhost/项目名称就可以了

?

读书人网 >Web前端

热点推荐