1.以apache-tomcat-7.0.6为例,进入tomcat安装目录,编辑文件“安装目录\apache-tomcat-7.0.6\conf\server.xml”(可以用记事本打开)
2.在server.xml文件中依次查找并修改端口号:
<Server port="8005" shutdown="SHUTDOWN">
<Connector port="8009" protocol="AJP/1.3" redirectPort="8443"/>
<Connector connectionTimeout="20000" port="8080" protocol="HTTP/1.1" redirectPort="8443"/>
3.在server.xml文件中依次查找修改
<Server port="8005" shutdown="SHUTDOWN">
修改为:
<Server port="8006" shutdown="SHUTDOWN">
4.<Connector port="8009" protocol="AJP/1.3" redirectPort="8443"/>
修改为:
<Connector port="8010" protocol="AJP/1.3" redirectPort="8444"/>
5.<Connector connectionTimeout="20000" port="8080" protocol="HTTP/1.1" redirectPort="8443"/>
修改为:
<Connector connectionTimeout="20000" port="8081" protocol="HTTP/1.1" redirectPort="8444"/>
6.启动tomcat,访问http://localhost:8081/ ;能成功访问,说明修改成功(访问的端口跟据配置文件中设置的Connector 端口)
动力节点在线课程涵盖零基础入门,高级进阶,在职提升三大主力内容,覆盖Java从入门到就业提升的全体系学习内容。全部Java视频教程免费观看,相关学习资料免费下载!对于火爆技术,每周一定时更新!如果想了解更多相关技术,可以到动力节点在线免费观看Tomcat入门视频学习哦!
代码小兵86504-19 19:55
代码小兵49806-21 15:40
代码小兵69607-21 11:32
代码小兵87207-21 12:51