You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by John Wadkin <j....@hud.ac.uk> on 2002/05/07 20:40:25 UTC

RE: Is Tomcat-Apache server Engine's "appBase" parameter irreleva nt?

You make no mention of docBase, so I'm guessing (!) that you've confused
appBase with docBase?

>From docs for TC 4.0:

docBase

The Document Base (also known as the Context Root) directory for this web
application, or the pathname to the web application archive file (if this
web application is being executed directly from the WAR file). You may
specify an absolute pathname for this directory or WAR file, or a pathname
that is relative to the appBase directory of the owning Host.

appBase

The Application Base directory for this virtual host. This is the pathname
of a directory that may contain web applications to be deployed on this
virtual host. You may specify an absolute pathname for this directory, or a
pathname that is relative to the $CATALINA_HOME directory. See Automatic
Application Deployment for more information on automatic recognition and
deployment of web applications to be deployed automatically.

So:

appBase="webapps" would be relative to CATALINA_HOME - in my case,
/usr/local/tomcat

and

docBase="manager"

would be relative to the appBase, which is relative to CATALINA_HOME :) I.e.


/usr/local/tomcat/webapps/manager
         ^          ^        ^
   CATALINA_HOME appBase  docBase   


Taking Exp. 1:

appBase: /export/home/jeff/tomcat
docBase: test.war

should work... Not sure if appBase is optional when the value for docBase is
absolute, best to specify both anyway.

AppBase is an attribute of <host> and docBase of <context>

Thanks,
 
John


-----Original Message-----
From: Jeff [mailto:jefflists@tiaxa.net]
Sent: 07 May 2002 19:20
To: Tomcat Users List
Subject: Is Tomcat-Apache server Engine's "appBase" parameter
irrelevant?


I've been experimenting all morning trying to get Tomcat (4.03) + mod_webapp
with Apache (1.3.19) to deploy apps ANYWHERE besides
/usr/local/tomcat/webapps to no avail. From what I can tell, the Engine
config block seems to be completely ignoring the appBase parameter.

At first, I thought it was an issue with relative-vs-absolute pathnames.
However, I've tried the following experiments, and gotten the following
results:

For all experiments, WebAppDeploy in httpd.conf was:
LoadModule webapp_module libexec/mod_webapp.so
AddModule mod_webapp.c
WebAppConnection tomcat warp localhost:8008

accompanied by the following inside the VirtualHost container:
WebAppDeploy test tomcat /test/

The default webapp directory is /usr/local/tomcat/webapp...
/usr/local/tomcat is a symlink to /usr/local/jakarta-tomcat-4.0.3-LE-jdk14

Tomcat was shut down and restarted before each experiment.

Experiment 1:
appBase = "/export/home/jeff/tomcat"
warfile = "/export/home/jeff/tomcat/test.war"

result:
Cannot find "/usr/local/jakarta-tomcat-4.0.3-LE-jdk14/webapps/test" for
appl. "test" host "tomcat.i300.net"

Experiment 2:
created symlink from /usr/local/tomcat/webapp/tomcat to
/export/home/jeff/tomcat
appBase = "tomcat" (trying a relative path)
warfile = "/export/home/jeff/tomcat/test.war" (or, if you prefer,
$APPBASE/test.war since $APPBASE was theoretically supposed to have been
/usr/local/tomcat/webapps/tomcat)

result:
Cannot find "/usr/local/jakarta-tomcat-4.0.3-LE-jdk14/webapps/test" for
appl. "test" host "tomcat.i300.net"

Experiment 3:
(replaced symlink to /export/home/jeff/tomcat with a real directory:
/usr/local/tomcat/webapps/tomcat)
appBase = "tomcat" (still a relative path... theoretically resolving to
/usr/local/tomcat/webapps/tomcat)
warfile = "/usr/local/tomcat/webapps/tomcat/test.war"

result:
Cannot find "/usr/local/jakarta-tomcat-4.0.3-LE-jdk14/webapps/test" for
appl. "test" host "tomcat.i300.net"

Experiment 4:
(moved warfile up a level)
appBase = "tomcat" (unchanged)
warfile = "/usr/local/tomcat/webapps/test.war"

