Author |
|
sb.net
Joined: 22 Sep 2006 Posts: 120 Location: USA
|
Posted: Sat 30 Sep '06 16:21 Post subject: .htpasswd |
|
|
i have this htpasswd file:
and this htaccess file: Code: | AuthName "Restricted Area"
AuthType Basic
AuthUserFile .htpasswd
AuthGroupFile /dev/null
require valid-user |
It comes up with the login screen, but when i submit the username and password it comes up with this error. Quote: | Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, something@something.com and inform them of the time the error occurred, and anything you might have done that may have caused the error.
More information about this error may be available in the server error log. |
Am i doing anything wrong?
Last edited by sb.net on Sun 01 Oct '06 22:01; edited 1 time in total |
|
Back to top |
|
James Blond Moderator
Joined: 19 Jan 2006 Posts: 7364 Location: Germany, Next to Hamburg
|
Posted: Sat 30 Sep '06 17:46 Post subject: |
|
|
AuthGroupFile /dev/null is from Unix system (trash / delete)! Do you have a folder /dev/null? Nope you have not! |
|
Back to top |
|
sb.net
Joined: 22 Sep 2006 Posts: 120 Location: USA
|
Posted: Sat 30 Sep '06 18:15 Post subject: |
|
|
what do I put there |
|
Back to top |
|
Jorge
Joined: 12 Mar 2006 Posts: 376 Location: Belgium
|
Posted: Sat 30 Sep '06 22:09 Post subject: |
|
|
Try
Code: | AuthName "Restricted Area"
AuthType Basic
AuthUserFile /full/path/to/file/.htpasswd
require valid-user |
|
|
Back to top |
|
sb.net
Joined: 22 Sep 2006 Posts: 120 Location: USA
|
Posted: Sun 01 Oct '06 1:51 Post subject: |
|
|
thanks, the error does not come up anymore. Now i have another problem. it keeps asking me for the username and password. |
|
Back to top |
|
James Blond Moderator
Joined: 19 Jan 2006 Posts: 7364 Location: Germany, Next to Hamburg
|
Posted: Sun 01 Oct '06 13:10 Post subject: |
|
|
sb.net wrote: | it keeps asking me for the username and password. |
???? AuthType Basic is for asking the username and the password! What do you want to do? |
|
Back to top |
|
sb.net
Joined: 22 Sep 2006 Posts: 120 Location: USA
|
Posted: Sun 01 Oct '06 16:12 Post subject: |
|
|
No when i type in the user name and password and press ok it asks up for it again (and again). |
|
Back to top |
|
James Blond Moderator
Joined: 19 Jan 2006 Posts: 7364 Location: Germany, Next to Hamburg
|
Posted: Sun 01 Oct '06 20:33 Post subject: |
|
|
how did you create the .htpasswd file? Which encryption did you use? |
|
Back to top |
|
sb.net
Joined: 22 Sep 2006 Posts: 120 Location: USA
|
|
Back to top |
|
ali_fareed
Joined: 04 Jul 2006 Posts: 61 Location: Bahrain
|
Posted: Mon 02 Oct '06 7:54 Post subject: |
|
|
I'm not sure but i think you have a unix crypt hash which isnt the default in windows use apr-1 md5 by using htpasswd.exe |
|
Back to top |
|
Jorge
Joined: 12 Mar 2006 Posts: 376 Location: Belgium
|
Posted: Mon 02 Oct '06 12:45 Post subject: |
|
|
you should execute
htpasswd.exe -cs .htpasswd usernamehere
from your apache bin folder. |
|
Back to top |
|
sb.net
Joined: 22 Sep 2006 Posts: 120 Location: USA
|
Posted: Mon 02 Oct '06 18:35 Post subject: |
|
|
That worked great Thanks soooooooooooooo much!!!!
Why did the one in the internet not work? Is there one that works? |
|
Back to top |
|
ali_fareed
Joined: 04 Jul 2006 Posts: 61 Location: Bahrain
|
Posted: Mon 02 Oct '06 20:27 Post subject: |
|
|
Jorge why add -s to htpasswd? sha is useful for migration from other servers like netscape but it is less secure than apache md5 because apache's variant is salted while sha isn't so an apache md5 will give many different hashes for the same password |
|
Back to top |
|
Jorge
Joined: 12 Mar 2006 Posts: 376 Location: Belgium
|
Posted: Tue 03 Oct '06 11:19 Post subject: |
|
|
ali_fareed wrote: | Jorge why add -s to htpasswd? sha is useful for migration from other servers like netscape but it is less secure than apache md5 because apache's variant is salted while sha isn't so an apache md5 will give many different hashes for the same password |
I had some problems shareing a password file using md5 between Win32 and Mac variants, I didn't have that with sha1
sb.net wrote: | That worked great Thanks soooooooooooooo much!!!!
Why did the one in the internet not work? Is there one that works? |
Why it didn't work?
the format was user:crypt(password)
the crypt command doesn't exist on windows.
I know of no web based one. I do have a php class that can be used to manage htpasswd files (= validate users, add users and delete users) |
|
Back to top |
|
sb.net
Joined: 22 Sep 2006 Posts: 120 Location: USA
|
Posted: Tue 03 Oct '06 17:56 Post subject: |
|
|
ok, thank you. |
|
Back to top |
|
Jorge
Joined: 12 Mar 2006 Posts: 376 Location: Belgium
|
|
Back to top |
|