tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mikolaj Rydzewski <>
Subject Re: Deploying new virtual hosts
Date Fri, 02 Dec 2005 11:50:54 GMT
George Sexton wrote:

>I'm trying to sort out a way I can automate deploying new virtual hosts on
>my Tomcat server. Right now I'm running about 70 virtual hosts. Each virtual
>host has only one ROOT context. I'm planning on scaling up to at least 200
>virtual hosts before I need to get a second machine. The second machine will
>probably be more powerful, and I'll want to scale it into the region of
>something like 1000 virtual hosts. I've looked through the documentation on
>the Tomcat site and don't think I'm seeing what I need.
>Ideally I would like something that would be scriptable that would let me
>automatically deploy the virtual hosts. If I can't get that, some
>application that would let me create a new virtual host without stopping and
>re-starting tomcat would be nice. I'm thinking in the near future I will
>need to deploy several new virtual hosts per day. If I can't do it
>automatically, I'd at least like one tool that works that could be used to
>create a virtual host correctly.
Have you tried embeded tomcat? It's very easy to set up, and add new 
hosts, contexts, etc. on the fly. So it would be possible with very 
little effort to create small app to create/delete any host inside such 

Sample code:

embedded = new Embedded();
Engine engine = embedded.createEngine();
Host host = embedded.createHost("localhost", appBase.getAbsolutePath());
Context ctx = embedded.createContext("/ctx, docBase.getAbsolutePath());
Connector connector = embedded.createConnector((InetAddress) null, 8080, 

Mikolaj Rydzewski  <>
Becomo S.A.
tel. (12) 2927104

View raw message