LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 12-06-2004, 06:13 PM   #1
BrianK
Senior Member
 
Registered: Mar 2002
Location: Los Angeles, CA
Distribution: Debian, Ubuntu
Posts: 1,334

Rep: Reputation: 51
htaccess/htpasswd not authenticating


I'm tring to password protect a directory on my webserver. In my httpd.conf, I've edited it so it has:

AllowOverride AuthConfig

I've added a .htaccess file to the directory that looks like so:

AuthUserFile /var/www/access/.htpasswd
AuthName Foo
AuthType Basic
require valid-user

I created the passwd file by:

# htpasswd -c ../../access/.htpasswd briank

When I try to open the page, I get the password challenge, but it does not let me through. I've tried changing the ownership of the .htpasswd file to apache, but that still doesn't work.

What's wrong?

Apache 2.0.40
RH9

Thanks.
 
Old 12-07-2004, 11:48 AM   #2
BrianK
Senior Member
 
Registered: Mar 2002
Location: Los Angeles, CA
Distribution: Debian, Ubuntu
Posts: 1,334

Original Poster
Rep: Reputation: 51
anyone?
 
Old 12-09-2004, 11:24 AM   #3
TKS
Member
 
Registered: Dec 2003
Location: NC, USA
Distribution: Slackware, VectorLinux, Smoothwall, and PCLinuxOS
Posts: 40

Rep: Reputation: 15
Same problem here

Having the exact same problem...I upgraded to Apache 2.0.40 (clarkconnect)

And I changed nothing on a protected directory...but now it won't authenticate and let me in. I redid the htpasswd with no help. My .htaccess is setup exactly like BrianK's is.

anyone know if this is a known problem?


TKS
 
Old 12-10-2004, 02:52 PM   #4
BrianK
Senior Member
 
Registered: Mar 2002
Location: Los Angeles, CA
Distribution: Debian, Ubuntu
Posts: 1,334

Original Poster
Rep: Reputation: 51
Got it!

it was a permissions problem. whoever owns httpd (which, in my case, is the user "apache") needs to own the .htaccess and the .htpasswd file.

user "apache" must also be able to cd into the directory that owns the .htpasswd file.

the permissions on the htpasswd file *must* be strict, i.e. go-rwx, or 600
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
.htaccess .htpasswd plisken Linux - General 5 05-21-2006 01:44 PM
.htaccess .htpasswd issue Robin01 Linux - Newbie 4 12-24-2003 03:36 PM
About .htaccess & .htpasswd edhan Linux - Newbie 3 10-17-2003 12:16 AM
Help with .htpasswd and .htaccess MikeeX Linux - General 3 03-25-2003 10:41 AM
Cannot see .htaccess and .htpasswd files John_Saunders Linux - Newbie 2 07-21-2002 09:14 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 11:03 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