httpd-users mailing list archives

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

----- Original Message -----
From: "Kyle" <kyle@ccidomain.com>
To: "Apache Official Users Group" <users@httpd.apache.org>
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:
> http://www.foo.com/~someone/
> http://www.bar.com/~someone/
> http://www.cat.com/~someone/
> 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 10.1.1.7>
>    ServerName www.foo.com
>    ServerAdmin webmaster@foo.com
>    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 http://www.foo.com/~someone/ 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
ServerName www.domain.com
Errorlog /home/www/domain/logs
UserDir public_html
</VirtualHost>

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

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

Lewis





---------------------------------------------------------------------
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
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message