Problem securing phpMyAdmin with htaccess & htpasswd

Fresh Droplet : UBUNTU 14.04.x64 LAMP 14.04

I’ve followed the instuctions provided on :

But somehow it doesn’t work. If i go to http://MY_IP_ADDRESSS/phpmyadmin/ no window prompted to input username and password.

I’ve check the phpmyadmin.conf, .htaccess and .htpasswd files and all of those files seems good.


<Directory /usr/share/phpmyadmin>
    Options FollowSymLinks
    DirectoryIndex index.php
    AllowOverride All


AuthType Basic
AuthName "Restricted Files"
AuthUserFile /etc/phpmyadmin/.htpasswd
Require valid-user



What is wrong ?

Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

Never mind finally got this thing works.

We need to add the configuration to our web/domain configuration file ( domain.tld.conf ) in this case the domain.tld is my primary domain (i’ve use mutlple domain on 1 droplet)

Find and edit file via SSH or FTP: /etc/apache2/sites-available/domain.tld.conf

Then add following configuration to the file :

<Directory /usr/share/phpmyadmin>
    Options FollowSymLinks
    DirectoryIndex index.php
    AllowOverride All

Save , restart apache

sudo service apache2 restart

Done! Hope this can help anyone who have the same problem.

Note : If your main domain is and you’ve set virtual host for it then your web/domain configuration file is /etc/apache2/sites-available/

Thx for info dude.

Idk why they don’t say about it in tutorials.

Welcome to DigitalOcean.

Where did you saved .htaccess and .htpasswd