How do I remove the port number from Tomcat urls?

Chris picture Chris · Oct 22, 2014 · Viewed 12.2k times · Source

Please help!

How do I remove the port number and application name from Tomcat URL's?

I have my domain with GoDaddy and hosting with Linode.com. I installed Tomcat into Linode, uploaded my website files and pointed my domain from GoDaddy to my IP address with Linode but I can't figure out how to remove both the port number and the application name so it is just www.mywebsite.com.

Anyone know how to do this? I really appreciate your help!!!

Answer

Sven Tschui picture Sven Tschui · Oct 22, 2014

Change Port:

See http://www.mkyong.com/tomcat/how-to-change-tomcat-default-port/

in server.xml of your tomcat find

<Connector port="8080"

and replace with:

<Connector port="80"

(Similar for HTTPS, Search for 8443 replace with 443)

Context Root:

Simply deploy your web app named ROOT.war and it will be deployed to context root "/"

(my-webapp.war would result in /my-webapp)