Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

In Ubuntu, I added my usual directory Auth for phpmyadmin in the apache sites-available website specific file. (using Chrome incognito mode to ensure I was prompted) but I have no luck referencing the symlink below, nor where the symlink originates: /usr/share/phpmyadmin

Also tried adding it into: /etc/phpmyadmin/apache.conf

I restarted apache each time, works with all my other directories, but not phpmyadmin.

    <Directory "/srv/www/html/phpmyadmin">
            AuthType Basic
            AuthName "Restricted Files"
            AuthBasicProvider file
            AuthUserFile /srv/www/pwadmin
            Require user admin
share|improve this question
Does directory "/srv/www/html/phpmyadmin" in apache configuration perhapse have set "AllowOverride None" ? – Damir Kasipovic Feb 26 '14 at 13:30
I had a good look for that, and it is only at the parent directory "/srv/www/html/". However as suggested (somewhat) by Abhishek, I added "AllowOverride All" above "AuthType Basic" and it worked! This doesn't make sense to me - as my other directories at the same level don't need this. I'm guessing "AllowOverride None" is somewhere phpmyadmin specific that I couldn't find. As suggested in recent apache articles, I don't use .htaccess files, but rather I fill out the config in "sites-available". – user975033 Feb 27 '14 at 13:59
up vote 0 down vote accepted

Under the directory section, add the line “AllowOverride All” under “Directory Index”.

Make Sure you have .htaccess file with below content.

AuthType Basic
AuthName "Restricted Files"
AuthUserFile /path/to/passwords/.htpasswd
Require valid-user
share|improve this answer
Thanks for the suggestion, that worked! Except I didn't need to use the .htaccess file, just added “AllowOverride All” above "AuthType" in the config for sites-available. Cheers! – user975033 Feb 27 '14 at 14:03

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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