Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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>
share|improve this question
    
Does directory "/srv/www/html/phpmyadmin" in apache configuration perhapse have set "AllowOverride None" ? –  DKasipovic Feb 26 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 at 13:59

1 Answer 1

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 at 14:03

Your Answer

 
discard

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.