You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Robert Hunt <ro...@comcast.net> on 2004/12/19 23:30:40 UTC

Adding withOUT server restart?

Is there a way/example to add a virtual host programmatically *WITHOUT* having to edit server.xml (adding another <Host/> node) and restarting the server?  (If you're about to say, "Use the admin web app", then see this: http://www.mail-archive.com/tomcat-user@jakarta.apache.org/msg143691.html )

[TC 5.0.25 on Win XP]

Re: Adding withOUT server restart?

Posted by Peter Rossbach <pr...@objektpark.de>.
Hello Robert,

you can to this via JMX MBeanFactory ( createStandardHost, 
removeStandardHost).

   public String createStandardHost(String parent, String name,
                                     String appBase, boolean autoDeploy,
                                     boolean deployXML, boolean 
liveDeploy,                                     
                                     boolean unpackWARs,
                                     boolean xmlNamespaceAware,
                                     boolean xmlValidation)

Parent is the Service MBean ( example "Catalina:type=Service")

You can configure a JMX Http Adaptor
     Add mx4j-tools.jar at bin/setClassPath.sh - CLASSPATH
     Configure the JMX Http Adaptor at your server.xml
    <Connector protocol="AJP/1.3" mx.enabled="true" mx.httpPort="9050" 
mx.httpHost="localhost" />

Access the MBeans via http://localhost:9050 and search for the MBeanFactory.

regards
Peter

Robert Hunt schrieb:

>Is there a way/example to add a virtual host programmatically *WITHOUT* having to edit server.xml (adding another <Host/> node) and restarting the server?  (If you're about to say, "Use the admin web app", then see this: http://www.mail-archive.com/tomcat-user@jakarta.apache.org/msg143691.html )
>
>[TC 5.0.25 on Win XP]
>  
>


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org