tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel M Garland <daniel.garl...@titanemail.com>
Subject Re: Virtual Host and dynamic webapp reloading
Date Wed, 26 Sep 2007 16:32:06 GMT
I've gotta say I've had a miserable time with this one. I've tried 
nearly permutation of configurations in the Tomcat documentation and 
nothing seems to work; either I get the default host or a white blank 
screen.

What I need is for www.mydomain.com to host mywebapp on the default path 
and anotherapp on path /anotherapp

If I have this setup in server.xml, everything works:

...
<Host name="mydomain.com" appBase="webapps/mywebapp"
   unpackWars="true" autoDeploy="true">
   <Context path="" docBase="." debug="0" cookies="false" />
   <Context path="/anotherapp" docBase="../anotherapp" debug="0" />
...

However, to get the dynamic webapp reloading I've been recommended to 
move my <Context> elements out of server.xml. As I am running muliple 
virtual hosts I understand that I cannot use conf/context.xml because 
this applies to all hosts.
So I have tried each of the following, without success:
- creating a conf/Catalina/mydomain.com/mywebapp.xml
- creating a conf/Catalina/mydomain.com/ROOT.xml
- creating a conf/Catalina/mydomain.com/context.xml
- creating a conf/Catalina/mydomain.com/context.xml.default
- creating a META-INF/context.xml in the web app (although I'd prefer to 
sort this out within Tomcat anyway)

I've also tried several variations on the docBase: ".", "mywebapp", the 
absolute path, the absolute path to the .war file...

I mean, why wouldn't this work?
in conf/server.xml:
<Host name="mydomain.com" appBase="webapps/mywebapp" unpackWars="true">
in conf/Catalina/mydomain.com/mywebapp.xml:
<Context path="" docBase="." debug="0" />

Any ideas on how I can achieve the equivalent of my working server.xml 
with nested Contexts in some other file?
Regards
Dan Garland

Pid wrote:
> Daniel M Garland wrote:
>> My full <host> element then:
> 
> yeah...
> 
> remove the context defs from server.xml and put them in
> META-INF/context.xml, which is a dir/file inside your webapp.
> 
> this method of defining contexts is not encouraged, because you have to
> restart the server to reload the config, amongst other reasons.
> 
> the default web app is called ROOT.war, your other one would be
> asmalljspapp.war. put both files in the appBase dir.
> 
> when it unpacks, it'll drop the contexts like so:
> 
> appBase/ROOT/META-INF/context.xml
> appBase/asmalljspapp/META-INF/context.xml
> 
> i strongly recommend that you have a read of the Context config stuff in
> the docs.  you'll need to set reloadable="true".
> 
> http://tomcat.apache.org/tomcat-5.5-doc/config/context.html
> 
> 
> p
> 
> 
> 
>> <Host name="mydomain.com" appBase="webapps/mywebapp" unpackWars="true"
>> autoDeploy="true">
>>          <Context path="" docBase="." debug="0" cookies="false" />
>>          <Context path="/asmalljspapp" docBase="../smalljspapp"
>> debug="0" />
>>          <Alias>www.myvirtualhost.com</Alias>
>>          <Alias>subdomain.myvirtualhost.com</Alias>
>>
>>          <Cluster
>> className="org.apache.catalina.cluster.tcp.SimpleTcpCluster"
>>
>> managerClassName="org.apache.catalina.cluster.session.DeltaManager"
>>                  expireSessionsOnShutdown="false"
>>                  useDirtyFlag="true"
>>                  notifyListenersOnReplication="true">
>>
>>             <Membership
>>                 className="org.apache.catalina.cluster.mcast.McastService"
>>                 mcastAddr="228.0.0.5"
>>                 mcastPort="45565"
>>                 mcastFrequency="500"
>>                 mcastDropTime="3000"/>
>>
>>             <Receiver
>>
>> className="org.apache.catalina.cluster.tcp.ReplicationListener"
>>                 tcpListenAddress="10.78.1.43"
>>                 tcpListenPort="4002"
>>                 tcpSelectorTimeout="100"
>>                 tcpThreadCount="6"/>
>>
>>             <Sender
>>
>> className="org.apache.catalina.cluster.tcp.ReplicationTransmitter"
>>                 replicationMode="pooled"
>>                 ackTimeout="15000"
>>                 stateTransferTimeout="45"
>>                 waitForAck="true"/>
>>
>>             <Valve
>> className="org.apache.catalina.cluster.tcp.ReplicationValve"
>>
>> filter=".*\.gif;.*\.js;.*\.jpg;.*\.png;.*\.css;.*\.txt;"/>
>>
>>             <ClusterListener
>> className="org.apache.catalina.cluster.session.ClusterSessionListener"/>
>>         </Cluster>
>>       </Host>
>>
>> Any ideas?
>>
>> Pid wrote:
>>> Daniel M Garland wrote:
>>>> Hello,
>>>>
>>>> I have a virtual host configured on my Tomcat 5.5.20 cluster
>>>> installation.
>>>>
>>>> In my server.xml, I have
>>>>
>>>> <Host name="mydomain.com" appBase="webapps/mywebapp" unpackWars="true"
>>>> autoDeploy="true">
>>> What config do you have in your Context(s)?
>>>
>>> p
>>>
>>>> And yet if I copy in a new war file (I'm using ant's deploy task) I
>>>> don't see any changes to my webapp. If I look at the individual server's
>>>> webapp via the manager application, I see the changes; but I don't see
>>>> any changes by looking at the virtual host address until I restart
>>>> Tomcat.
>>>>
>>>> Why?
>>>>
>>>> Thanks in advance.
>>>> Dan Garland
>>>> daniel.garland@NO-SPAMtitanemail.com
>>>>
>>>> ______________________________________________________________________
>>>> This email has been scanned by the MessageLabs Email Security System.
>>>> For more information please visit http://www.messagelabs.com/email
>>>> ______________________________________________________________________
>>>>
>>>> ---------------------------------------------------------------------
>>>> To start a new topic, e-mail: users@tomcat.apache.org
>>>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>>>> For additional commands, e-mail: users-help@tomcat.apache.org
>>>>
>>>>
>>>
>>> ---------------------------------------------------------------------
>>> To start a new topic, e-mail: users@tomcat.apache.org
>>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>>> For additional commands, e-mail: users-help@tomcat.apache.org
>>>
>>>
>>> ______________________________________________________________________
>>> This email has been scanned by the MessageLabs Email Security System.
>>> For more information please visit http://www.messagelabs.com/email
>>> ______________________________________________________________________
>>>
>> ______________________________________________________________________
>> This email has been scanned by the MessageLabs Email Security System.
>> For more information please visit http://www.messagelabs.com/email
>> ______________________________________________________________________
>>
>> ---------------------------------------------------------------------
>> To start a new topic, e-mail: users@tomcat.apache.org
>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>> For additional commands, e-mail: users-help@tomcat.apache.org
>>
>>
> 
> 
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 
> 
> ______________________________________________________________________
> This email has been scanned by the MessageLabs Email Security System.
> For more information please visit http://www.messagelabs.com/email 
> ______________________________________________________________________
> 

______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email 
______________________________________________________________________

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


Mime
View raw message