You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Kyle <ky...@ccidomain.com> on 2002/01/08 16:41:29 UTC

Re: VitualHost + UserDir prob (solution)

I appreciate the replies.  Sorry about the cloak and dagger, Joshua.

To summarize, the basic problem was that the exact same userdir
directive would not work within the virtual host, but worked fine in the
main host.

I wasn't able to use Lewis' suggestions because my directory structure
is different, but they did cause me to try something that revealed the
solution.

Solution: When wanting UserDir functionality in *one virtual host only*,
in the main server config, enter "UserDir disabled".  This will do two
things:
1) This prevents the main and all other virtual hosts from hosting the
userdirs
2) For some VERY odd reason it causes the path in the virtual host that
*does* have the "UserDir /net/www/*/www" directive to work as
documented.

To verify, I went back and double checked.  Remarking out "UserDir
disabled" in the main configuration causes the virtual host with the
"UserDir /net/www/*/www" directive to issue a 302 error with a circular
reference ("here" calls itself).  Removing the remark to re-issue the
"UserDir disabled" directive solves the 302 problem and allows the
system to work as documented and expected.

Thanks for the help guys.  :)

-Kyle


Lewis Watson wrote:
> 
> ----- Original Message -----
> From: "Kyle" <ky...@ccidomain.com>
> To: "Apache Official Users Group" <us...@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

---------------------------------------------------------------------
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