Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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
add comment

1 Answer 1

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
add comment

Your Answer

 
discard

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.