On Tue, 8 Jan 2002, Jonathan C. Detert wrote:

> Date: Tue, 8 Jan 2002 17:13:05 -0600
> From: Jonathan C. Detert <[EMAIL PROTECTED]>
> Reply-To: Tomcat Users List <[EMAIL PROTECTED]>
> To: [EMAIL PROTECTED]
> Subject: how to deploy WebApps in apache's UserDir's ?
>
> Hello All,
>
> I've got apache and tomcat working together successfully, arriving at
> this state by doing this :
>
>         I downloaded the binary jakarta-tomcat-4.0.1.tar.gz and
>         webapp-module-1.0-tc40-linux-glibc2.2.tar.gz from jakarta.apache.org.
>         I've installed them, and followed the directions in the INSTALL.txt that
>         came with the later in order to instruct apache how/when to hand-off
>         requests to tomcat.
>
> All good so far.
>
> The sole purpose of the apache server in question is to serve user directories
> (i.e. using the UserDir directive from the mod_userdir module).
>
> I want to enable each user to create his own JSP's and servlets.
>
> So, my question is, what's the best way to do this?
>
> My understanding is this:
>
> - tomcat knows that it can serve stuff found in $CATALINA_HOME/webapps
>
> - i tell apache to hand stuff to tomcat via lines like
>
>         WebAppDeploy newstufftodeploy localconn /newstufftodeploy
>
>   and there must be a dir
>   $CATALINA_HOME/webapps/newstufftodeploy/WEB-INF/classes/
>   for this to work.
>
> But how do I tell apache & tomcat that I have a webapps directory that's
> not in $CATALINA_HOME ?
>
> E.g. I'd like to tell apache that a request like
> http://my.apacheserver.name/~detertj/myexamples/servlet/HelloWorld
> is to be handed off to tomcat, and then, of course, I'd like tomcat to
> know where this is (cuz it's not gonna be in $CATALINA_HOME/webapps) ?
>

You've got two choices:

(1) In the <Context> element, the "docBase" attribute takes either a
relative or an absolute pathname.  If it's relative, then it is resolved
against the "webapps" subdirectory; if absolute, it can be anywhere.
Thus, you can configure one <Context> element for each user that points
into their own directories.

(2) If you use Tomcat stand-alone, you can use the "User Home Directories"
feature to serve files from each user's directory, in the same way that
Apache does it.  For example, I can make the following URL:

  http://localhost:8080/~craigmcc/

resolve to the "public_html" directory in my home directory
(/home/craigmcc on my Linux box), without having to configure them all
individually.  This directory is treated like any other webapp directory,
so it can contain a WEB-INF subdirectory with a web.xml file, and so on.

For more info, see the "Host" page in:

  http://jakarta.apache.org/tomcat/tomcat-4.0-doc/config/


> ATdHvAaNnKcSe,
>
> Jon Detert
> Unix System Administrator, Milwaukee School of Engineering
> 1025 N. Broadway, Milwaukee, Wisconsin 53202
>

Craig


--
To unsubscribe:   <mailto:[EMAIL PROTECTED]>
For additional commands: <mailto:[EMAIL PROTECTED]>
Troubles with the list: <mailto:[EMAIL PROTECTED]>

Reply via email to