Question

Safest bath to store .htpasswd for phpmyadmin?

  • Posted on December 12, 2013
  • badr.dAsked by badr.d

Hello, hope everyone’s OK… So I followed this article: https://www.digitalocean.com/community/articles/how-to-install-and-secure-phpmyadmin-on-ubuntu-12-04 And when i got to set up the htpasswd part, didn’t know where to store it, or what are the best practices applied. So, I tried a path kept getting internal server errors, till i stored it in var/www and it worked. For some reason i don’t feel like it should be kept there(i am new to this). Any help is appreciated, thanks…

Running: Ubuntu.


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.

<b>“For some reason i don’t feel like it should be kept there…”</b> <br> <br>The article also recommends that you should <b>not</b> store it there.<blockquote>… place the file in a directory of your choice as long as it is not accessible from a browser.</blockquote>

You shouldn’t store it in /var/www because anyone will be able to download it since apache is serving /var/www’s contents. You can create a directory in /etc/apache2 called <code>htpasswd</code> or whatever you like and store it in it e.g. <code>/etc/apache2/htpasswd/phpmyadmin</code>.