[mpm-itk] different AssignUserID in <Location> and <Directory>

Andre Hoepner (i.based: Systemhaus GmbH & Co. KG) a.hoepner at ibased.de
Wed Mar 13 18:30:28 CET 2013


Hello group members,

im playing around with apache configuration in which we want to serve 
different locations running each with other username/group.
We use virtual hosts for different users an this works fine, but in this 
case we only have one virtual host with different aliases.

Situation:

URL:	http://www.example.com/USER1
DIR:	/home/USER1/htdocs
PERMS:	AssignUserID USER1 USER1

URL:	http://www.example.com/USER2
DIR:	/home/USER2/htdocs
PERMS:	AssignUserID USER2 USER2

We have tried mod_userdir but all requests inside momd_userdir runs with 
apache:apache and userdirs should have no read access to other users 
home. So we need different perms to read documents from different homes.

I've found some posts from this list, which told that's possible to
use AssignUserID inside </Location> and </Directory>...

http://lists.err.no/pipermail/mpm-itk/2009-March/000112.html

But this does not work, or i run into an error. Inside a virtual Host
i tried to assign aliases which Location and Directory, but the tested
scripts runs as standard apache user not the assigned user / group.

This is my config:

---8<----

<VirtualHost *:80>
    ServerName example.com
    # standard document root for access to /
    DocumentRoot "/var/www/htdocs"

    <Directory "/var/www/htdocs">
	Options Indexes FollowSymLinks
	AllowOverride AuthConfig
	Order allow,deny
         Allow from all
    </Directory>

# first user with different perms
Alias /USER1 /home/USER1/htdocs

         <Location /USER1>
                 AssignUserID    USER1 USER1
                 DirectoryIndex index.html index.php
         </Location>

         <Directory /home/USER1/htdocs>
                 AssignUserID    USER1 USER1
                 Order allow,deny
                 Allow from all
         </Directory>


# second user with different perms
Alias /USER2 /home/USER2/htdocs

         <Location /USER2>
                 AssignUserID    USER2 USER2
                 DirectoryIndex index.html index.php
         </Location>

         <Directory /home/USER2/htdocs>
                 AssignUserID    USER2 USER2
                 Order allow,deny
                 Allow from all
         </Directory>

</VirtualHost>

---8<----

I hope you understand what i tried to describe. Any ideas? I want to get 
this thing working. :-) Thanks a lot for your time to help me.

Andre

--

Andre, a.hoepner at ibased.de




More information about the mpm-itk mailing list