Please browse the categories below to previous answers to questions like yours. If you do not find the answer for your particular situation, ask for help on the appropriate mailing list.
(Answer) (Category) Java Apache Project : (Category) Apache JServ 1.0 : (Category) Configuration : (Category) Zones :
I'm hoping to use the same zone name (but as separate zones) for two domains on the same machine.
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
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).
[Append to This Answer]
Previous: (Answer) Zones are confusing me! How do they work?
Next: (Answer) Setting the classpath for each zone.
This document is: http://java.apache.org/faq/?file=129
[Search] [Appearance] [Show Expert Edit Commands]
This is a Faq-O-Matic 2.709.
Please browse the categories below to previous answers to questions like yours. If you do not find the answer for your particular situation, ask for help on the appropriate mailing list.