Development .htaccess & .htpasswd

Discussion in 'Software' started by simon w, 26 May 2004.

  1. simon w

    simon w What's a Dremel?

    Joined:
    3 Nov 2003
    Posts:
    1,302
    Likes Received:
    0
    I've setup Apache 1.3.31 under Windows and I'm trying to password protect a sub-directory on the server (/contacts/).

    The root directory for Apache is D:\webserver\wwwroot\

    I've placed .htpasswd in D:\webserver\ and used this website to encrypt my password. I copied & pasted the output from the website into .htpasswd.

    I've placed .htaccess in D:\webserver\wwwroot\contacts\
    Here it is:
    Code:
    AuthUserFile d:/webserver/.htpasswd
    AuthName EnterPassword
    AuthType Basic
    
    require user simon
    
    I've edited httpd.conf and set AllowOverride to All for the root directory.

    When I browse to http://localhost/contacts/ I am prompted for a password, which I enter, but it seems to think the password is wrong as the password dialogue pops back up again and again?!?!?!

    I've just tried using another website to encrypt the password, but it still doesn't work :grr:
     
  2. RTT

    RTT #parp

    Joined:
    12 Mar 2001
    Posts:
    14,120
    Likes Received:
    74
    Windows and Unix encryption is different - i think with windows you can just put the password in plaintext in the .htpassword file :)
     
  3. simon w

    simon w What's a Dremel?

    Joined:
    3 Nov 2003
    Posts:
    1,302
    Likes Received:
    0
    That did it :D

    Glad to see Windows is nice and secure :rolleyes:
     
  4. RTT

    RTT #parp

    Joined:
    12 Mar 2001
    Posts:
    14,120
    Likes Received:
    74
    Yeah, great isn't it... :duh: Just keep the .htaccess file out of the docroot and that'll make it secure enough... :)
     
  5. modding-monkey

    modding-monkey What's a Dremel?

    Joined:
    29 Jan 2004
    Posts:
    200
    Likes Received:
    0
    hi there.
    i tryed this htaccess thing and gues what im having problems with it!!!

    my .htpasswd is in \\Computer-room\d\server\www\.htpasswd which is the root folder.

    my .htaccess file is in \\Computer-room\d\server\www\test\.htaccess

    the code in my .htaccess file is

    Code:
    AuthUserFile \\Computer-room\d\server\www\.htpasswd
    AuthName test
    AuthType Basic
    require user evilsprouts
    
    im creating the files over a network of 2 computers

    the computer which the website is served from is called
    Computer-room

    please tell me what to do??? :wallbash: :D
     
  6. RTT

    RTT #parp

    Joined:
    12 Mar 2001
    Posts:
    14,120
    Likes Received:
    74
    Hi, try putting ""s around the paths to the files in your .htaccess file. If that doesn't work then apache may not understand how to grab the files over the network (if i understand your setup correctly).
     
  7. modding-monkey

    modding-monkey What's a Dremel?

    Joined:
    29 Jan 2004
    Posts:
    200
    Likes Received:
    0
    Nah that don’t work!
    :sigh:

    This is frustrating!

    Please would u be able to make the files 4 me so I can download them and try??? :D

    the root directory is d:\server\www\
    the test folder is d:\server\www\test\

    The folder which I want to be protected is called test and its URL is http://evilsprouts.no-ip.com/test/

    I want hello to be my username and website to be my password

    If u needs to know anything else about it plz ask me!!! :D
     

Share This Page