Protect phpmyadmin with http basic auth

I’d like to protect phpmyadmin with http basic auth.
So what was done:

  1. I added to file /etc/phpmyadmin/apache.conf
    after line <Directory /usr/share/phpmyadmin>
AuthType Basic
AuthName "Restricted Access"
AuthUserFile /usr/share/phpmyadmin/passwd
Require valid-user
  1. After that new password was generated
    htpasswd -c /usr/share/phpmyadmin/passwd user

  2. Configuration test
    apachectl configtest

  3. Apache was restarted
    systemctl restart apache2 && systemctl status apache2

As a result I don’t see authorization window. Can anybody please help me, where is my error?

/etc/phpmyadmin/apache.conf is not loaded

Use /etc/apache2/conf.d/conf.d/phpmyadmin.conf instead

1 Like

Great! Thanks, now it works as it should!

Please be aware that we sometimes renew the config file

For example 1.4.15 release …

So update process will overwrite config. Right?

Usually we don’t overwrite the phpmyadmin config how ever in this case due to some security “remarks” it makes for us easier to overwrite 1 config file then sed in all the changes.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.