How to change the default port of tomcat??

How to change the default port of Apache Tomcat:

For changing default port of Apache Tomcat we have to go the file location where we installed Apache Tomcat server and search for file named server.xml in the conf folder.

 In my case the location is:

C:\Program Files\Apache Software Foundation\Tomcat 8.5\conf

Now we have to change the default port in server.xml file. Like:

 

 

Default port:

–>

<Connector port=”8080″ protocol=”HTTP/1.1″

connectionTimeout=”20000″

redirectPort=”8443″ />

<!– A “Connector” using the shared thread pool–>

 

 

Updated port:

–>

<Connector port=”8181″ protocol=”HTTP/1.1″

connectionTimeout=”20000″

redirectPort=”8443″ />

<!– A “Connector” using the shared thread pool–>

 

Note: After changing the default port we have to restart the Apache Tomcat server. To restart, in windows we have to go to windows service and restart the server:

Now if browse http://localhost:8181/  the we can see the same page as: