將舊用戶查找轉換為 Apache 2.4

將舊用戶查找轉換為 Apache 2.4

我正在嘗試將 LDAP 驗證查找配置從舊安裝移植到 Apache 2.4。我對 LDAP 不太了解。
當我執行設定測試時,我得到的只是錯誤訊息:
AH00526: Syntax error on line 130 of /file_path/ldapdir.conf:
Bad LDAP URL while parsing。
這是 AuthLDAPURL 末尾的行號
那條線有什麼問題嗎?

<Directory "/usr/local/www/docs/it/snaps">
        Options -Indexes +FollowSymLinks +ExecCGI +Includes
        # Was
        # Order deny,allow
        # Deny from All
        Require all denied
        AuthName "Enter Your Netid and Password"
        AuthType basic
        AuthBasicProvider ldap
        # Known obsolete directive
        # AuthzLDAPAuthoritative off
        AuthLDAPBindDN "cn=sanitycheck, ou=Service, dc=example, dc=com"
        AuthLDAPBindPassword "xxxxxxx"

        AuthLDAPURL     "ldaps://server1.example.com:1636\
                         ldaps://server2.example.com:1636\
                         ldaps://server3.example.com:1636\
                         ldaps://server4.example.com:1636/dc=example,dc=com?uid?sub?(objectClass=*)" TLS

        Require valid-user
        Satisfy any
</Directory>

答案1

嘗試在每行上不使用 ldaps://(第一行除外):

AuthLDAPURL "ldaps://server1.example.com:1636 server2.example.com:1636 server3.example.com:1636 server4.example.com:1636/dc=example,dc=com?uid?sub?(objectClass=*)" TLS

如文檔中指定:https://httpd.apache.org/docs/2.4/en/mod/mod_authnz_ldap.html#authldapurl

之後您可以用 baskslashes 測試它是否有效。

相關內容