I am using Ubuntu 18.04 LTS Desktop to host an apache2 webserver. I installed phpmyadmin and wanted to secure it using htpasswd. There for I edited the /etc/apache2/conf-available/phpmyadmin.conf
, adding AllowOverride All
and restarted apache2. I checked the conf-enabled folder and saw that that had updated too. Then I created a .htaccess
file in the /usr/share/phpmyadmin
folder(the folder phpmyadmin.conf
was referring to. I put this in the .htaccess
file:
AuthType Basic
AuthName "PHPMyAdmin for servername."
AuthUserFile /etc/phpmyadmin/.htpasswd
Require valid-user
Next, I created a .htpasswd
file:
htpasswd -c /etc/phpmyadmin/.htpasswd admin
Last I restarted apache2:
systemctl restart apache2
I made sure that the .htaccess
and .htpasswd
file were where I put them.
Most importantly:
I have looked up answers for similar problems but none of the solutions work for me!
Edit: Problem solved. Solution: be better at remembering which passwords are used for which accounts