cat life | grep experiences > blog
Posts tagged tomcat
How to change the default Tomcat port ?
0492 days
by Kaustubh Padegaonkar
in Tricks
It seems there was a clash between Tomcat and another application which was using port 8080, which happens to be the default Tomcat port. Here is how I went about it:
Steps of changing the Tomcat Port
1) Locate server.xml in <Tomcat installation folder>\ conf \
2) Find the statement similar to this.
<!-- Define a non-SSL HTTP/1.1 Connector on port 8180 --> <Connector port="8080" maxHttpHeaderSize="8192" maxThreads="150" minSpareThreads="25" maxSpareThreads="75" enableLookups="false" redirectPort="8443" acceptCount="100" connectionTimeout="20000" disableUploadTimeout="true" />
or
<!-- A "Connector" represents an endpoint by which requests are received and responses are returned. Documentation at : Java HTTP Connector: /docs/config/http.html (blocking & non-blocking) Java AJP Connector: /docs/config/ajp.html APR (HTTP/AJP) Connector: /docs/apr.html Define a non-SSL HTTP/1.1 Connector on port 8080--> <Connector port="8080" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443" />
3) About Tomcat’s server.xml file cites it’s runs on port 8080. Change the Connector port=”8080″ port to any other port number.
For example
<Connector port="42211" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443" />
will instruct Tomcat to run itself on port 42211. The address will then change to
http://localhost:42211/foo
4) Save the server.xml file and restart Tomcat. It should start on the port you mentioned.