LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 10-08-2010, 01:08 AM   #1
singh_chitranjan
Member
 
Registered: Jun 2008
Posts: 33

Rep: Reputation: 0
Apache Server not asking for password Authentication


Dear Experts,

i have CentOS 5 configured with apache web server. but it is not asking for password authentication while accessing the web page. the config detail is as below:-

Web Page location - /var/www/html
.htaccess file location - /var/www/html
Contents of .htaccess file :-

AuthName "Password Protected"
AuthType Basic
AuthUserFile /etc/httpd/conf/.htpassword
require user chitranjan


Entry in /etc/httpd/conf/httpd.conf file:-

<Directory "/var/www/html">
AllowOverride AuthConfig
Order allow,deny
Allow from all

</Directory>




please help me to solve this problem.


Thanks in advance
Chitranjan
 
Old 10-08-2010, 01:13 AM   #2
leejohnli
Member
 
Registered: Sep 2010
Posts: 66

Rep: Reputation: 2
Check your apache logs. try restarting your apache and see if the problem still persist. on client side browser try clearing the cache.
 
Old 10-08-2010, 01:17 AM   #3
Sayan Acharjee
Member
 
Registered: Feb 2010
Location: Chennai, India
Distribution: Manjaro
Posts: 624

Rep: Reputation: 64
Quote:
Originally Posted by singh_chitranjan View Post
Dear Experts,

AuthName "Password Protected"
AuthType Basic
AuthUserFile /etc/httpd/conf/.htpassword
require user chitranjan

Are you sure you have restarted apache after editing httpd.conf file? Anyways,
Change the last line here to:

require valid-user[no need to mention the user name here]


Thats how my htaccess is working, see if it works for you.

Last edited by Sayan Acharjee; 10-08-2010 at 01:29 AM.
 
Old 10-08-2010, 01:26 AM   #4
leejohnli
Member
 
Registered: Sep 2010
Posts: 66

Rep: Reputation: 2
try "require valid-user" instead of "require user"
 
Old 10-08-2010, 01:36 AM   #5
singh_chitranjan
Member
 
Registered: Jun 2008
Posts: 33

Original Poster
Rep: Reputation: 0
Thanks, but did not work

Thanks,

Applied it but did not work.
 
Old 10-08-2010, 01:38 AM   #6
singh_chitranjan
Member
 
Registered: Jun 2008
Posts: 33

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by sayan_acharjee View Post
Are you sure you have restarted apache after editing httpd.conf file? Anyways,
Change the last line here to:

require valid-user[no need to mention the user name here]


Thats how my htaccess is working, see if it works for you.


Thanks,

Applied but did not work
 
Old 10-08-2010, 01:39 AM   #7
singh_chitranjan
Member
 
Registered: Jun 2008
Posts: 33

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by leejohnli View Post
try "require valid-user" instead of "require user"
Thanks,

Applied it but did not work
 
Old 10-08-2010, 01:42 AM   #8
Sayan Acharjee
Member
 
Registered: Feb 2010
Location: Chennai, India
Distribution: Manjaro
Posts: 624

Rep: Reputation: 64
Can you please post the command which you have used to create password for that user?
 
Old 10-08-2010, 01:47 AM   #9
singh_chitranjan
Member
 
Registered: Jun 2008
Posts: 33

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by sayan_acharjee View Post
Can you please post the command which you have used to create password for that user?
Hi,

This Command is as below:-

#htpasswd -c -m /etc/httpd/conf/.htpassword chitranjan
 
Old 10-08-2010, 01:56 AM   #10
Sayan Acharjee
Member
 
Registered: Feb 2010
Location: Chennai, India
Distribution: Manjaro
Posts: 624

Rep: Reputation: 64
Well, the file extention should be .htpasswd not .htpassword
 
Old 10-08-2010, 02:05 AM   #11
singh_chitranjan
Member
 
Registered: Jun 2008
Posts: 33

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by sayan_acharjee View Post
Well, the file extention should be .htpasswd not .htpassword
Hi,

i just changed from .htpassword to .htpasswd and restarted the httpd deamon but still same problem.

Thanks for support.
 
Old 10-08-2010, 02:07 AM   #12
Sayan Acharjee
Member
 
Registered: Feb 2010
Location: Chennai, India
Distribution: Manjaro
Posts: 624

Rep: Reputation: 64
Quote:
Originally Posted by singh_chitranjan View Post
Hi,

i just changed from .htpassword to .htpasswd and restarted the httpd deamon but still same problem.

Thanks for support.
Just changing the extention won't solve the problem, you need to go through the process once again, delete that file and create a new one and then create password for the user again, good luck.

Last edited by Sayan Acharjee; 10-08-2010 at 02:17 AM.
 
Old 10-08-2010, 02:37 AM   #13
leejohnli
Member
 
Registered: Sep 2010
Posts: 66

Rep: Reputation: 2
I'll go for the solution of recreating the file again and do add your configuration again.
 
Old 10-08-2010, 02:38 AM   #14
singh_chitranjan
Member
 
Registered: Jun 2008
Posts: 33

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by sayan_acharjee View Post
Just changing the extention won't solve the problem, you need to go through the process once again, delete that file and create a new one and then create password for the user again, good luck.
Hi,

Done it but not getting success.

Thanks for kind support.
 
Old 10-08-2010, 02:53 AM   #15
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
@OP

To test if apache reads .htaccess files, put some garbage in it and see if you get a 500 "Internal Server Error"
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Apache authentication (.htaccess) password reset page hattori.hanzo Linux - Newbie 0 11-05-2008 12:01 AM
Client Authentication in Apache HTTP Server gjagadish Linux - Software 1 09-11-2006 02:56 AM
Apache password authentication problem dave`2005 Linux - Software 1 05-31-2006 04:27 PM
Using the MySQL Database for Authentication on Apache Server ruiseixas Linux - Security 1 03-12-2004 10:32 PM
Password Authentication Server Tunarle Linux - Networking 1 07-27-2003 03:55 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 11:35 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration