开发者

Eliminating port number in the url

开发者 https://www.devze.com 2023-04-13 02:51 出处:网络
I have a application developing in Java, Strut2 and Tomcat and is been deployed n Tomcat 6.0 the URL to access is

I have a application developing in Java, Strut2 and Tomcat and is been deployed n Tomcat 6.0 the URL to access is http://websiste:8181/webAppName/some.action

Now I am trying to change the above url to http开发者_JAVA技巧://website/webAppName/some.action

can you please let me know how to eliminate Port number in URL


You should run the server on port 80 which is default for http.


You need Tomcat to use port 80 instead of 8181. Port 80 is the default port used when no port is specified. See this post for details on how to change the port number.

Edit: Since you have Apache running on port 80, you can't serve your app from Tomcat on port 80 too. One option is to use Apache's mod_proxy (can be dangerous), or the Tomcat's Apache connector to get Apache to serve /webAppName/* from Tomcat instead of from your other website's resources.


If you can change the tomcat configuration, it's a simple matter to change it to port 80. More info is available here: http://www.klawitter.de/tomcat80.html


There are two ways to eliminate it : 1) Preferred way : set the server to listen at port 80 instead of 8181 as others have already mentioned 2) Non preferred way : Change Proxy settings in your browser to hit 8181 port instead of 80 for http protocol. This will force you to explicitly use 80 port when trying to reach other web sites.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号