if I have several <Host> blocks in my server.xml like:

<Host name="www.mycompany.com" ...>

what would be the best way to stop/start/restart just one one them ?

I was using /bin/Catalina.sh stop and /bin/Catalina.sh start when I had only a single host but now I want to be able to handle each of them without affecting the other ones.

How would that differ if I had several applications running on the same Host and I wanted to restart just one of the applications ?


I don't think you can. If you've got several hosts configured in your server.xml, they'll all be tied to the running tomcat container (JVM) and you'll have to restart the whole lot of them if you restart one.

It's been a while, but back in the day we had lots of individual instances running on our servers, and we used custom start/stop scripts to host individual apps and their associated configuration separately (at least those that should be separate).

This helped keep our deployments scoped to a single container, as well as our management actions. You may consider doing something similar in your case, particularly if you want to be able to manage them separately like this - on the surface it seems like it would make sense for you to do something similar.

  • But then who is listening on what port? AFAIK only one "engine" can listen on a specific port - an what if I want to have a.com an b.com both run independently (i.e. can be independently restarted/upgraded) on the same machine with both using port 80? – epeleg Dec 21 '11 at 11:57
  • We (obviously) had separate ports bound to each instance. Apache with name-based vhosts and mod_proxy setup can easily forward to the backend tomcat instances on their respective ports, per site. – mcauth Dec 21 '11 at 23:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.