Take the 2-minute tour ×
Server Fault is a question and answer site for 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

2 Answers 2

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
1  
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

 
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.