answer is yes, it is possible. Others have done it successfully.
If you want a place to start, take a look at host manager servlet
http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/java/org/apache/catalina/manager/host/HostManagerServlet.java?view=annotate

Note, this doesn't imply that you have to do it over HTTP, implement it any way you want to fit your environment

best
Filip

On 01/21/2010 10:24 AM, richard42 wrote:
Dear Forum,

Is it possible to dynamically add/remove hosts through code without
restarting Tomcat (6.0)?

I am writing an application that creates new websites on the fly (eg.
website1.mydomain.com, website2.mydomain.com etc).  Each of these websites
will exist in a separate directory on the server - this is so they may be
upgraded independently in the future.

1. I have considered programatically editing server.xml, but have ruled this
out since it would require
restarting Tomcat afterwards (and hence downtime of existing sites).

2. I have also considered running multiple instances of Tomcat, but each
instance would have to use a different TCP port.  In the absence of any
additional software, this would mean I would need lots of external IPs.

3. I have looked at the 'tomcat-manager' app (and considered interfacing
with it via HTTP) but the start function does not seem to work and from what
I have read, this app is no longer supported?

Would anybody be able to advise me on the best approach please?  I have not
ruled out any of the above options completely if they can be implemented
reliably and without restarting the server.

Thank you in advance!
Richard.










---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to