You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by gb1071nx <gb...@globallyboundless.com> on 2007/03/22 20:29:57 UTC

migrating from 5.0 to 5.5 - Configuring Contexts, Hosts, etc

I'm just looking into what it takes to both migrate to TC5.5, and switch
from configuring everything in server.xml to individual context files.
I've read the docs on contexts, hosts, and that Virtual Hosting guide. 

I have some misunderstandings still about how it all works together.
Hoping someone can help.


 
Documentation quotes are from: 
http://tomcat.apache.org/tomcat-5.5-doc/config/host.html
 
" 
The auto deployer will also track web applications for the following
changes: 

<snipped two irrelevant bullets>

*	An update to a XML configuration file will trigger an undeploy
(without the removal of any expanded directory), followed by a
deployment of the associated web application 
"

This is actually the only behaviour of the "auto deployer" that I'm
really interested in, and would be my main motivation for switching from
server.xml config to individual context.xml config files.  I'd like to
be able to change config of an application , without having to bounce
the whole server.

1st Q:
The only way for tomcat to monitor that context.xml file and have it
reload it automatically is to have  deployOnStartup=true (the default).
True/False?


2nd Q:
Can I define a host and *not* set appBase?  (I seem to be able to do so
with Tomcat 5.0)



The next two questions have to do with these two sentences in the docs
(they appear one right after the other in the docs)

"
When using automatic deployment, the docBase defined by an XML Context
file should be outside of the appBase directory. If this is not the case
difficulties may be experienced deploying the web application or the
application may be deployed twice.

Finally, note that if you are defining contexts explicitly, you should
probably turn off automatic application deployment. Otherwise, your
context will be deployed twice each, and that may cause problems for
your app. 
"



3rd Q: 
Assume all the following:  

  a) <Host appbase="/home/websites/" name="www.mysite.com">
  b) <Host appbase="/home/websites/" name="www.mysite2.com">
  c) $CATALINA_HOME/conf/Catalina/www.mysite.com/ROOT.xml
      with a docBase attribute of "/home/websites/www.mysite.com"
  d) $CATALINA_HOME/conf/Catalina/www.mysite2.com/ROOT.xml
     with a docBase attribute of "/home/websites/www.mysite2.com"
  e) deployOnStartup=true

Would tomcat then attempt to deploy both www.mysite.com and
www.mysite2.com as websites under each Host?   I assume that's what the
first sentence is warning us about?


4th Q: 
Is there any circumstance, in which I can get the behaviour I want from
my first question, and yet turn off the auto-deploy (as seems to be
indicated by the second sentence)?  As a secondary question, why is it
now "_will be_ deployed twice", while the previous sentence talked about
"_may be_ deployed twice"?   Will it, or won't it? 


 
Thanks.



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