Keep Server Online
If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.
or
A donation makes a contribution towards the costs, the time and effort that's going in this site and building.
Thank You! Steffen
Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
| |
|
Topic: .htacess problem |
|
Author |
|
Bob B.
Joined: 06 Jul 2006 Posts: 10
|
Posted: Thu 06 Jul '06 3:43 Post subject: .htacess problem |
|
|
I am using Apache 2.2 with Windows 2000 server.
In testing .htacess in a member-only directory, when I access the page xxx.com/member-only, I get the password request from htaccess. If I enter my user ID and password, it doesn't accept it. My server gives me the error:
[Wed Jul 05 17:05:00 2006] [error] [client 71.114.32.208] user webmaster: authentication failure for "/member-only": Password Mismatch
My User ID is "webmaster" and my password is "test". Now here is what is weird...If I go to .htpassword and copy the encrypted password (pmlgNlFILlqkg) created by a subcription script I purchased, and insert it into the password form instead of "test" it works!!
It's like it's not being un-encrypted. I don't think it has anything to do with the script that encrypts the password since it accepts it encrypted. Could it be something to do with spaces in folder names that is common with windows??
By the way, to get .htaccess to work at all to begin with, I had to put the path to the password file in quotes as in:
AuthUserFile "C:/Program Files/Apache Software Foundation/Apache2.2/htdocs/member-only/.htpassword"
Any help would be appreciated.
Thanks,
Bob |
|
Back to top |
|
James Blond Moderator
Joined: 19 Jan 2006 Posts: 7371 Location: Germany, Next to Hamburg
|
Posted: Thu 06 Jul '06 7:53 Post subject: |
|
|
We have a topic about that...
http://www.apachelounge.com/viewtopic.php?p=1589
On Windows you should try to save the password in plain text.
There is also a php solution
Code: |
<?php
//php5 Anpassung
$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER'];
$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW'];
//
$users = array(
"user"=>"passwort",
"anonyme"=>"devine"
);
$auth_text = "Du darfst hier nicht rein!";
if(!(empty($PHP_AUTH_USER) || empty($PHP_AUTH_PW)) && $PHP_AUTH_PW==$users[$PHP_AUTH_USER]){
include("page.php");
}
else{
header("www-authenticate: basic realm=\"$auth_text\"");
header("http/1.0 401 unauthorized");
}
?>
|
|
|
Back to top |
|
Bob B.
Joined: 06 Jul 2006 Posts: 10
|
Posted: Thu 06 Jul '06 14:49 Post subject: Thanks |
|
|
Thanks for the info. I have passed it on to the author of my subscription software. Here is a site I found that has a free download of MD5 encryption if anyone can use it:
http://www.allhype.co.uk/tools/md5/
Thanks again..
Bob B. |
|
Back to top |
|
|
|
|
|
|