> -----Original Message-----
> From: Pid [mailto:p...@pidster.com]
> Sent: Thursday, September 02, 2010 7:57 PM
> To: Tomcat Users List
> Subject: Re: Host Manager.
> 
> On 02/09/2010 21:06, Caldarale, Charles R wrote:
> >> From: Wesley Acheson [mailto:wesley.ache...@gmail.com]
> >> Subject: Host Manager.
> >
> >> Is there is no documentation for the host-manager?
> >
> > Very little that I've found.  You can learn a bit about it by
looking
> at its WEB-INF/web.xml file.
> >
> >> If I remember correctly from this list it doesn't persist its
> >> settings is that correct?
> >
> > Correct.
> >
> >> How many people would be interested in it persisting its settings,
> by
> >> editing the appropriate files.
> >
> > I would be interested.  Note that there's only one file to edit:
> conf/server.xml.
> >
> >> Is that in theory possible?
> >
> > It's all software...
> >
> >> to add the folder structure and the appropiate context.xml files.
> >
> > That's not necessary - the conf/Catalina/[host]/... files are
already
> created automatically as webapps are deployed under the new <Host>.
> Only conf/server.xml needs to be updated.
> >
> >> Would it interfere too badly with tomcat while it was running?
> >
> > No, Tomcat only reads server.xml during startup.  Whatever update
> mechanism is used must insure that the file is never in an unparsable
> state (e.g., don't update in place, instead create a new file and then
> rename it).
> 
> May I gently steer you in the direction of the JMX API and the
> Catalina:type=Server.Operations.storeConfig() command?
> 
> Not sure it works very well at the moment, but if it did...
> 
> p
> 

Well, it certainly meets my requirement that it writes it out sans
comments.
I added two hosts, smith & wesson, to an out-of-the-box 5.5.29 setup on
Windows. For smith, I just proved a name and appbase. For wesson, I also
unchecked AutoDeploy and DeployXML. I used jconsole to run the
storeConfig(), and it renamed the old file to server.xml.timestamp and
then wrote out a new server.xml sans comments.  It appears that it
doesn't write out anything that might be default settings.  It didn't
write out a port or shutdown value for <Server> and left out some
parameters for the <Connector> for port 8080.  It actually added a
connectionTimout="-1" to the AJP connector.  You can see the results
below.
All in all, it's not a great or perfect solution, but it is workable.

<?xml version="1.0" encoding="UTF-8"?>
<Server>
  <Listener className="org.apache.catalina.core.AprLifecycleListener"/>
  <Listener
className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener"/
>
  <Listener
className="org.apache.catalina.storeconfig.StoreConfigLifecycleListener"
/>
  <Listener
className="org.apache.catalina.mbeans.ServerLifecycleListener"/>
  <GlobalNamingResources>
    <Environment
      name="simpleValue"
      type="java.lang.Integer"
      value="30"/>
    <Resource
      auth="Container"
      description="User database that can be updated and saved"
      name="UserDatabase"
      type="org.apache.catalina.UserDatabase"
      pathname="conf/tomcat-users.xml"
      factory="org.apache.catalina.users.MemoryUserDatabaseFactory"/>
  </GlobalNamingResources>
  <Service
      name="Catalina">
    <Connector
        port="8080"
        redirectPort="8443"
        minSpareThreads="25"
        connectionTimeout="20000"
        maxSpareThreads="75"
        maxThreads="150">
    </Connector>
    <Connector
        port="8009"
        redirectPort="8443"
        connectionTimeout="-1"
        protocol="AJP/1.3">
    </Connector>
    <Engine
        defaultHost="localhost"
        name="Catalina">
      <Realm className="org.apache.catalina.realm.UserDatabaseRealm"/>
      <Host
          appBase="polyweb2"
          autoDeploy="false"
          deployXML="false"
          liveDeploy="false"
          name="wesson">
      </Host>
      <Host
          appBase="polyweb"
          name="smith">
      </Host>
      <Host
          name="localhost">
      </Host>
    </Engine>
  </Service>
</Server>
__________________________________________________________________________

Confidentiality Notice:  This Transmission (including any attachments) may 
contain information that is privileged, confidential, and exempt from 
disclosure under applicable law.  If the reader of this message is not the 
intended recipient you are hereby notified that any dissemination, 
distribution, or copying of this communication is strictly prohibited.  

If you have received this transmission in error, please immediately reply to 
the sender or telephone (512) 343-9100 and delete this transmission from your 
system.


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

Reply via email to