gamo
gamo

Reputation: 1567

How can I run two Tomcat server v7.0

I'm working with Tomcat server v7.0. I need to run two Tomcat server at a same time on same machine. After I run the first Tomcat server and try to run second Tomcat server I got this error.

Several ports (8005, 8080, 8009) required by Tomcat v7.0 Server at localhost (2) are already in use. The server may already be running in another process, or a system process may be using the port. To start this server you will need to stop the other process or change the port number(s).

Any solution?

Thank you.

Upvotes: 0

Views: 10345

Answers (3)

Deepam Singla
Deepam Singla

Reputation: 11

Problem here is that you are already running the tomcat on those ports. so when you try to run tomcat as second process, it will try to occupy those port and they are pre-occupied by first process. the solution to this problem is to assign different ports to the second tomcat. To do that in tomcat installation directory-->conf-->server.xml needs to be modified. There are 3 places that you need to make changes

  <Server port="8005" 
  <Connector port="8080" 
  <Connector port="8009"

change the port number with some random port number and you are good to go. if it does not work change the ports again . it may be possibe that the port you use is already used by some other process :)

Upvotes: 0

Pankaj Sharma
Pankaj Sharma

Reputation: 1853

goto \conf\server.xml directory and modify the port number for send tomcat server.

<Server port="8005" shutdown="SHUTDOWN">

 <Connector port="8080" protocol="HTTP/1.1" 
               connectionTimeout="20000" 
               redirectPort="8443" />
 <Connector port="8009" protocol="AJP/1.3" redirectPort="8443" />

change above ports to some free and available ports.

Upvotes: 2

CodeNewbie
CodeNewbie

Reputation: 2091

Double click on your second Tomcat server instance from the Servers view. On the left hand side of the window, you see the ports that have been specified for the current instance. You need to change those ports before starting a second server instance.

Tomcat settings

(I am guessing you are using Eclipse. This screenshot is from Eclipse.)

Upvotes: 3

Related Questions