Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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

<Host name="www.mycompany.com" ...>
    <Alias>alias.com</Alias>
     ...
</Host>

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 ?

share|improve this question
add comment

1 Answer

up vote 1 down vote accepted

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.

share|improve this answer
    
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
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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