Using ApJServMount with VirtualHosts is totally possible and works perfectly. There is one gotcha which may not be readily obvious - unless you are using a different zone for each site, there's nothing which directly tells your servlet which host it's running for. We use the same header Apache does to support NameVirtualHost, which you can get from a servlet this call:

String site_domain = HttpServletRequest.getHeader("Host");

We set up the servlets so that the code is just passive (all static methods) and we have a universal class from whcih all servlets inherit, with a static method which we pass the Request / Response objects to and which established and tracks our proprietary session object (which we attach to HttpSession) - that code resolves the domain name to a site id and loads site-specific data.

Don't know about using the / as the servlet root (we use a placeholder path "/site/" so that we can also serve static content direct from Apache) but I'm sure it's possible; even if mod_jserv won't support it (which I think it will) you can shuffle the modules so that mod_rewrite gets in there before mod_jserv, and rewrite an extra path element into the URL.

Blue Lang wrote:

----------------------------------------------------------------
BEFORE YOU POST, search the faq at <http://java.apache.org/faq/>
WHEN YOU POST, include all relevant version numbers, log files,
and configuration files.  Don't make us guess your problem!!!
----------------------------------------------------------------

Hallo, listfolks,

Can I wrap ApJServMount within virtual host directives, or are they always
global to apache?

Basically, I'd like to make a generic vhost directive that includes an
apache docroot and then mount the servlet at /, on a per vhost basis. From
the docs, I don't think this is possible, but, boy would it be nice if it
were. :)

Also, all the documentation and FAQazation I can find references
jserv.properties and etc. It is my understanding that this is no longer
correct. Is that the case?

Thanks!

--
   Blue Lang, Unix Voodoo Priest                http://www.gator.net/~blue
   202 Ashe Ave, Apt 3, Raleigh, NC.                          919 835 1540
    "A computer is a state machine. Threads are for people who can't program
     state machines." - Alan Cox, From Larry McVoy's quote page

--
--------------------------------------------------------------
Please read the FAQ! <http://java.apache.org/faq/>
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
Search Archives:
<http://www.mail-archive.com/java-apache-users%40list.working-dogs.com/>
Problems?:           [EMAIL PROTECTED]


--
David Crooke, Austin TX, USA.
Bibo ergo sum.
Open Standards. Open Source. Open Minds.
 

Reply via email to