Monday, 20 August 2012

How to Change Apache Tomcat default Port 8080 to other Port number


Pre-Requisites:
  • apache-tomcat-6.0.18 (works with previous versions of Tomcat)
Tomcat will run by default on TCP/IP port number 8080.  But there can be situations where there are some other servers running on this same port forcing you to change the port of one of the servers. This article explains how to change the port number from 8080 to some other port number. 

Steps
  • 1. Navigate to
C:\apache-tomcat-6.0.18\conf\server.xml
(The place where you have installed tomcat)
  • 2. In server.xml file locate
  1. <!-- Define a non-SSL Coyote HTTP/1.1 Connector on port 8080 -->  
  2. <connector port="8080" maxthreads="150" minsparethreads="25" maxsparethreads="75" enablelookups="false" redirectport="8443" acceptcount="100" debug="0" connectiontimeout="20000" disableuploadtimeout="true">  
  3. <!-- Note : To disable connection timeouts, set connectionTimeout value to 0 -->  
  4. </connector>  
Or
  1. <connector port="8080" protocol="HTTP/1.1" connectiontimeout="20000" redirectport="8443">  
  2. </connector>  

(You can find something similar to the above snippet in server.xml.  It varies according to tomcat version)
change Connector port="8080" to Connector port="8081" or some other port number. Make sure that the port number in not used by some other application.

No comments:

Post a Comment

Related Posts Plugin for WordPress, Blogger...