You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Joshua Beard <jo...@hewbert.com> on 2004/12/09 14:41:32 UTC

[users@httpd] Multiple VirtualDocumentRoot locations

Hi,
I'm trying to setup a dynamic vhost system that would look in multiple
locations for a DocumentRoot - trying each if the previous fails. For
example,

bah.domain.com

Would first check /usr/local/www/bah/
If it existed, it'd use that. If it didn't, it might check
/home/bah/www/

If none of the paths to check in contain %1, it'd simply 404. Currently,
I just have a path and symlink specific users' www directory into it.
This seems sloppy.

Here's what I have, basically:
<VirtualHost *:80>
    UseCanonicalName Off
    VirtualDocumentRoot /usr/local/www/%1
</VirtualHost>
  
<VirtualHost *:80>
	UseCanonicalName Off
    VirtualDocumentRoot /home/%1/www
</VirtualHost>

It's not checking the second directive, only the first.  Any ideas? Is
this even possible?
-- 
Joshua Beard
"The best place to hide something is in open sight" - Unknown.

Fingerprint: C924 28B3 0322 6A17 858E  3219 91B7 1AA1 CF1E 6E3F
PGP Key: http://www.hewbert.com/pgp.asc

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Multiple VirtualDocumentRoot locations

Posted by Joshua Slive <js...@gmail.com>.
On Thu, 9 Dec 2004 06:41:32 -0700, Joshua Beard <jo...@hewbert.com> wrote:
> I'm trying to setup a dynamic vhost system that would look in multiple
> locations for a DocumentRoot - trying each if the previous fails.

> It's not checking the second directive, only the first.  Any ideas? Is
> this even possible?

Not with mod_vhost_alias.

mod_rewrite can do this, although it will be complicated and somewhat
slower than direct access.  There is an example in the RewriteGuide.

Joshua.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org