The following LDAP URL authentication is NOT working for mediawiki on ubuntu 14.04 LTS server, which is working on ubuntu 9.10 server.

cat /etc/apache2/sites-available/global.conf

<Directory /mediawiki>
        Options +FollowSymLinks
        AllowOverride all
        order allow,deny
        allow from all

AuthType Basic
            AuthName "Web Site Authentication: Login with your user id"
            AuthBasicProvider ldap
            #AuthzLDAPAuthoritative on
            AuthLDAPURL "ldap://,dc=net?uid"
            AuthLDAPBindDN "cn=admin,dc=mydomain,dc=net"
            AuthLDAPBindPassword secret
            Require valid-user

Not working in the sense it's not prompting for authentication at all, just allows to access. No errors. There are many changes in Ubuntu 14.04, such as web root directory changed to /var/www/html in apache 2.4, AuthzLDAPAuthoritative is deprecated(that's why commented)....

If I paste the same code in 000-defaults replacing /mediawiki with /var/www/html then it prompts for authentication for accessing But no effect for

Am I missing anything in apache 2.4.7?. I'm confused, anybody has any idea?

  • The browser cache of one page which is already successfully authenticated affects the other site by not asking for authentication again. It's working now, full path is the key(and clearing the browser cache of other successfully authenticated site).
    – user3215
    Jun 13, 2014 at 16:38

1 Answer 1


According to Apache documentation:

"Directory-path is either the full path to a directory, or a wild-card string using Unix shell-style matching. In a wild-card string, ? matches any single character, and * matches any sequences of characters."

If mediawiki directory full path is /var/www/html/mediawiki try:

  <Directory /var/www/html/mediawiki>  

If not, verify if you have forgot .htaccess file

  • I already tried it and it's now `/var/www/html/mediawiki' but the result is same. There is no .htaccess file under mediawiki.
    – user3215
    Jun 13, 2014 at 4:20
  • Let me change the post with the complete path.
    – user3215
    Jun 13, 2014 at 4:22
  • I tried with the full path /var/www/html/mediawiki before but replaced order allow,deny & allow from all with Require all granted to completely use 2.4 features. This caused apache not to show authentication box. It's working now full path is the key though.
    – user3215
    Jun 13, 2014 at 15:13
  • Still wanted to know why it's not working with Require all granted. Any idea?
    – user3215
    Jun 13, 2014 at 15:14
  • Allow and deny directive controls which hosts can or can't access an area of the server, Require tests whether an authenticated user is authorized according to a particular authorization provider and the specified restrictions. Require all granted means access is allowed unconditionally. If you put it before ldap directive maybe overrides authentication, let see Beyond just authorization
    – Lety
    Jun 13, 2014 at 19:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.