【问题标题】:apache ldap auth per folder每个文件夹的 apache ldap 身份验证
【发布时间】:2016-02-23 13:32:00
【问题描述】:

我在 redhat 6 上配置了一个 apache 服务器。 我还实现并测试了 ldap 身份验证,并且可以正常工作。 我遇到的问题是当我想授予用户对特定文件夹路径的权限时......例如:

<Directory "/var/www/html/x">
    AuthType Basic
    AuthName "Enter Your AD Username/Password"
    AuthBasicProvider ldap
    AuthzLDAPAuthoritative on
    AuthLDAPBindDN ....
    AuthLDAPBindPassword ....
    AuthLDAPURL ....
    require user user1 user2
</Directory>

和 user3 只能访问

<Directory "/var/www/html/x/y">
 AuthType Basic
 AuthName "Enter Your AD Username/Password"
 AuthBasicProvider ldap
 AuthzLDAPAuthoritative on
 AuthLDAPBindDN ....
 AuthLDAPBindPassword ....
 AuthLDAPURL ....
 require user user3
</Directory>

我做了上面写的,但它不起作用。

【问题讨论】:

    标签: apache authentication ldap


    【解决方案1】:

    在 httpd 使用位置,而不是目录。

    如果 authzldapauthoritative 开启,LDAPS 可能无法连接。 这给了我十分之九的错误,当它关闭时它工作得很好。

    <Location "/var/www/html/x/y">
      AuthType Basic
      AuthName "Enter Your AD Username/Password"
      AuthBasicProvider "ldap"
      AuthLDAPURL "..."
      AuthLDAPBindDN "..."
      AuthLDAPBindPassword "..."
      authzldapauthoritative Off
      require valid-user
    </Location>
    

    或者在每个文件夹中使用 .htacces。

    AuthLDAPBindDN "..."
    AuthLDAPBindPassword "..."
    AuthLDAPURL "..."
    
    AuthType Basic
    AuthName "Enter Your AD Username/Password"
    AuthBasicProvider ldap
    
    require valid-user
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-03-09
      • 2012-09-02
      • 2018-06-25
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多