Re: TC4 base dir

2001-08-27 Thread Endre Stølsvik

On Fri, 24 Aug 2001, Craig R. McClanahan wrote:

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

In my setup I have a couple of developers which need their own instance of
Tomcat. It's very inconvenint that you _have_ to install tomcat at the
place where you want to run it, and thus cannot handle tomcat as just
another binary, which you just run with some options or env-vars set
correctly.

And apparently it's just a few env-variables that isn't handled quite
correctly that messes up everything. I remeber that I managed to get it to
run with another server.xml file (or whatever it's called), but it
requeried some variable to be set to the install dir (CATALINA_HOME?). But
doing this made it scan the install-webapps dir, starting up all those
webapps that are bundled with the dist.

Basically, what it lacks is a distinct CATALINA_HOME, which points to
where it's installed (keeping with the naming of the JAVA_HOME variable?)
and a CATALINA_WORK or similar, where it's running. These two variables
are treated very inconsistent now, and have (as I remeber it) to point to
the same location to work properly.

This is such a banal feature that I cannot understand why it isn't
implemented. There have been others requesting this too! And I know your
answer, revolving around scratch your own bleedin' itch!! ;), but sadly
I currently don't have time to sit down and understand all that startup
stuff, no matter how much I'd like to do just that. I do actually believe
that folks that know the startup sequence of Tomcat4 could change this
behaviour in about 5 minutes.

I hope that this is _fixed_ before you go final.


-- 
Mvh,
Endre





Re: TC4 base dir

2001-08-27 Thread Geoff Soutter

Craig R. McClanahan [EMAIL PROTECTED] wrote:
 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:

while we are on a related topic, how about (re) considering this patch?

geoff

- Original Message -
From: Geoff Soutter [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, June 19, 2001 1:36 PM
Subject: [t4] [patch] for inconvenient -config current dir


 Hi there,

 As I've been twiddling with T4 again recently this problem has resurfaced.
 In T3, I was able to specify the -config option relative to my current
 directory. T4 has changed this so that a relative path used with -config
is
 resolved relative to CATALINA_HOME.

 I find this annoying because I like to store my server.xml files into our
 version control system, and it means that relative paths from my VCS work
 dir to the server.xml don't work any more. I have to use something like
 /vcs work dir/tomcat4/server.xml. Now, if you use an IDE to debug your
 servlet in Tomcat, you need to enter this path into the config. And that
 means that every time you create a new work dir, you need to update your
IDE
 project file.

 So, can we please change back to -config relative to the CWD the way
 Tomcat 3 worked? Or perhaps at least get it to check for it relative to
CWD
 before checking relative to CATALINA_HOME?

 All thats required is to remove/change the absolute path stuff in the
 configFile() method of Catalina.java like so:

 protected File configFile() {
   File file = new File(configFile);
   /*
   NOTE: alternatively use !file.exists() here for fallback
   from CWD to CATALINA_HOME
   if (!file.isAbsolute())
 file = new File(System.getProperty(catalina.home) +
   File.separator + configFile);
   */
   return (file);
 }

 Geoff





Re: TC4 base dir

2001-08-27 Thread Craig R. McClanahan



On Mon, 27 Aug 2001, Geoff Soutter wrote:


 while we are on a related topic, how about (re) considering this patch?


The patch below deals with only one of 33 places that the catalina.home
system property is referenced in the Catalina source code -- I think we'd
want to consider them all :-).

In order to support the idea of one install of Tomcat 4 being used for
more than one configuration, we have to decide which subdirectories of
$CATALINA_HOME should be made relative to some new location (specified by
a command line option or a different environment variable).  Here's my
proposed breakdown:

All of the following directories would be considered part of the static
part of a Tomcat 4 installation, and would remain relative to
$CATALINA_HOME (and thus shared by all uses):

bin/
classes/
common/
classes/
lib/
jasper/
lib/
server/

All of the following directories, unless configured to absolute paths,
would be resolved relative to a new $CATALINA_BASE directory (defaults to
$CATALINA_HOME if not set) that would be used to configure a new
catalina.base system property:

conf/
logs/
webapps/
work/

With this arrangement, all of the binaries and Java classes installed in
$CATALINA_HOME would be shared by all uses, but the configuration files,
log files, web applications, and work directories would be unique.

Does that sound like the right breakdown?

 geoff


Craig




Re: TC4 base dir

2001-08-27 Thread Geoff Soutter

Craig R. McClanahan [EMAIL PROTECTED] wrote:
 The patch below deals with only one of 33 places that the catalina.home
 system property is referenced in the Catalina source code -- I think we'd
 want to consider them all :-).

Yeah, I know, I was just scratching the itch that I had at the time. ;-)

 In order to support the idea of one install of Tomcat 4 being used for
 more than one configuration, we have to decide which subdirectories of
 $CATALINA_HOME should be made relative to some new location (specified by
 a command line option or a different environment variable).  Here's my
 proposed breakdown:

Sounds good to me!

Cheers

Geoff








Re: TC4 base dir

2001-08-24 Thread Craig R. McClanahan



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

 Date: Fri, 24 Aug 2001 8:14:32 PDT
 From: Rob S. [EMAIL PROTECTED]
 Reply-To: [EMAIL PROTECTED], Rob S. [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Subject: TC4 base dir

 In TC3, you can change the base dir in server.xml, so that a new set
 of /logs, /webapps, and /work would be created and used somewhere
 else.  In TC4, all I see is the appBase attribute for each Host.
 As well, there aren't any command-line params that I noticed in the
 startup class aside from -config.

 Can I assume that no apparent way to set it and no command-line param
 means that it's not configurable?

 I'm cool with that, I'm just writing some docs for us right now and
 want to be thorough!

 - r



There is no current means to point at a server.xml file that is not
under $CATALINA_HOME/conf, but that has nothing to do with where log
files go (except by default) -- in your Logger elements, just add a
directory attribute.  The default value is logs (relative paths are
resolved against $CATALINA_HOME), but you can use an relative or absolute
path to a directory that you would like.

Craig





Re: TC4 base dir

2001-08-24 Thread Rob S.

 There is no current means to point at a server.xml file that is not
 under $CATALINA_HOME/conf, but that has nothing to do with where log
 files go (except by default) -- in your Logger elements, just add a
 directory attribute.The default value is logs (relative paths are
 resolved against $CATALINA_HOME), but you can use an relative or absolute
 path to a directory that you would like.

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

- r




Re: TC4 base dir

2001-08-24 Thread Rob S.

  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




Re: TC4 base dir

2001-08-24 Thread Craig R. McClanahan



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

 Date: Fri, 24 Aug 2001 12:41:00 PDT
 From: Rob S. [EMAIL PROTECTED]
 Reply-To: [EMAIL PROTECTED], Rob S. [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 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





Re: TC4 base dir

2001-08-24 Thread Rob S.

 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:

Awesome!  Thanks for the detailed reply =)

- r