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: .htaccess-Password protection wrong path to .htpasswd? Help?
Author
KyleVA



Joined: 21 Apr 2009
Posts: 3

PostPosted: Tue 21 Apr '09 16:09    Post subject: .htaccess-Password protection wrong path to .htpasswd? Help? Reply with quote

Here, let me present a scenario that is equal to the problem I'm having. Let's start off by saying I'd like to password protect the following directory: mywebsite.com/password/. And also, my host directory is /httpdocs/.

Now, in the /password/ directory I place the .htaccess file which contains the following information:

Code:

AuthName "Restricted Area"
AuthType Basic
AuthUserFile /httpdocs/password/.htpasswd
AuthGroupFile /dev/null
require valid-user


Next, I place the .htpasswd in the /password/ directory as well and it contains the following information:


Code:

testpass1:eLQB2fGpHBoBw
testpass2:4MlWHqE6U8Zhk
testpass3:icfwKqVbrYkw6
testpass4:7zw5jrrT/azTY


testpass1:testpass1
testpass2:testpass2
etc..

Anyways, when I go to mywebsite.com/password/ and enter the user information testpass1:testpass1 it doesn't work.Am I specifying the wrong path? I figure I have to be. I'm just unsure what I'm doing wrong.
Back to top
James Blond
Moderator


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

PostPosted: Tue 21 Apr '09 16:43    Post subject: Reply with quote

Is the httpdocs folder realy in the root folder? Or is it in something like /var/www/httpdocs? What is in your error_log about that? Which version of apache do you use? Which OS do you use? Which auth modules does your apache load?
Back to top
KyleVA



Joined: 21 Apr 2009
Posts: 3

PostPosted: Tue 21 Apr '09 16:52    Post subject: Reply with quote

Heh, I apologize man. I really don't know too much about servers/Apache, etc. Hopefully I can still provide enough information so that you guys can help.

And, in Dreamweaver @ my remote site settings - I have /httpdocs/ set as my host directory. So I'm pretty sure that's it. Server is running Apache 2.0.52. I'm using Windows XP.

And I'm unsure with auth modules my apache loads.. Whatever is default - if that helps at all, ha.
Back to top
James Blond
Moderator


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

PostPosted: Tue 21 Apr '09 17:46    Post subject: Reply with quote

Well I guess the path is wrong. /httpdocs/ is not the full path so apache can't find the .htpasswd file.
Does PHP run on your server? Than you can get the full path. easily or you can ask your hoster for the correct path.
Back to top
KyleVA



Joined: 21 Apr 2009
Posts: 3

PostPosted: Tue 21 Apr '09 18:32    Post subject: Reply with quote

Thanks man, didn't even think to run a PHP script to get the file path. To anyone else who has this problem - just upload a test php page to your web site w/ this snippet

Code:
<?php
print __FILE__;
?>


Haha, way too simple. =X
Back to top


Reply to topic   Topic: .htaccess-Password protection wrong path to .htpasswd? Help? View previous topic :: View next topic
Post new topic   Forum Index -> Apache