0

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
    </Directory>
2
  • Does directory "/srv/www/html/phpmyadmin" in apache configuration perhapse have set "AllowOverride None" ?
    – dkasipovic
    Feb 26, 2014 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".
    – ChrisAdmin
    Feb 27, 2014 at 13:59

1 Answer 1

0

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
1
  • 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!
    – ChrisAdmin
    Feb 27, 2014 at 14:03

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .