[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Apache's mod_userdir resets global per-user permissions, when redefined in <VirtualHost>



On Sun, Feb 17, 2013 at 9:18 AM, Chris Bannister
<cbannister@slingshot.co.nz> wrote:
> On Sat, Feb 16, 2013 at 08:58:24PM +0400, Dmitriy Matrosov wrote:
>> Hi.
>>     UserDit /home/Public/*/www
>       ^^^^^^^
>       huh?

Well, you're right, i mistyped. But, honestly, this doesn't change
neither the meaning nor that all required information for test (or
anything else) was written. As you may guess, if this would really be
a copy from my config, apache will not even start and i can't test
what i have written about.

Anyway, as you ask, here is the copy.

mods-enabled/userdir.conf:

<IfModule mod_userdir.c>
        UserDir /home/Public/*/www
        UserDir enabled
        UserDir disabled root
</IfModule>

sites-enabled/000-default:
<VirtualHost *:80>
    DocumentRoot    /var/www
</VirtualHost>

sites-enabled/local-test:
<VirtualHost *:80>
    ServerName      wiki.localhost
    DocumentRoot    /var/www/wiki

    UserDir         /home/Public/*/www/wiki
</VirtualHost>

Here is directory layout:

# sudo -u www-data sh -c 'for f; do echo "File is \"$f\":"; cat "$f";
done'  sh /home/Public/{sgf,root}/www/{wiki,}/index.html
File is "/home/Public/sgf/www/wiki/index.html":
Here is sgf's public WIKI directory.
File is "/home/Public/sgf/www//index.html":
Here is sgf's public www directory.
File is "/home/Public/root/www/wiki/index.html":
Root's public WIKI dir.
File is "/home/Public/root/www//index.html":
Root's public www dir.

And here is test:

# wget --quiet -O- localhost/~sgf
Here is sgf's public www directory.
# wget  -O- localhost/~root
--2013-02-18 15:10:18--  http://localhost/~root
Resolving localhost (localhost)... 127.0.0.1
Connecting to localhost (localhost)|127.0.0.1|:80... connected.
HTTP request sent, awaiting response... 404 Not Found
2013-02-18 15:10:18 ERROR 404: Not Found.

# wget --quiet -O- wiki.localhost/~sgf
Here is sgf's public WIKI directory.
# wget --quiet -O- wiki.localhost/~root
Root's public WIKI dir.

As you may see, 'disabled root' statement is ignored by Virtual Host
'wiki.localhost', which have redefined UserDir path.


Reply to: