Great. Thanks!
-----Original Message-----
From: Ari Halberstadt [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, April 27, 1999 6:39 PM
To: Java Apache Users
Subject: Re: Virtual Hosting for zones?
Stirling Olson <[EMAIL PROTECTED]> wrote:
>If I have one machine with two domains (domain1.com and domain2.com) how I
>can I make www.domain1.com/Servlet/MyContactForm use a different servlet
>than www.domain2.com/Servlet/MyContactForm?
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).
-- 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]
READ THE FAQ!!!! <http://java.apache.org/faq/>
Archives and Other: <http://java.apache.org/main/mail.html/>
Problems?: [EMAIL PROTECTED]
----------------------------------------------------------------
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
READ THE FAQ!!!! <http://java.apache.org/faq/>
Archives and Other: <http://java.apache.org/main/mail.html/>
Problems?: [EMAIL PROTECTED]