By default, tomcat is configured to run on port 8080. That’s why all your deployed web applications are accessible though URLs like http://localhost:8080/yourapp
. If you want to run your applications on URL like http://localhost/yourapp
, then you will need to change the default port 8080 to 80, which is default port for HTTP connectors.
To make this port change, open server.xml
and find below entry :
<Connector port=
"8080"
//Change this
protocol=
"HTTP/1.1"
connectionTimeout=
"20000"
redirectPort=
"8443"
/>
and change it to below entry:
<Connector port=
"80"
//Changed
protocol=
"HTTP/1.1"
connectionTimeout=
"20000"
redirectPort=
"8443"
/>
You are all set to access your applications using root path “http://localhost/
“.
http://localhost:8080/yourapp
. If you want to run your applications on URL like http://localhost/yourapp
, then you will need to change the default port 8080 to 80, which is default port for HTTP connectors.server.xml
and find below entry :<Connector port= "8080" //Change this protocol= "HTTP/1.1" connectionTimeout= "20000" redirectPort= "8443" /> |
<Connector port= "80" //Changed protocol= "HTTP/1.1" connectionTimeout= "20000" redirectPort= "8443" /> |
http://localhost/
“.