在使用myeclipse進行web開發時,每次訪問頁面都需要輸入8080的端口號,
覺得非常繁瑣,就想不輸入端口號來訪問頁面,該怎么辦,就把8080的端口號改為80就行了。
在使用myeclipse自帶的tomcat時,修改時很容易的,只需要在window--preferences--myeclipse--service--
integrated sanbdox--myeclipse tomcat 6中修改端口號8080為80就可以了。
這里的myeclipse tomcat 6是myeclipse自帶的tomcat.
在使用我自己下載的tomcat時,例如我使用我在tomcat官網上下載的apache-tomcat-6.0.48,就不能在這里修改端口號了。那么在哪里修改?
我先將apache-tomcat-6.0.48添加到我的myeclipse,找到
1
|
window--preferences--myeclipse--service--tomcat--tomcat 6.x |
我在myeclipse上找了很多地方,也在網上搜索了很多資料,如何修改myeclipse中tomcat 6.x的端口號,都是講的修改myeclipse自帶的tomcat的,修改我自己添加的apache-tomcat-6.0.48的端口號,很少有文章。不過我還是找到了一些文章,感謝網絡上所有無私的分享者。現在就介紹一種。
我把web項目部署到tomcat 6.x,在servers下找到我的web項目,
打開文件夾d:\apache-tomcat\apache-tomcat-6.0.48\webapps\computer_1,
在文件夾中返回到d:\apache-tomcat\apache-tomcat-6.0.48,
找到d:\apache-tomcat\apache-tomcat-6.0.48\conf目錄下的server.xml文件
用editplus或記事本打開server.xml,找到:
1
2
3
|
< connector port = "80" protocol = "http/1.1" connectiontimeout = "20000" redirectport = "8443" /> |
將port="8080"修改為port="80",保存。就可以了。
重新部署web項目到tomcat 6.x,發布可以看到:
在瀏覽器中訪問web項目的首頁,不需要使用http://localhost:8080/computer_1才能訪問項目了
使用http://localhost/computer_1就可以訪問項目了
以上這篇在myeclipse中修改tomcat 6.x的端口號方法就是小編分享給大家的全部內容了,希望能給大家一個參考,也希望大家多多支持服務器之家。
原文鏈接:https://blog.csdn.net/MaoFachang/article/details/60324996