Your Ad Here

Home Articles | Tutorials | Troubleshooting | Tweaks | Windows Server 2012 | Subsribe to RSS Feed Subscribe to RSS Affiliated sites

Follow me  Follow gusac on Twitter  Subscribe  Email  Subscribe to RSS


Your Ad Here

How to change the default listening port in Tomcat

31.Jan.2011 | by Gusac | Filed in: Articles, Tutorials

By default, Tomcat listens on port 8080. To change the port to 80 or some other port, we will have to modify the Server.xml file that contains the Tomcat configuration.

  • To edit the Server.xml file, go to Conf folder under Tomcat installation directory ($Tomcat_Directory\Conf)
  • Open the server.xml files in notepad or any other editing application.
  • Locate the section that starts with <Connector.

It will look like:

<Connector URIEncoding="UTF-8" acceptCount="100" connectionTimeout="20000"
 disableUploadTimeout="true" enableLookups="false" maxHttpHeaderSize="8192" 
maxSpareThreads="75" maxThreads="150" minSpareThreads="25" port="8080" 
redirectPort="8443" /> 
  • In the above section, edit the part that says port=”8080” to the port number you want. For example, for port 80, it would be port=”80”
  • Restart the Tomcat service.

Permalink | Tags: