httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Lewis Watson" <>
Subject Re: VitualHost + UserDir prob
Date Mon, 07 Jan 2002 21:41:16 GMT

----- Original Message -----
From: "Kyle" <>
To: "Apache Official Users Group" <>
Sent: Monday, January 07, 2002 3:11 PM
Subject: VitualHost + UserDir prob

> Hello all.  I have a few users that use the userdir directive so they
> don't have to have their own domain name.  I used to have the UserDir
> directive in the main, default setups like this:
> UserDir /net/www/*/www
> And that worked great!
> But then I found that clients could get web pages from any of my domain
> host customers (OOPS!).  So it didn't matter what the domain was on the
> server:
> These would all yield the same results.
> So I remarked out the userdir directive in the main host and put a copy
> of the original directive into the virtual host that is supposed to
> handle these user accounts (names change to protect the somewhat
> innocent):
> <VirtualHost>
>    ServerName
>    ServerAdmin
>    DocumentRoot /net/www/xyz00002/www
>    SetEnv HOME_DIR /net/www/xyz00002
>    UserDir /net/www/*/www
>    .
>    .
>    .
> </VirtualHost>
> This solved the domain hosing problem, but the exact same request as
> above for just returns a 302 error.  Why
> won't this directive work when put inside the virtualhost directive?
> -Kyle

For your virtual hosts where you do not want /~userdirs use UserDir
disabled, this works in the main config as well. Then, where you want
/~userdirs use the UserDir public_html.

<VirtualHost 123.456.798>
DocumentRoot /home/www/domain
Errorlog /home/www/domain/logs
UserDir public_html

<VirtualHost 123.456.799>
DocumentRoot /home/www/domain2
Errorlog /home/www/domain2/logs
UserDir disabled

Hope this helps. Also is you use UserDir enabled you have to specify what
users. I don't think you need this.


The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:> for more info.
To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message