.htaccess - Password protection, wrong path to .htpasswd? Help?

Discussion in 'Apache' started by KyleVA, Apr 20, 2009.

  1. #1
    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:

    
    AuthName "Restricted Area" 
    AuthType Basic 
    AuthUserFile /httpdocs/password/.htpasswd 
    AuthGroupFile /dev/null 
    require valid-user
    Code (markup):
    Next, I place the .htpasswd in the /password/ directory as well and it contains the following information:

    
    testpass1:eLQB2fGpHBoBw
    testpass2:4MlWHqE6U8Zhk
    testpass3:icfwKqVbrYkw6
    testpass4:7zw5jrrT/azTY
    Code (markup):
    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.
     
    KyleVA, Apr 20, 2009 IP
  2. KyleVA

    KyleVA Peon

    Messages:
    2
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Any help? =X
     
    KyleVA, Apr 21, 2009 IP
  3. szalinski

    szalinski Peon

    Messages:
    341
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #3
    you don't put a slash before httpdocs/. also, that's an incorrect path. you need either the absolute path, a relative path, or since the htpasswd is in the same directory, simply AuthUserFile ".htpasswd" should do. not sure though.

    anyway read up on this: http://httpd.apache.org/docs/2.0/mod/mod_auth.html#authuserfile
     
    szalinski, May 26, 2009 IP