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

I have a phpMyAdmin folder. So first I set .htaccess folder and type this in it.

AuthUserFile /var/www/html/phpMyAdmin-3.4/.htpasswd
AuthName "phpMyAdmin Login Page"
AuthType Basic
Require valid-user

The I created the username and password using this command

sudo htpasswd -c .htpasswd iamadmin

...and I could see both the .htaccess and .htpasswd files are in the folder. But when I go my link it never prompt for the additional username and password. My OS is centos 6.2

share|improve this question
up vote 2 down vote accepted

You will most likely need to configure your server to allow AuthConfig directives in .htpasswd files. Add an

AllowOverride AuthConfig

in a suitable place in your httpd configuration (/etc/httpd/conf/httpd.conf) file and restart apache

service httpd restart

See also the apache docs

share|improve this answer
@lain I have done this # # Each directory to which Apache has access can be configured with respect # to which services and features are allowed and/or disabled in that # directory (and its subdirectories). # # First, we configure the "default" to be a very restrictive set of # features. # <Directory /> Options FollowSymLinks AllowOverride AuthConfig </Directory> Then I restary my httpd still the same. Still no difference anything I am missing is it? – user111196 May 13 '12 at 12:18
I would check to see if there are other AllowOverride directives that are restricting access to other directories that may be causing you problems. – Iain May 13 '12 at 17:34
  1. Click on the Wamp Server icon (phpmyadmin)
  2. Select Apache
  3. Select Apache Modules
  4. Select rewrite_module
  5. Restart Your Wamp Server
  6. Run your program.

If this not working there is problem with your .htaccess file.

share|improve this answer
Your answer has some room for improvement. There's nothing in the .htaccess file provided that relies on mod_rewrite. Why do you think switching that on will help? Why do you think he's using WAMP? CentOS and WAMP are not commonly found together. "there is problem with your .htaccess file" is not helpful. He came here to ask what was wrong with the .htaccess file. Maybe you could focus on unanswered questions where you have specific expertise. – Ladadadada Dec 2 '14 at 14:41

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.