result:
worked... but &#$@(*& Tomcat deployed it into /usr/local/tomcat/webapps/test
insted of /usr/local/tomcat/webapps/tomcat/test

Experiment 5:
(changed appBase to completely bogus value to see whether Tomcat would even
notice, and deleted /usr/local/tomcat/webapps/test to force redeployment
just to make sure I had Tomcat's attention)
appBase = "foo/bar/baz"
warfile = "/usr/local/tomcat/webapps/test.war"

result:
once again, no complaints from Tomcat. It deployed the app into
/usr/local/tomcat/webapps/test.



--
To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
For additional commands, e-mail:
<ma...@jakarta.apache.org>

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Is Tomcat-Apache server Engine's "appBase" parameter irreleva nt?

Posted by Jeff <je...@tiaxa.net>.
I was under the impression that explicitly setting appBase to some
directory, and omitting any reference to docBase, would result in Tomcat
scanning the appBase directory for .war files to autodeploy in the appBase
directory.

As I understand it, the sequence is more or less the following (let me know
if I'm making any wrong assumptions, or at least relying upon artifacts and
side effects that can't be depended upon):

(browser sends request for http://tomcat.i300.net/test/index.jsp)

Apache: "Hey, somebody just requested "test/index.jsp" from the
"tomcat.i300.net" virtual server."
(realizes that requests matching /test/ are supposed to be relayed to Warp)

Apache: "Hey, Warp... I need "index.jsp" from tomcat.i300.net's "test"
webapp.

Warp: "OK, hold on a second..."
(searches server.xml for the Tomcat-Apache container, then looks for an
Engine container specific to "tomcat.i300.net")
(finds it, and discovers that tomcat.i300.net's appBase is supposed to be
"/export/home/jeff/tomcat")

Warp: "Ah, here it is... and it says "appBase" is supposed to be
"/export/home/jeff/tomcat". OK..."
Warp: "Hey, Tomcat... I need index.jsp from the "test" webapp... it's
deployed in /export/home/jeff/tomcat..."

(Tomcat looks for /export/home/jeff/tomcat/test, and doesn't find it)
Tomcat: Meow. (sorry... bad joke...)
Tomcat:  "Hmmm. There's no "test" directory in appBase
(/export/home/jeff/tomcat)... perhaps I should look there for a warfile
named "test.war" in appBase instead, and autodeploy it into appBase's "test"
directory if I find the warfile."
(looks for /export/home/jeff/tomcat/test.war. Finds it.)
(creates /export/home/jeff/tomcat/test)
(deploys /export/home/jeff/tomcat/test.war into
/export/home/jeff/tomcat/test)
(serves /export/home/jeff/tomcat/test/index.jsp to Warp)

(Warp relays the response to Apache)
(Apache relays the response back to the browser).



----- Original Message -----
From: "John Wadkin" <j....@hud.ac.uk>
To: "'Tomcat Users List'" <to...@jakarta.apache.org>
Sent: Tuesday, May 07, 2002 2:40 PM
Subject: RE: Is Tomcat-Apache server Engine's "appBase" parameter irreleva
nt?


> You make no mention of docBase, so I'm guessing (!) that you've confused
> appBase with docBase?
>
> >From docs for TC 4.0:
>
> docBase
>
> The Document Base (also known as the Context Root) directory for this web
> application, or the pathname to the web application archive file (if this
> web application is being executed directly from the WAR file). You may
> specify an absolute pathname for this directory or WAR file, or a pathname
> that is relative to the appBase directory of the owning Host.
>
> appBase
>
> The Application Base directory for this virtual host. This is the pathname
> of a directory that may contain web applications to be deployed on this
> virtual host. You may specify an absolute pathname for this directory, or
a
> pathname that is relative to the $CATALINA_HOME directory. See Automatic
> Application Deployment for more information on automatic recognition and
> deployment of web applications to be deployed automatically.
>
> So:
>
> appBase="webapps" would be relative to CATALINA_HOME - in my case,
> /usr/local/tomcat
>
> and
>
> docBase="manager"
>
> would be relative to the appBase, which is relative to CATALINA_HOME :)
I.e.
>
>
> /usr/local/tomcat/webapps/manager
>          ^          ^        ^
>    CATALINA_HOME appBase  docBase
>
>
> Taking Exp. 1:
>
> appBase: /export/home/jeff/tomcat
> docBase: test.war
>
> should work... Not sure if appBase is optional when the value for docBase
is
> absolute, best to specify both anyway.
>
> AppBase is an attribute of <host> and docBase of <context>
>
> Thanks,
>
> John
>
>
> -----Original Message-----
> From: Jeff [mailto:jefflists@tiaxa.net]
> Sent: 07 May 2002 19:20
> To: Tomcat Users List
> Subject: Is Tomcat-Apache server Engine's "appBase" parameter
> irrelevant?
>
>
> I've been experimenting all morning trying to get Tomcat (4.03) +
mod_webapp
> with Apache (1.3.19) to deploy apps ANYWHERE besides
> /usr/local/tomcat/webapps to no avail. From what I can tell, the Engine
> config block seems to be completely ignoring the appBase parameter.
>
> At first, I thought it was an issue with relative-vs-absolute pathnames.
> However, I've tried the following experiments, and gotten the following
> results:
>
> For all experiments, WebAppDeploy in httpd.conf was:
> LoadModule webapp_module libexec/mod_webapp.so
> AddModule mod_webapp.c
> WebAppConnection tomcat warp localhost:8008
>
> accompanied by the following inside the VirtualHost container:
> WebAppDeploy test tomcat /test/
>
> The default webapp directory is /usr/local/tomcat/webapp...
> /usr/local/tomcat is a symlink to /usr/local/jakarta-tomcat-4.0.3-LE-jdk14
>
> Tomcat was shut down and restarted before each experiment.
>
> Experiment 1:
> appBase = "/export/home/jeff/tomcat"
> warfile = "/export/home/jeff/tomcat/test.war"
>
> result:
> Cannot find "/usr/local/jakarta-tomcat-4.0.3-LE-jdk14/webapps/test" for
> appl. "test" host "tomcat.i300.net"
>
> Experiment 2:
> created symlink from /usr/local/tomcat/webapp/tomcat to
> /export/home/jeff/tomcat
> appBase = "tomcat" (trying a relative path)
> warfile = "/export/home/jeff/tomcat/test.war" (or, if you prefer,
> $APPBASE/test.war since $APPBASE was theoretically supposed to have been
> /usr/local/tomcat/webapps/tomcat)
>
> result:
> Cannot find "/usr/local/jakarta-tomcat-4.0.3-LE-jdk14/webapps/test" for
> appl. "test" host "tomcat.i300.net"
>
> Experiment 3:
> (replaced symlink to /export/home/jeff/tomcat with a real directory:
> /usr/local/tomcat/webapps/tomcat)
> appBase = "tomcat" (still a relative path... theoretically resolving to
> /usr/local/tomcat/webapps/tomcat)
> warfile = "/usr/local/tomcat/webapps/tomcat/test.war"
>
> result:
> Cannot find "/usr/local/jakarta-tomcat-4.0.3-LE-jdk14/webapps/test" for
> appl. "test" host "tomcat.i300.net"
>
> Experiment 4:
> (moved warfile up a level)
> appBase = "tomcat" (unchanged)
> warfile = "/usr/local/tomcat/webapps/test.war"
>
> result:
> worked... but &#$@(*& Tomcat deployed it into
/usr/local/tomcat/webapps/test
> insted of /usr/local/tomcat/webapps/tomcat/test
>
> Experiment 5:
> (changed appBase to completely bogus value to see whether Tomcat would
even
> notice, and deleted /usr/local/tomcat/webapps/test to force redeployment
> just to make sure I had Tomcat's attention)
> appBase = "foo/bar/baz"
> warfile = "/usr/local/tomcat/webapps/test.war"
>
> result:
> once again, no complaints from Tomcat. It deployed the app into
> /usr/local/tomcat/webapps/test.
>
>
>
> --
> To unsubscribe, e-mail:
> <ma...@jakarta.apache.org>
> For additional commands, e-mail:
> <ma...@jakarta.apache.org>
>
> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
> For additional commands, e-mail:
<ma...@jakarta.apache.org>
>
>



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>