Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to redirect URL without port number to tomcat webserver

Tags:

tomcat

I am using tomcat version 7 and have hosted one resource file in webapp. Right now, I am accessing my resource file by typing the URL http://dcdvdvdsv.com:8080/resourcefilename.

I have mapped my IP in my hosts file.

I want to get rid of the port number inside the URL. How can I do that?

like image 353
bhalkian Avatar asked Nov 24 '12 18:11

bhalkian


People also ask

How do I remove the port number from Tomcat urls?

Well, to change the port that Tomcat uses is a simple matter of changing the entry in the server. xml file under conf directory. In both cases change the port to 80 and you remove the requirement to provide a port on the url string. This should also eliminate the need for http:// but, that's a function of the browser.


1 Answers

Whenever you enter a URL without a port, it defaults to port 80, the standard http port.

Change your Tomcat's listening port from 8080 to 80, and you'll be done.

like image 190
mgarciaisaia Avatar answered Sep 27 '22 20:09

mgarciaisaia