How to change Tomcat server default port?

Started by Dipak Bhoi, June 01, 2015, 05:25:12 PM

Previous topic - Next topic

Dipak Bhoi

Hello folks,

Tomcat default port is 8080 but sometimes for some java applications need other port like 8081 or 8082. In this tomcat tutorial we will see how to change default port 8080.

Login to the server using root user's credentials and locate file server.xml configuration file

Quote#locate server.xml

/usr/local/easy/etc/easy-tomcat7/server.xml

Now open this file and edit as below.

Before:
Quote<Connector port="8080" protocol="HTTP/1.1"
               connectionTimeout="30000"
               redirectPort="8443" />

After:
 
Quote<Connector port="8081" protocol="HTTP/1.1"
               connectionTimeout="30000"
               redirectPort="8443" />

save the file server.xml file and restart tomcat service . It will start listening on port 8081 instead on default port 8080.

Access URL http://xxx.xxx.xxx.xx:8081 (xxx.xxx.xxx.xx should be your server's IP address)

That's all, enjoy !!! :) ;) :)








MilesWeb - 30-Day Money Back
cPanel Web Hosting - cPanel Hosting in India
Grab a Free SSL for your website.  WordPress Optimized Solution.