You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Wesley Acheson <we...@gmail.com> on 2010/09/02 21:40:01 UTC

Host Manager.

Few Questions

Is there is no documentation for the host-manager?

If I remember correctly from this list it doesn't persist its settings is
that correct?

How many people would be interested in it persisting its settings, by
editing the appropriate files.

Final question.

Is that in theory possible? to add the folder structure and the appropiate
context.xml files. Would it interfere too badly with tomcat while it was
running?

I really like the idea of the host manager. If it persisted its features I
may actually have used it.

Regards,

Wes

Re: Host Manager.

Posted by Wesley Acheson <we...@gmail.com>.
On Thu, Sep 2, 2010 at 10:42 PM, Jordan Michaels <jo...@viviotech.net>wrote:

> I'd be interested as well. I've actually been meaning to get to this myself
> and submit a patch to make the changes persist, but my schedule has been too
> hectic for any extra-curricular work recently. If you don't (and I'm hoping
> you will)... I will get to it eventually. ;)
>
> -Jordan
>
>
> On 09/02/2010 01:06 PM, Caldarale, Charles R wrote:
>
>> From: Wesley Acheson [mailto:wesley.acheson@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).
>>
>>  - Chuck
>>
>> I don't have a huge amount of time right now but yeah as far as I
understand it, it shouldn't be tooooooo difficult. I do have another side
project (in php) which Is probably more urgent to me.

However I was thinking about doing this. Really I'm not sure what way the
community is supposed to feed in its desires at the moment. So I thought
maybe the best way was to ensure there was some interest here before
committing myself.

Wes

Re: Host Manager.

