[users@httpd] How to use mod_rewrite with %{REMOTE_USER}

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

 



Hi,
 
I am trying to setup a webdav server with apache 2.0.46 on Redhat Enterprise Linux 3 where users are authenticated using the module mod_authz_ldap with user information stored in openldap. The problem is that I want an authenticated user to be able to access only his/her directory. There are so many users so I do not plan to add all the users directory manually with the "Directory" directive to restrict access.
 
My configuration looks like this:
---------------------------------
AliasMatch ^/users(.*) /share/users$1

<Directory "/share/users">
        SSLRequireSSL

        DAV on
        Options FollowSymLinks SymLinksIfOwnerMatch
        AllowOverride None

        AuthType basic
        AuthName "Restricted Access"

        AuthzLDAPEngine on
        AuthzLDAPServer "server1 server2"
        AuthzLDAPBindDN uid=proxyuser,ou=people,dc=domain,dc=com
        AuthzLDAPBindPassword **********
        AuthzLDAPUserBase ou=people,dc=domain,dc=com
        AuthzLDAPUserKey uid
        AuthzLDAPUserScope base

       RewriteEngine On
       RewriteRule ^/users/$ /users/%{REMOTE_USER} [R]

        <Limit GET PUT DELETE PROPFIND PROPPATCH MKCOL COPY MOVE LOCK UNLOCK>
        require valid-user
        </Limit>

</Directory>
---------------------------------------

The %{REMOTE_USER} returns a value like "uid=testuser,ou=people,dc=domain,dc=com", so I need to filter "testuser" from this string.

Is there any other way to do what I am trying to do ?

Thanks,
Bhavin.


[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux