Brian S. Wallace <[EMAIL PROTECTED]> wrote:
>I'm confused on how to best setup Apache Jserv for multiple developers.
>The relationship between zones, repositories, classes and directories is
>not clear to me (yes, I have read the documentation).

It is very confusing. A respository is just a place that jserv looks for
Java class files, essentially the same as a class path. A zone is a way for
jserv to map the leading portion of a URL to a unique properties file for
the zone.

Properties files for zones are automatically reloaded when modified. Adding
new zones requires restarting the webserver since mod_jserv (the C side
that runs inside Apache) needs reload the the ApJServMount directives in
httpd.conf and the main jserv.properties file. Sometimes you need to reload
the server even after only modifying a zone properties file because jserv
gets old class info stuck in its memory and won't let go of it (this is a
bug, but I haven't spent the time to track it down or properly characterize
it).

To set things up for each developer, you need to define a zone for each
developer. Let's say we have three developers: Brian, Alice, and Bob.

In httpd.conf:

ApJServMount /servlets/brian /brian
ApJServMount /servlets/alice /alice
ApJServMount /servlets/bob /bob

In jserv.properties:

wrapper.bin=/usr/local/java/jdk/bin/java
wrapper.classpath=/usr/local/jserv/lib/Apache-JServ.jar
wrapper.classpath=/usr/local/java/lib/jsdk.jar
wrapper.classpath=...classes you want everyone to share...
...
zones=brian
brian.properties=/home/brian/servlets/jserv.brian.properties
zones=alice
alice.properties=/home/alice/servlets/jserv.alice.properties
zones=bob
bob.properties=/home/bob/servlets/jserv.bob.properties

In brian.properties:

repositories=/home/brian/servlets
repositories=/home/brian/java/brian-classes.jar
servlet.foo.code=gov.ornl.brian.foo
servlet.foo.initArgs=foobar=3

In alice.properties:

repositories=/home/bob/servlets
repositories=/home/bob/java/alice-classes.jar
servlet.foo.code=gov.ornl.alice.foo
servlet.foo.initArgs=foobar=3

and so forth for any additional developers.

To access each user's servlets, you would use a url like:

http://www.ornl.gov/servlets/user

where user can be Brian, Alice, Bob, etc.

You may need to add a Location directive to grant access to these URLs.
You'll know you need one if you get access denied errors after setting up
these URLs:

        <Location /servlets/*>
                allow from all
        </Location>

(or allow from whatever restricted domains you prefer.)

You can also setup separate virtual hosts for each user, in which case you
might end up with

www.brian.ornl.gov/servlets
www.alice.ornl.gov/servlets
www.alice.ornl.gov/servlets
etc.

Setting up virtual hosts is a related but separate topic. The preceding
steps should get you started using a single apache host.

-- Ari Halberstadt mailto:[EMAIL PROTECTED] <http://www.magiccookie.com/>
PGP public key available at <http://www.magiccookie.com/pgpkey.txt>




----------------------------------------------------------------
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
Archives and Other:  <http://www.working-dogs.com/>
Problems?:           [EMAIL PROTECTED]

Reply via email to