Posted by Jordan Michaels <jo...@viviotech.net>.
I'd be interested as well. I've actually been meaning to get to this 
myself and submit a patch to make the changes persist, but my schedule 
has been too hectic for any extra-curricular work recently. If you don't 
(and I'm hoping you will)... I will get to it eventually. ;)

-Jordan

On 09/02/2010 01:06 PM, Caldarale, Charles R wrote:
>> From: Wesley Acheson [mailto:wesley.acheson@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).
>
>   - Chuck
>
>
> THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>

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


RE: Host Manager.

Posted by Jeffrey Janner <Je...@PolyDyne.com>.
> -----Original Message-----
> From: Pid [mailto:pid@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.acheson@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-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Host Manager.

Posted by Wesley Acheson <we...@gmail.com>.
On Sun, Sep 12, 2010 at 5:38 PM, Martin Gainty <mg...@hotmail.com> wrote:
>
> could you configure
> public static void writeXml( Node n, OutputStream os )         throws TransformerException
>  of org.apache.tomcat.util.DomUtil to trap TransformerFactoryConfigurationError
> http://cupi2.uniandes.edu.co/site/images/recursos/javadoc/j2se/1.5.0/docs/api/javax/xml/transform/TransformerFactory.html#newTransformer%28javax.xml.transform.Source%29
>
> it seems at minumum one of these conditions to be satisifed to properly newInstance the TransformerFactory ?
>
> Use the javax.xml.transform.TransformerFactory system property.
> Use the properties file "lib/jaxp.properties" in the JRE directory. This configuration file is in standard java.util.Properties format and contains the fully qualified name of the implementation class with the key being the system property defined above. The jaxp.properties file is read only once by the JAXP implementation and it's values are then cached for future use. If the file does not exist when the first attempt is made to read from it, no further attempts are made to check for its existence. It is not possible to change the value of any property in jaxp.properties after it has been read for the first time.
> Use the Services API (as detailed in the JAR specification), if available, to determine the classname. The Services API will look for a classname in the file META-INF/services/javax.xml.transform.TransformerFactory in jars available to the runtime.
> Platform default TransformerFactory instance.
>
> ?
> Martin Gainty

So far my attempt is here now.
https://issues.apache.org/bugzilla/show_bug.cgi?id=48674

Your way sounds better though :(

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


RE: Host Manager.

Posted by Martin Gainty <mg...@hotmail.com>.
could you configure  
public static void writeXml( Node n, OutputStream os )         throws TransformerException
 of org.apache.tomcat.util.DomUtil to trap TransformerFactoryConfigurationError
http://cupi2.uniandes.edu.co/site/images/recursos/javadoc/j2se/1.5.0/docs/api/javax/xml/transform/TransformerFactory.html#newTransformer%28javax.xml.transform.Source%29

it seems at minumum one of these conditions to be satisifed to properly newInstance the TransformerFactory ?

Use the javax.xml.transform.TransformerFactory system property. 
Use the properties file "lib/jaxp.properties" in the JRE directory. This configuration file is in standard java.util.Properties format and contains the fully qualified name of the implementation class with the key being the system property defined above. The jaxp.properties file is read only once by the JAXP implementation and it's values are then cached for future use. If the file does not exist when the first attempt is made to read from it, no further attempts are made to check for its existence. It is not possible to change the value of any property in jaxp.properties after it has been read for the first time. 
Use the Services API (as detailed in the JAR specification), if available, to determine the classname. The Services API will look for a classname in the file META-INF/services/javax.xml.transform.TransformerFactory in jars available to the runtime. 
Platform default TransformerFactory instance. 
 
?
Martin Gainty 
______________________________________________ 
Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité

Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.
Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le destinataire prévu, nous te demandons avec bonté que pour satisfaire informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est interdite. Ce message sert à l'information seulement et n'aura pas n'importe quel effet légalement obligatoire. Étant donné que les email peuvent facilement être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité pour le contenu fourni.



 

> Date: Sun, 12 Sep 2010 16:01:26 +0200
> Subject: Re: Host Manager.
> From: wesley.acheson@gmail.com
> To: users@tomcat.apache.org
> 
> Okay I'm most of the way to a solution but I wouldn't mind if someone
> would take a look at a new WIP class and tell me what needs cleaning.
> Its not quite functional.
> 
> Anyone interested?
> 
> On Fri, Sep 3, 2010 at 4:44 AM, Wesley Acheson <we...@gmail.com> wrote:
> > Looked at that before not really convinced reworking that is easier
> > than adding in an xml line or two via an xml writer.
> >
> > Willing to be convinced though.
> >
> > Wes
> >
> > On 9/3/10, Pid <pi...@pidster.com> wrote:
> >> On 02/09/2010 21:06, Caldarale, Charles R wrote:
> >>>> From: Wesley Acheson [mailto:wesley.acheson@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
> >>
> >>>  - Chuck
> >>>
> >>>
> >>> THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
> >>> MATERIAL and is thus for use only by the intended recipient. If you
> >>> received this in error, please contact the sender and delete the e-mail
> >>> and its attachments from all computers.
> >>>
> >>>
> >>> ---------------------------------------------------------------------
> >>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> >>> For additional commands, e-mail: users-help@tomcat.apache.org
> >>>
> >>
> >>
> >
> > --
> > Sent from my mobile device
> >
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 
 		 	   		  

Re: Host Manager.

Posted by Wesley Acheson <we...@gmail.com>.
Okay thats good feedback a lot more work though.

On Fri, Sep 17, 2010 at 12:01 AM, André Warnier <aw...@ice-sa.com> wrote:
> Wesley Acheson wrote:
>>
>> The way I've implemented this it does all the normal work of adding
>> the host to the container before trying to persist the file.
>>
>> Now there are a lot of things that can go wrong when trying to write
>> to a filesystem. Maybe the user doesn't have permission to update the
>> file. Maybe the existing file is unparseable for some reason (that one
>> shouldn't really happen). Maybe the security manager stops the user
>> updating the file. etc. etc.
>>
>> So my question is what should be seen in the host manager in
>> everyone's opinion if the file system changes aren't persisted?
>>
>> Some possibilities below:
>>
>> Should it still show success as its been added to the container.?
>> Should the addition to the container be undone (rollback)?
>> Should it show an error? Or two messages 1 for the container 1 for the
>> file?
>> If error messages are shown how much information should be shown to
>> the client, a full stack trace, an informative message such as "update
>> server.xml:FAIL blocked by security manager"
>>
>> Please feel free to pitch in anyone.
>>
> Although I am not really competent, I will use your last phrase above as an
> excuse and pitch in.
> I understand what you are saying about what can go wrong, and I understand
> that conditions after a change may not be the same as when the change was
> started.
> But I find it particularly frustrating when I do a lot of work in an
> application, and when I want to save my work at the end, it comes and tells
> me that it cannot be saved, and does not provide any alternative (*).  I
> would imagine that some of these reasons for not being able to write
> server.xml, can be tested ahead of time, and a warning message provided to
> the user as to that fact, before they start making changes.
> Also, maybe in case server.xml cannot be directly overwritten, an
> alternative path could be requested from the user ? (and/or the file could
> be written first as "server.xml.new", and only renamed in a second step,
> which could fail).
>
>
> (*) the popup dialog with a single button "Press OK to reboot" comes to
> mind.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>

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


Re: Host Manager.

Posted by André Warnier <aw...@ice-sa.com>.
Wesley Acheson wrote:
> The way I've implemented this it does all the normal work of adding
> the host to the container before trying to persist the file.
> 
> Now there are a lot of things that can go wrong when trying to write
> to a filesystem. Maybe the user doesn't have permission to update the
> file. Maybe the existing file is unparseable for some reason (that one
> shouldn't really happen). Maybe the security manager stops the user
> updating the file. etc. etc.
> 
> So my question is what should be seen in the host manager in
> everyone's opinion if the file system changes aren't persisted?
> 
> Some possibilities below:
> 
> Should it still show success as its been added to the container.?
> Should the addition to the container be undone (rollback)?
> Should it show an error? Or two messages 1 for the container 1 for the file?
> If error messages are shown how much information should be shown to
> the client, a full stack trace, an informative message such as "update
> server.xml:FAIL blocked by security manager"
> 
> Please feel free to pitch in anyone.
> 
Although I am not really competent, I will use your last phrase above as an excuse and 
pitch in.
I understand what you are saying about what can go wrong, and I understand that conditions 
after a change may not be the same as when the change was started.
But I find it particularly frustrating when I do a lot of work in an application, and when 
I want to save my work at the end, it comes and tells me that it cannot be saved, and does 
not provide any alternative (*).  I would imagine that some of these reasons for not being 
able to write server.xml, can be tested ahead of time, and a warning message provided to 
the user as to that fact, before they start making changes.
Also, maybe in case server.xml cannot be directly overwritten, an alternative path could 
be requested from the user ? (and/or the file could be written first as "server.xml.new", 
and only renamed in a second step, which could fail).


(*) the popup dialog with a single button "Press OK to reboot" comes to mind.

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


Re: Host Manager.

Posted by Wesley Acheson <we...@gmail.com>.
The way I've implemented this it does all the normal work of adding
the host to the container before trying to persist the file.

Now there are a lot of things that can go wrong when trying to write
to a filesystem. Maybe the user doesn't have permission to update the
file. Maybe the existing file is unparseable for some reason (that one
shouldn't really happen). Maybe the security manager stops the user
updating the file. etc. etc.

So my question is what should be seen in the host manager in
everyone's opinion if the file system changes aren't persisted?

Some possibilities below:

Should it still show success as its been added to the container.?
Should the addition to the container be undone (rollback)?
Should it show an error? Or two messages 1 for the container 1 for the file?
If error messages are shown how much information should be shown to
the client, a full stack trace, an informative message such as "update
server.xml:FAIL blocked by security manager"

Please feel free to pitch in anyone.

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


Re: Host Manager.

Posted by Wesley Acheson <we...@gmail.com>.
Okay I'm most of the way to a solution but I wouldn't mind if someone
would take a look at a new WIP class and tell me what needs cleaning.
Its not quite functional.

Anyone interested?

On Fri, Sep 3, 2010 at 4:44 AM, Wesley Acheson <we...@gmail.com> wrote:
> Looked at that before not really convinced reworking that is easier
> than adding in an xml line or two via an xml writer.
>
> Willing to be convinced though.
>
> Wes
>
> On 9/3/10, Pid <pi...@pidster.com> wrote:
>> On 02/09/2010 21:06, Caldarale, Charles R wrote:
>>>> From: Wesley Acheson [mailto:wesley.acheson@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
>>
>>>  - Chuck
>>>
>>>
>>> THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
>>> MATERIAL and is thus for use only by the intended recipient. If you
>>> received this in error, please contact the sender and delete the e-mail
>>> and its attachments from all computers.
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>>> For additional commands, e-mail: users-help@tomcat.apache.org
>>>
>>
>>
>
> --
> Sent from my mobile device
>

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


Re: Host Manager.

Posted by Wesley Acheson <we...@gmail.com>.
Looked at that before not really convinced reworking that is easier
than adding in an xml line or two via an xml writer.

Willing to be convinced though.

Wes

On 9/3/10, Pid <pi...@pidster.com> wrote:
> On 02/09/2010 21:06, Caldarale, Charles R wrote:
>>> From: Wesley Acheson [mailto:wesley.acheson@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
>
>>  - Chuck
>>
>>
>> THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
>> MATERIAL and is thus for use only by the intended recipient. If you
>> received this in error, please contact the sender and delete the e-mail
>> and its attachments from all computers.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>> For additional commands, e-mail: users-help@tomcat.apache.org
>>
>
>

-- 
Sent from my mobile device

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


Re: Host Manager.

Posted by Pid <pi...@pidster.com>.
On 02/09/2010 21:06, Caldarale, Charles R wrote:
>> From: Wesley Acheson [mailto:wesley.acheson@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

>  - Chuck
> 
> 
> THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 


RE: Host Manager.

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Wesley Acheson [mailto:wesley.acheson@gmail.com] 
> Subject: Re: Host Manager.

> Honestly I thought there was more than one going from this
> http://tomcat.apache.org/tomcat-6.0-doc/virtual-hosting-howto.html

The files should be created automatically - but only when needed.

> I've just created a host using the host manager.
> And deployed a war. I don't see such a file.

See what such file?

> just the manager.xml

Where is that located?  When I tried it (6.0.29), the host-manager copied its manager.xml template to conf/Catalina/[newHost]/manager.xml, and put this in it:

<Context docBase="${catalina.home}/webapps/manager"
         privileged="true" antiResourceLocking="false" antiJARLocking="false">
</Context>

It also automatically created the new appBase directory for the new host.  I did click the _Start_ button on the line for the new <Host>; don't know if that was needed or not.

> Understood for server.xml is the same true of the context files though?

Since they've never been seen before (brand new <Host>), it won't matter.  But there really aren't any for the host-manager to create, other than the one for the manager app, so webapps can be deployed under the new <Host>.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers.


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


Re: Host Manager.

Posted by Wesley Acheson <we...@gmail.com>.
On Thu, Sep 2, 2010 at 10:06 PM, Caldarale, Charles R <
Chuck.Caldarale@unisys.com> wrote:

> > From: Wesley Acheson [mailto:wesley.acheson@gmail.com]
>


>  > 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.
>

Honestly I thought there was more than one going from this
http://tomcat.apache.org/tomcat-6.0-doc/virtual-hosting-howto.html




>
> > 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.
>
>
>

I've just created a host using the host manager. And deployed a war. I don't
see such a file. just the manager.xml



> > 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).
>
>
Understood for server.xml is the same true of the context files though?

RE: Host Manager.

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Wesley Acheson [mailto:wesley.acheson@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).

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers.


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


Re: Host Manager.

Posted by Mark Thomas <ma...@apache.org>.
On 02/09/2010 23:14, Christopher Schultz wrote:
> Jeffrey,
> 
> On 9/2/2010 5:40 PM, Jeffrey Janner wrote:
>> I'd be happy if it just wrote out a new file based on the settings at
>> the time I said save -- damn the comments.
>> At least then, it's a pretty straight-forward bit of save code.
>> But, if you're one of those who has to save the commentary that's
>> already there, then have fun.
> 
> It doesn't seem unreasonable to persist the comments: they're XML
> elements, too. If you can write code to parse and insert elements into
> an XML tree, you can afford to keep the comments in there, too.

There is some code that tries to save server.xml in the 5.5. tree. It
was used by the admin app.

Mark

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


Re: Host Manager.

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Jeffrey,

On 9/2/2010 5:40 PM, Jeffrey Janner wrote:
> I'd be happy if it just wrote out a new file based on the settings at
> the time I said save -- damn the comments.
> At least then, it's a pretty straight-forward bit of save code.
> But, if you're one of those who has to save the commentary that's
> already there, then have fun.

It doesn't seem unreasonable to persist the comments: they're XML
elements, too. If you can write code to parse and insert elements into
an XML tree, you can afford to keep the comments in there, too.

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkyAIbUACgkQ9CaO5/Lv0PCh0ACdFLsEc5231/hM8bD1Ajx9AOq7
+hcAoIkwLr+vFJ0+sO6SYa67bAfvv1qc
=amdL
-----END PGP SIGNATURE-----

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


RE: Host Manager.

Posted by Jeffrey Janner <Je...@PolyDyne.com>.
I'd be happy if it just wrote out a new file based on the settings at
the time I said save -- damn the comments.
At least then, it's a pretty straight-forward bit of save code.
But, if you're one of those who has to save the commentary that's
already there, then have fun.
Jeff

> -----Original Message-----
> From: Wesley Acheson [mailto:wesley.acheson@gmail.com]
> Sent: Thursday, September 02, 2010 2:40 PM
> To: Tomcat Users List
> Subject: Host Manager.
> 
> Few Questions
> 
> Is there is no documentation for the host-manager?
> 
> If I remember correctly from this list it doesn't persist its settings
> is
> that correct?
> 
> How many people would be interested in it persisting its settings, by
> editing the appropriate files.
> 
> Final question.
> 
> Is that in theory possible? to add the folder structure and the
> appropiate
> context.xml files. Would it interfere too badly with tomcat while it
> was
> running?
> 
> I really like the idea of the host manager. If it persisted its
> features I
> may actually have used it.
> 
> Regards,
> 
> Wes
__________________________________________________________________________

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-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org