LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 12-23-2003, 09:13 PM   #1
Robin01
Member
 
Registered: Aug 2003
Posts: 104

Rep: Reputation: 15
.htaccess .htpasswd issue


hello everybody..

haveing issues with .htaccess and .htpasswd...
it brings up the password screen but the password i put in isn't getting validated.
err msg
401 authorization required.
This server could not verify that ou are authorized to access the document request. either your supplied the wrong credentials or your browser doesn't understand how to supply the credentials required..

.htaccess
Authuserfile /folder1/folder2/.htpasswd
authname " locked area"
authtype basic
require valid-user

.htpasswd
locaton of file
/folder1/folder2/
nameassword

and in httpd.conf
i configured Allowoverride from "none" to "All"
side note... .htpasswd is u=rw g=rx o=rx
any ideas

Last edited by Robin01; 12-23-2003 at 09:14 PM.
 
Old 12-23-2003, 09:43 PM   #2
twantrd
Senior Member
 
Registered: Nov 2002
Location: CA
Distribution: redhat 7.3
Posts: 1,438

Rep: Reputation: 52
I think case sensitivity matters. If it does, then the arguments you have entered is incorrect. Here is a sample of my .htpasswd/.htaccess file

---.htaccess---
AuthType Basic
AuthName "twantrd's access file"
AuthUserFile /path/htpasswd.users
Require valid-user

---.htpasswd.users (rwx r-x r-x)---
twantrd: Hr439ufsa90

---httpd.conf---
AllowOverride AuthConfig (that's the allowoverride syntax I have)

Your .htpasswd file looks a bit strange. It should be:
username:encrypted_password

Did you manually insert the syntax yourself for your .htpasswd? You did run the command "htpasswd" right? Based on your setup, run your htpasswd this way:

htpasswd -c /folder1/folder2/.htpasswd Robin01

Substitute "Robin01" for the username of your choice. The '-c' argument is for creating the htpasswd file. If you have already created one and just want to add more usernames to it, then run the same command w/o the '-c' argument and input the username you want. Let us know if this works. Good luck.

-twantrd
 
Old 12-23-2003, 09:55 PM   #3
Robin01
Member
 
Registered: Aug 2003
Posts: 104

Original Poster
Rep: Reputation: 15
hi thanks for getting back to me on the reply...

i tried running htpasswd -c /folder1/folder2/.htpasswd Robin01
and it returned with command not found...
i also noticed that you added .htpasswd.user.. but the research i did doesn't seem to have the user part in it....

i guess i need to run htpasswd -c to get it to work.. i manulaly created the .htpasswd...this could be the problem then...

but yes.. it keeps displaying command not found.
ran it from root folder, apache folder and the results are still the same...

Last edited by Robin01; 12-23-2003 at 09:56 PM.
 
Old 12-24-2003, 02:30 AM   #4
twantrd
Senior Member
 
Registered: Nov 2002
Location: CA
Distribution: redhat 7.3
Posts: 1,438

Rep: Reputation: 52
Hi,

Yea, you should run the htpasswd command. If it's not found, maybe the path for your username isn't specified. In this case, run:

whereis htpasswd

Once you get the full path, run it like so (an example of mine):

/usr/sbin/htpasswd -c <blahblah>.

As far as the .htpasswd.user, you can name the htpasswd whatever you like by running the htpasswd command. As stated above, when you run the command:

htpasswd -c /folder1/folder2/.htpasswd Robin01

The htpasswd file is now .htpasswd in /folder1/folder2. Then you must specify this path in .htaccess. Let me know if you need more help. Good luck again.

-twantrd
 
Old 12-24-2003, 03:36 PM   #5
Robin01
Member
 
Registered: Aug 2003
Posts: 104

Original Poster
Rep: Reputation: 15
got it to work
the .htpasswd was located in the apache/bin folder....
so i ran it from there.. and tested ok
Thanks
 
  


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 not authenticating BrianK Linux - Software 3 12-10-2004 02:52 PM
.htaccess / .htpasswd inq Robin01 Linux - Newbie 1 12-20-2003 05: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


All times are GMT -5. The time now is 04:49 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration