IDependOn-Set: 1
IDependOn-Set: 129
IDependOn-Set: 143
IDependOn-Set: 2
IDependOn-Set: 36
IDependOn-Set: 53
IDependOn-Set: 7
LastModifiedSecs: 925249578
Parent: 53
SequenceNumber: 5
Title: I'm hoping to use the same zone name (but as separate zones) for two domains on the same machine.
Part: 0
Author-Set: jon@working-dogs.com
HideAttributions: 1
LastModifiedSecs: 925245720
Type: monospaced
Lines: 22
Here is what you want:

in your httpd.conf:

<VirtualHost www.domain1.com>
ApJServMount /servlet /domain1
<VirtualHost>

<VirtualHost www.domain2.com>
ApJServMount /servlet /domain2
<VirtualHost>

in your jserv.properties:
zones=domain1,domain2
domain1.properties=/path/to/domain1.properties
domain2.properties=/path/to/domain2.properties

in your domain1.properties:
repositories=/path/to/directory/with/servlets/class/files/domain1

in your domain2.properties:
repositories=/path/to/directory/with/servlets/class/files/domain2
EndPart: 0
Part: 1
Author-Set: jon@working-dogs.com
HideAttributions: 1
LastModifiedSecs: 925249500
Type: monospaced
Lines: 46
Define a different servlet zone for each domain.

<VirtualHost [IP#]>
        <IfModule mod_jserv.c>
                ApJServDefaultPort 8007
                ApJServAction .gsp /servlets/gsp
                ApJServMount /servlets /domain1
        </IfModule>
</VirtualHost>

<VirtualHost [IP#]>
        <IfModule mod_jserv.c>
                ApJServDefaultPort 8007
                ApJServAction .gsp /servlets/gsp
                ApJServMount /servlets /domain2
        </IfModule>
</VirtualHost>


<IfModule mod_jserv.c>
        ApJServManual off
        ApJServMountCopy on
        ApJServDefaultPort 8007
        ApJServProperties /usr/local/apache/etc/jserv.properties
        ApJServSecretKey /usr/local/apache/etc/jserv.secret.key
        ApJServLogFile /var/log/apache/jserv.log
        ApJServMount /share/servlets /share
        <Location /status/jserv/>
                SetHandler jserv-status
                order deny,allow
                deny from all
                allow from yourdomain.com
        </Location>
</IfModule>

Anything under www.domain1.com/servlets is in zone "domain1" and anything
under www.domain2.com/servlets is in zone "domain2". Each zone has a
separate class loader so each zone has separate servlets. But, the url
anydomain/share/servlets is shared and maps to zone "share", so you can
have a common set of servlets accessible by both virtual hosts, e.g.,
www.domain1.com/share/servlets/emailservlet and
www.domain2.com/share/servlets/emailservlet will both execute the same
servlet. You can carry this further and have anything under /share be
shared among virtual hosts, so www.domain1.com/share/cgi/foocgi and
www.domain2.com/share/cgi/foocgi would run the same cgi script (this is how
I setup my server).
EndPart: 1
