apache2.2:ldap_userdir + mod-rewrite 无法正常工作

apache2.2:ldap_userdir + mod-rewrite 无法正常工作

我的Apache配置:

    DocumentRoot /var/www
        <Directory />
                Options FollowSymLinks
                AllowOverride None
        </Directory>
        <Directory /var/www/>
                IndexStyleSheet "/css/style.css"
                Options Indexes FollowSymLinks MultiViews
                AllowOverride None
                Order allow,deny
                Allow from all
        </Directory>

        <Location />
                AuthName "AUTH"
                AuthType Basic
                AuthBasicProvider ldap
                AuthzLDAPAuthoritative On
                AuthLDAPBindDN "cn=write,cn=auth,ou=user,dc=example,dc=com"
                AuthLDAPBindPassword password
                AuthLDAPURL "ldap://localhost/ou=user,dc=example,dc=com?uid"
                AuthLDAPGroupAttributeIsDN Off
                Require valid-user
        </Location>
<Directory /var/www/dir>
                RewriteEngine On
                RewriteCond %{LA-U:REMOTE_USER} (.+)
                RewriteCond %{LA-U:REMOTE_USER} !(adm1|adm2|adm3)
                RewriteCond %{REQUEST_FILENAME} !-d
                RewriteCond %{REQUEST_FILENAME} !-f
                RewriteRule (.*) /~%{LA-U:REMOTE_USER}/

                Options Indexes FollowSymLinks -MultiViews
                AllowOverride AuthConfig
                Order allow,deny
                Allow from all
            </Directory>

我的 ldap_userdir 配置:

<IfModule mod_ldap_userdir.c>
                LDAPUserDir pub
                LDAPUserDirServerURL ldap://localhost/ou%3Duser%2Cdc%3Dexample%2Cdc%3Dcom??sub?(&(uid=%25u)(objectClass=inetOrgPerson))
                LDAPUserDirDNInfo cn=write,cn=auth,ou=user,dc=example,dc=pl password
(objectClass=inetOrgPerson))"
                <Directory /var/www/dir/*/pub>
                AllowOverride FileInfo AuthConfig Limit Indexes
                Options -MultiViews Indexes FollowSymLinks IncludesNoExec
                <Limit GET POST OPTIONS>
                        Order allow,deny
                        Allow from all
                </Limit>
                <LimitExcept GET POST OPTIONS>
                        Order deny,allow
                        Deny from all
                </LimitExcept>
                </Directory>
</IfModule>

我的目录结构:

/var/www/
        index.html
        dir/
                  user1/pub/*
                  user2/pub/*

Ldap 身份验证正常工作。

当我获得我的域名时: https://domain.example.com

然后我正确地看到了我的index.html,我点击链接“dir”并通过将我重定向到htts://....../dir来重写mod以执行,在那里我可以看到所有目录而不是用户主目录的内容。

重定向日志文件链接

我的错误在哪里?

相关内容