Chris,

I have been looking for the same solution.  Can you share
what you had learn?  Would you able to put together a howto
on this topic? I think it will be a great benefit to the 
rest of us.

Thanks much,

Tom



---- Original message ----
>Date: Tue, 30 May 2006 13:57:18 +0100 (BST)
>From: Chris Walker <[EMAIL PROTECTED]>  
>Subject: Re: Tomcat 5.5 Context Files  
>To: Tomcat Users List <users@tomcat.apache.org>
>
>After following up the advice from David and others, I
>think I've got the configuration I need.  I'm posting
>a minimal version of the setup as it seems to me that
>this might be a fairly common requirement:
>
>- I'm running two applications on a single server;
>each has its own domain name.  
>
>- Within each application there may be one or more
>contexts, corresponding to different versions of the
>webapp (used by different customers).
>
>- Various site-specific parameters need to be set
>within the context, where they will override values in
>web.xml.
>
>- I don't want any kind of auto deployment
>
>server.xml
>----------
><Server port="8005" shutdown="SHUTDOWN">
>
>  <Service name="Catalina">
>    <Connector port="8080" />
>
>    <Engine name="Catalina" defaultHost="host1">
>
>      <!-- it seems that if both autoDeploy and
>deployOnStartup are false, the host returns empty
>pages, but if either one is false then it's OK -->
>      <Host name="host1" appBase="noapps"
>autoDeploy="false" unpackWARs="false"
>deployXML="false" />
>      <Host name="host2" appBase="noapps"
>autoDeploy="false" unpackWARs="false"
>deployXML="false" />
>
>    </Engine>
>    
>  </Service>
></Server>
>
>directory structure
>-------------------
>{catalina_home}
>  conf
>    Catalina
>      host1
>        ROOT.xml: <Context
>docBase="${catalina.home}/ibo/ibo3" />
>        ibo4.xml: <Context
>docBase="${catalina.home}/ibo/ibo4" />
>        ...
>      host2
>        ROOT.xml: <Context
>docBase="${catalina.home}/cbo/cbo.1.23.45" />
>        ...
>  noapps
>    [nothing in here - would appBase="dev/null" work?]
>  ibo
>    ibo3
>      WEB-INF
>    ibo4
>      WEB-INF
>  cbo
>    cbo.1.23.45
>      WEB-INF
>      
>I seem to have problems if the context directories
>aren't below ${catalina.home}, but this I can live
>with.
> 
>Thanks to all who helped.
> 
>Chris
>--- David Smith <[EMAIL PROTECTED]> wrote:
>
>> Some thoughts:
>> 
>> 1. The naming of all the associated files with your
>> webapp should be
>> consistent with the path attribute of the context
>> element (assuming ibo4
>> is it's name):
>>     Context xml file should be named ibo4.xml
>>     The webapp's directory should be named ibo4
>>     If deploying from a .war file, the .war file
>> should be named ibo4.war.
>> 
>> 2. The name of the root application is ROOT (case
>> sensitive), so if this
>> is to be the webapp to respond on request to /*, the
>> war file, context
>> xml file, and the webapp's folder should all be
>> named ROOT (ROOT.xml,
>> ROOT.war, webapps/ROOT).
>> 
>> It should also be noted that with the context xml
>> file in
>> config/Catalina/www.iboserver.com/ibo4.xml, the path
>> and docbase
>> attributes may be ignored under tomcat 5.5.  Open
>> your manager webapp to
>> see what's deployed and under what names.
>> 
>> --David
>> 
>> Chris Walker wrote:
>> 
>> >Thanks Mark.  I noticed that, but my objective is
>> to
>> >store configuration parameters that are
>> >platform-specific outside the webapp.  The stuff in
>> >the server's context definitions nicely overrides
>> >anything in web.xml.
>> >
>> >Chris
>> >
>> >--- Mark Petrovic <[EMAIL PROTECTED]> wrote:
>> >
>> >  
>> >
>> >>Hi.
>> >>
>> >>Context fragments can also be put in your webapp's
>> >>META-INF directory, per
>> >>the 4th bullet item here
>> >>
>> >>
>> >>    
>> >>
>>
>>http://tomcat.apache.org/tomcat-5.5-doc/config/context.html
>> >  
>> >
>> >>E.g.,
>> >>
>> >>pluto:PGCRM> jar tf dist/crmrpc.war |head -3
>> >>META-INF/
>> >>META-INF/MANIFEST.MF
>> >>META-INF/context.xml
>> >>
>> >>where context.xml contains, in my particular case,
>> a
>> >>JDBC resource
>> >>definition
>> >>
>> >><Context path="/crmrpc" debug="5"
>> reloadable="true"
>> >>crossContext="true">
>> >>   <Resource
>> >>      name="jdbc/crm"
>> >>      auth="Container"
>> >>      type="javax.sql.DataSource"
>> >>      maxActive="100"
>> >>      maxIdle="30"
>> >>      maxWait="10000"
>> >>      username="u"
>> >>      password="p"
>> >>      driverClassName="com.mysql.jdbc.Driver"
>> >>     
>> >>
>> >>    
>> >>
>>
>>url="jdbc:mysql://localhost:3306/cm?autoReconnect=true"
>> >  
>> >
>> >>      />
>> >></Context>
>> >>
>> >>
>> >>On 5/29/06, Chris Walker
>> <[EMAIL PROTECTED]>
>> >>wrote:
>> >>    
>> >>
>> >>>Hello,
>> >>>
>> >>>I have just migrated a family of webapps from
>> >>>      
>> >>>
>> >>Tomcat 4 to Tomcat 5.5
>> >>    
>> >>
>> >>>.  It's
>> >>>working OK, but reading through the documentation
>> >>>      
>> >>>
>> >>I see there is a
>> >>    
>> >>
>> >>>recommendation that I remove the <Context>
>> >>>      
>> >>>
>> >>sections from server.xml and
>> >>    
>> >>
>> >>>put
>> >>>them in files in
>> >>>      
>> >>>
>> >>{catalina_root}/conf/[engine]/[Host].
>> >>    
>> >>
>> >>>But when I do this I find that each of the
>> >>>      
>> >>>
>> >>contexts just responds with an
>> >>    
>> >>
>> >>>empty HTML page - no HTTP error, and nothing in
>> >>>      
>> >>>
>> >>any of the Tomcat logs to
>> >>    
>> >>
>> >>>suggest an error.  This is the response:
>> >>>
>> >>>
>> >>>
>> >>>      
>> >>>
>>
>>-----------------------------------------------------------
-----------------
>> >  
>> >
>> >>>---
>> >>><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0
>> >>>      
>> >>>
>> >>Transitional//EN">
>> >>    
>> >>
>> >>><HTML><HEAD>
>> >>><META http-equiv=Content-Type content="text/html;
>> >>>charset=windows-1252"></HEAD>
>> >>><BODY></BODY></HTML>
>> >>>
>> >>>
>> >>>      
>> >>>
>>
>>-----------------------------------------------------------
-----------------
>> >  
>> >
>> >>>---
>> >>>
>> >>>I've tried various names for the context XML
>> >>>      
>> >>>
>> >>files, and I've tried
>> >>    
>> >>
>> >>>specifying an absolute path for the context
>> >>>      
>> >>>
>> >>docBase, but it seems to make
>> >>    
>> >>
>> >>>no
>> >>>difference.
>> >>>
>> >>>Can anybody suggest what I'm doing wrong?
>> >>>
>> >>>Chris Walker
>> >>>
>> >>>
>> >>>
>> >>>      
>> >>>
>>
>>-----------------------------------------------------------
-----------------
>> >  
>> >
>> >>>---
>> >>>This is my server.xml after modification:
>> >>>
>> >>><Server port="8005" shutdown="SHUTDOWN">
>> >>>
>> >>>  <Service name="Catalina">
>> >>>
>> >>>    <Connector port="80"
>> 
>=== message truncated ===
>
>
>------------------------------------------------------------
---------
>To start a new topic, e-mail: users@tomcat.apache.org
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: users-
[EMAIL PROTECTED]
>

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

Reply via email to