LDAP authentication apache 2.2

5,540

According to Apache Documentation AuthBasicProvider directive is provided by mod_auth_basic. You should check if this module is enabled in your configuration by running apache2 -M

Share:
5,540

Related videos on Youtube

DenBelg
Author by

DenBelg

Updated on September 18, 2022

Comments

  • DenBelg
    DenBelg over 1 year

    I am trying to install basic ldap authentication on a website on an apache 2.2 server. I put this in my /etc/apache2/apache2.conf file

    LoadModule ldap_module /usr/lib/apache2/modules/mod_ldap.so
    LoadModule authnz_ldap_module /usr/lib/apache2/modules/mod_authnz_ldap.so
    

    I located those modules, so i am sure they exsist.

    I put this in my /etc/apache2/sites-avaible/default

    <VirtualHost *:80>
            ServerName monitoring.site.local
            DocumentRoot /var/www/Monitoring/public
    
            <Directory /var/www/Monitoring/public>
             AuthBasicProvider ldap
            AuthType Basic
            AuthzLDAPAuthoritative off
            AuthName "Monitoring"
            AuthLDAPURL "ldap://dc1.site.local:389/DC=site,DC=local?sAmaccountName?sub.(objClass=*)"NONE#
            AuthLDAPBindDN "CN=Admin,CN=Users,DC=site,DC=local"
            AuthLDAPBindPassword secret
            require valid-user
    ....
    

    But when i try to restart my server i get this error

    Syntax error on line 23 of /etc/apache2/sites-enabled/000-default: Invalid command 'AuthBasicProvider', perhaps misspelled or defined by a module not included in the server configuration Action 'configtest' failed. The Apache error log may have more information. ...fail!

    I tried to enable some modules with a2enmod with no succes. My apache server: Server version: Apache/2.2.17 (Ubuntu)

    • gertvdijk
      gertvdijk over 11 years
      Did you try to change the order of the lines AuthType and AuthBasicProvider?
  • Mojtaba Rezaeian
    Mojtaba Rezaeian about 4 years
    yes this worked in my case. thanks