0

I configured my single tomcat to host 2 services at different connector port like this :-

<!-- WebApp 1--> <Service name="webapps1"> <Connector port="7001" maxThreads="150" minSpareThreads="25" maxSpareThreads="75" enableLookups="false" redirectPort="8443" acceptCount="100" connectionTimeout="20000" disableUploadTimeout="true" /> <Engine name="receiver1" defaultHost="localhost"> <Host name="localhost" appBase="webapps1" unpackWARs="true" autoDeploy="true"> </Host> </Engine> </Service> <!-- End of WebApp 1--> <!-- WebApp 2--> <Service name="webapps2"> <Connector port="7002" maxThreads="150" minSpareThreads="25" maxSpareThreads="75" enableLookups="false" redirectPort="8443" acceptCount="100" connectionTimeout="20000" disableUploadTimeout="true" /> <Engine name="receiver2" defaultHost="localhost"> <Host name="localhost" appBase="webapps2" unpackWARs="true" autoDeploy="true"> </Host> </Engine> </Service> <!-- End of WebApp 2--> 

Now, my concern is if I stop tomcat both the services will be stopped, but what I want is to stop/start webapp1 only, So that I can make changes and restart only webapp1 without affecting webapp2.

That means what I want is to accept request over 7002, meanwhile I deploy and restart 7001 connector without actually shutting down tomcat process.

How can I achieve this..? Any help is really appreciated.

Thanks.

1
  • Start two independent tomcat instances... Commented Oct 10, 2013 at 10:19

2 Answers 2

1

You can USE TOMCAT MANAGER to deploy/undeploy your War files that are hosted in two tomcat services.

Example

Tomcat Service1 deploy:

https://hostip:service1-port/manager/?action=deploy&path=/CONTEXT_PATH&war=file:WAR_FILE_LOCATION 

Tomcat Service2 deploy:

https://hostip:service2-port/manager/?action=deploy&path=/CONTEXT_PATH&war=file:WAR_FILE_LOCATION 
Sign up to request clarification or add additional context in comments.

Comments

0

You can start and stop services via JMX but it would probably be simpler just to install two instances of Tomcat. If you want them to share the same binaries then see the section entitled "Advanced Configuration - Multiple Tomcat Instances" in RUNNING.txt in the root of any Tomcat install.

2 Comments

Thanks Mark for your response. That's how we are doing right now, by creating multiple JVM. But we want to reduce process footprint thats why we want to have multiple service in single tomcat and should be able to restart it.
Then JMX is your only option.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.