Sometimes we need to run several servers (or several tomcat servers) in same machine specially when developing and testing. In such situations we have to change the default port 8080 of the server. For that follow below simple steps.
1. Open server.xml located in the <TOMCAT_HOME>/conf/ directory using your favorite text editor.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- 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. The attribute "port" is the port number which server get binded. So you have to change that desired port number.
4. Then save the file and restart the server.
That's all :)
No comments:
Post a Comment