Last Updated on 05 August 2019   |   Print Email
By default, Tomcat is listening on the port number 8080 (for HTTP Connector) and 8009 (for AJP Connector), as shown in the following screenshot of Tomcat’s console when the server is started:Sometimes, one needs to change these default port numbers because of conflict with other applications or just for convenience, e.g. change HTTP port number from 8080 to 80 in order to type the URL without specifying the number.It’s very easy to change the port numbers in Tomcat, by doing the following steps:
Make sure the server is stopped, or shutdown it if it is running.
Open the server.xml file which can be found under TOMCAT_INSTALL_DIR\conf directory:
If we want to change the HTTP port number, search for the following lines:
Nam Ha Minh is certified Java programmer (SCJP and SCWCD). He began programming with Java back in the days of Java 1.4 and has been passionate about it ever since. You can connect with him on Facebook and watch his Java videos on YouTube.
Comments
Run the text editor with Administrator right. Then use it to edit the server.xml file.