logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

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.
Post new topic   Forum Index -> Apache View previous topic :: View next topic
Reply to topic   Topic: Cannot Get .htaccess and .htpasswd to work
Author
drobins



Joined: 03 Jan 2008
Posts: 2
Location: St. Catharines

PostPosted: Thu 03 Jan '08 17:19    Post subject: Cannot Get .htaccess and .htpasswd to work Reply with quote

I have been asked to protect a folder on the server. I have been trying to figure it out on my local machine before deploying it on the live box.

I can use the .htaccess file to get the login to show up but my passwords never work. I have used the password generators to create the .htpasswd file and followed all the tutorial i could find but i still can't get it going.

Are there any little things i may be missing or that i may have to change on my conf file???

here is my .htaccess file

---------------------
AuthUserFile C:\Program Files\Apache Group\Apache2\htdocs\Dave\protect\.htpasswd
AuthName "Protected Area"
AuthType Basic

<Limit GET POST>
require valid-user
</Limit>
--------------------

here is my .htpasswd file u:drobins p:drobins

--------------------
drobins:vZkwnzbcDrfKA
--------------------

my guess is it has something to do with the AuthUserFile path but i don't know how else to write the path.
Back to top
tdonovan
Moderator


Joined: 17 Dec 2005
Posts: 611
Location: Milford, MA, USA

PostPosted: Thu 03 Jan '08 19:22    Post subject: Reply with quote

I think you are using the wrong type of encrypted passwords.

On Windows, you can only use plain-text, SHA, or MD5 passwords.

See this previous post.

Try using the htpasswd program to create and populate your .htpasswd file, like this:
Code:
C:\Program Files\Apache Group\Apache2\bin\htpasswd.exe -c .htpasswd drobins
  Automatically using MD5 format.
  New password: *******
  Re-type new password: *******
  Adding password for user drobins

C:\Program Files\Apache Group\Apache2\bin\htpasswd.exe .htpasswd somebodyelse
  Automatically using MD5 format.
  New password: *******
  Re-type new password: *******
  Adding password for user somebodyelse

Note that you only use the -c switch with htpasswd.exe the first time to create a new .htpasswd file.

-tom-


Last edited by tdonovan on Thu 03 Jan '08 20:12; edited 1 time in total
Back to top
drobins



Joined: 03 Jan 2008
Posts: 2
Location: St. Catharines

PostPosted: Thu 03 Jan '08 20:10    Post subject: Reply with quote

Yeah, it was a combination of that and the path for authuserfile.

I have it working now.

I now have a second problem where the

<?
phpinfo();
?>

won't display my apache info.
I Just get a blank screen.
I'm afraid i may have changed something by accident.
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7373
Location: Germany, Next to Hamburg

PostPosted: Fri 04 Jan '08 18:40    Post subject: Reply with quote

does it work if you change <? to <?php ?
Back to top


Reply to topic   Topic: Cannot Get .htaccess and .htpasswd to work View previous topic :: View next topic
Post new topic   Forum Index -> Apache