Powered by Blogger.

How to run two Tomcat Instances on same machine

>> Thursday, February 15, 2018

Sometimes you are forced to work multiple projects at a time, using two work-spaces using IDE's like MyEclipse or Eclipse or NetBeans. In this situation you should run both the tomcat servers to test your changes at a time from your local. If you run both Tomcat servers at a time from different workspaces you will get the error message as showing below:

"Port 8080 required by Tomcat v8.0 Server at localhost is already in Use."

Tomcat Multiple Instances Error Message_JavabynataraJ

To avoid this error and you want to start two tomcat servers or instances on your machine using IDE's, follow the below steps.
 On my System i am using MyEclipse 2017. Now, go to Servers tab and select the deployed application from the MyEclipse IDE.
  1. Right click on application from Tomcat Server, select browse deployment location.
  2. Go to .me_tcat85 folder and select 'conf' folder and select server.xml file.
  3. Open server.xml using notepad and follow the below steps.
Server1: <Server port="8005" shutdown="SHUTDOWN">
Server2: <Server port="8006" shutdown="SHUTDOWN">

Server1: <Service name="Catalina">
Server2: <Service name="Catalina1">

Server1: <Connector port="8080"
Server2: <Connector port="8090"

Server1: <Connector port="8009" protocol="AJP/1.3" redirectPort="8443" />
Server2: <Connector port="8010" protocol="AJP/1.3" redirectPort="8443" />

Server1: <Engine name="Catalina" defaultHost="localhost">
Server2: <Engine name="Catalina1" defaultHost="localhost">

Start Each Tomcat Server Separately.

Server 1: http://localhost:8080/ContextPath/

Server 2: http://localhost:8090/ContextPath/


Related Posts: Configure Tomcat on MyEclipse

Related Posts Plugin for WordPress, Blogger...
© javabynataraj.blogspot.com from 2009 - 2022. All rights reserved.