tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Craig R. McClanahan" <craig...@apache.org>
Subject Re: TC4 base dir
Date Fri, 24 Aug 2001 20:17:03 GMT


On Fri, 24 Aug 2001, Rob S. wrote:

> Date: Fri, 24 Aug 2001 12:41:00 PDT
> From: Rob S. <rslifka@sfu.ca>
> Reply-To: tomcat-dev@jakarta.apache.org, Rob S. <rslifka@sfu.ca>
> To: tomcat-dev@jakarta.apache.org
> Subject: Re: TC4 base dir
>
> > > That's cool about the server.xml file, and you can do the individual
> > > elements, as you said (logger, default valve's logger for access,
> > > etc.) but what I'm wondering about is if there's anything analogous to
> > > changing the entire base dir (not just apps, but entire thing a la
> > > 3.x) ?
> >
> > The entire base directory is wherever the CATALINA_HOME environment
> > variable says it is, if you have that defined already.	I have my
> > CATALINA_HOME always set, so that I can have little scripts like
> > "catstart" to start it on demand from whatever directory I'm in:
> >
> >   $CATALINA_HOME/bin/catalina.sh start $@
>
> Ok my last try since I think I'm not being clear enough =)
>
> TC 3.x has this:
>
> <!--
>     You can add a "home" attribute to represent the "base" for
>     all relative paths. If none is set, the TOMCAT_HOME property
>     will be used, and if not set "." will be used.
>     webapps/, work/ and logs/ will be relative to this ( unless
>     set explicitely to absolute paths ).
> -->
> <ContextManager debug="0" home="/home/rslifka/slifka-tomcat" showDebugInfo="
> true">
>
> ...allowing me to use a single $TOMCAT_HOME/conf, /bin, etc. dir, but
> many instances of /webapps, /work and /logs spread out wherever I
> like.  If Catalina has this something similar, then I'd like to make
> sure I document it in my "Running Multiple Instances" doc =)
>
> - r
>
>

No, Tomcat 4 doesn't currently have a thing like "home" -- patches are
welcome!  But, my point is you don't *need* "home" to accomplish the
goals you have articulated:

* For spreading webapp directories around, you have two options:

  - Use an absolute path for the <Context docBase="..."/> attribute

  - Use an absolute path for the <Host appBase="..."/> attribute
    to set the base directory for all apps on that particular
    virtual host, and let the contexts inside stay relative to that.
    You'll note that in the default configuration, appBase is set
    to "webapps" which (since it is relative) is resolved against
    $CATALINA_HOME.

    NOTE:  automatic context loading works in the "appBase" directory
    of every <Host> that you define.

* For spearding logs around, use the "directory" attribute on your
  <Logger> elements.  Default value is "$CATALINA_HOME/logs".

* For spreading work directories around, use the "workDir" attribute
  on your <Context> elements.  Default is calculated based on
  "$CATALINA_HOME/work" and then adding directory levels for the
  virtual host and the context path (minus the slash).

The only things that are fixed is that the following directories are
always assumed to be relative to $CATALINA_HOME:
* bin
* classes
* common/classes
* common/lib
* conf
* jasper
* lib
* server/classes
* server/lib

Everything else is just convenient defaults, whose values were initially
selected to be familiar to Tomcat 3.x users.

Craig



Mime
View raw message