0
votes

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.

3
You will have to change the ports of second tomcat server so they are different. Search Google for configuring tomcat ports. There are plenty of articles available.RandomQuestion
Thanks for quick comment. I will check it out.gamo
As I understand if I change port number that mean the port number in my first Tomcat server will change too, right? If true that will not solve my issue.gamo
Do you need to run two separate instances of Tomcat? There are benefits of running a single instance of Tomcat, and you can stop/start web-applications independently of each other. One advantage is that you can specify a single memory pool that all applications can share, where in two instances, memory cannot be shared.Sprooose

3 Answers

3
votes

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.)

2
votes

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.

0
votes

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 :)