On 4/27/12 4:27 AM, André Warnier wrote:
It seems that you have already most of the parts done, and are just
missing the "persistent" part of the <Host> entries in server.xml.
It would seem like a fairly easy task, with a bit of scripting, to have
a template server.xml with some kind of an "include" tag (à la <!-- here
come the Hosts -->), and whenever you create a new Host dynamically,
adding it to some table, and rewriting the server.xml with the
appropriate <Host> entries inserted in the template.
This way, whenever you restart Tomcat, it would "remember" these Hosts.
The script to re-create the server.xml could be inserted in your Tomcat
startup mechanism.
Yeah, this seems sort of like a double-approach. I'd need to get Tomcat
to enable the vhosts, and also have something that would 'dump' that
information to server.xml.
I think the better approach is what Chuck pointed me to - the
host-manager application seems to allow dynamic vhost generation in the
running environment, what it needs is a hook to 'regen' the server.xml
(or dump the XML for the <Host> entries for easy inclusion back into the
server.xml).
So one last question before I start tearing into host-manager - what I'm
guessing it's doing is using JMX calls to tomcat-core (Note, I've done
zilcho work with Tomcat internals yet, so sorry if this is way off) and
dynamically creating / updating vhosts. If that's the case, it should
be pretty easy to modify it to dump the XML, or write a command line
tool that does the same thing.
Is this sane? :)
Hmmmm.
-d
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]