LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   .htaccess .htpasswd issue (https://www.linuxquestions.org/questions/linux-newbie-8/htaccess-htpasswd-issue-128544/)

Robin01 12-23-2003 09:13 PM

.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/
name:password

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

twantrd 12-23-2003 09:43 PM

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

Robin01 12-23-2003 09:55 PM

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

twantrd 12-24-2003 02:30 AM

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

Robin01 12-24-2003 03:36 PM

got it to work
the .htpasswd was located in the apache/bin folder....
so i ran it from there.. and tested ok
Thanks


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