How to Run Tomcat Server on a Different Port

Tomcat Default Port number is 8080.When this port number is being used by other  Popular servers like Wamp Server,JBoss Microsoft SQl Server etc,you are likely to get this error

Ports to Run Tomcat Server if Default fails

<div class="line number1 index0 alt2">logs/catalina.2007-01-09.log:
...
INFO: Starting Servlet Engine: Apache Tomcat/5.5.20
Jan 11, 2007 9:36:12 AM org.apache.catalina.core.StandardHost start
INFO: XML validation disabled
Jan 11, 2007 9:36:13 AM org.apache.coyote.http11.Http11BaseProtocol start
SEVERE: Error starting endpoint
java.net.BindException: Address already in use: JVM_Bind:8080
at org.apache.tomcat.util.net.PoolTcpEndpoint.initEndpoint(PoolTcpEndpoi
nt.java:297)
at org.apache.tomcat.util.net.PoolTcpEndpoint.startEndpoint(PoolTcpEndpo
int.java:312)
at org.apache.coyote.http11.Http11BaseProtocol.start(Http11BaseProtocol.
java:150)
at org.apache.coyote.http11.Http11Protocol.start(Http11Protocol.java:75)at org.apache.catalina.connector.Connector.start(Connector.java:1089)
at org.apache.catalina.core.StandardService.start(StandardService.java:4
59)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:709
)
at org.apache.catalina.startup.Catalina.start(Catalina.java:551)</div>
<div class="line number1 index0 alt2"></div>
<div class="line number1 index0 alt2">
Correcting this error is very simple.You just need to go to the Tomcat Installation folder and find Config Folder
Find a  file called Server.xml file and get this code
</div>
<div class="line number1 index0 alt2">&lt;Connector port="8080" protocol="HTTP/1.1"
connectionTimeout="20000"
redirectPort="8443" /&gt;</div>
<div class="line number1 index0 alt2">
Change the Port 8080 to 8081
</div>
<div class="line number1 index0 alt2">&lt;Connector port="8081" protocol="HTTP/1.1"
connectionTimeout="20000"
redirectPort="8443" /&gt;</div>
<div class="line number1 index0 alt2">
Restart your Tomcat and everything should work fine.If this fails consider using other servers like Wamp Server

About the Author: Eric K

My name is Eric.Am a software developer with skills in Php,Mysql, Java , Android,Node.js Above all, I have certification in Cisco Networking Associate (CCNA) and holds degree in Information Technology. Hire me: Email : kawi3462@gmail.com