Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Installed phpMyAdmin on Ubuntu 10.10, running apache2. phpMyAdmin resides in /usr/share/, and is accessible because there is alias in apache2.

I'd like to add an .htaccess file for it, but I am unsure of where to place it, or if I should use some other method to prevent the site from being accessed by someone other than me (with password).

share|improve this question
up vote 1 down vote accepted

Assuming it's installed in /usr/share/phpmyadmin, you can put the approrpriate .htaccess in /usr/share/phpmysadmin.

That being said, HTTP auth isn't exactly fool-proof if that's what you're looking to use .htaccess for, so I'd instead recommend restricting by IP.

If however your intent is to use http-auth anyway, you can configure phpmyadmin's and set the auth_type to http

I personally would recommend cookie-based auth instead, combined with a somewhat restrictive .htaccess to keep out people you don't want seeing it.

share|improve this answer

Your Answer


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.