Find the answer to your Linux question:
Results 1 to 4 of 4
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    Problem getting .htaccess working

    Im trying to password protect a folder on my webserver. I have everything working i.e. it asks for the username and password when I try to access the folder but when I enter them, it says the password or username is wrong (it is not, I have checked many, many times). I thought maybe apache doesn't have the rights to the .htpasswd file so i did a "chown root:apache .htpasswd" on it, but that didnt help.

    This is my .htaccess files contents:

    AuthUserFile /usr/local/apache2/htdocs/private/.htpasswd
    AuthGroupFile /dev/null
    AuthName "private area"
    AuthType "Basic"
    <Limit GET POST>
    require valid-user
    Yes, my .htpasswd file is located in /usr/local/apache2/htdocs/private. To create the user I made the file with the command htpasswd -c .htpasswd username, and it said user and password created.

    Do I need to set some permissions or what? Please help, this is driving me nuts.

  2. #2

  3. #3
    u shoud change the group and not the owner of the file
    .htpasswd tp apache. and give the read permission or whatever
    u want to give , give to the group.

    try these these commands..

    # htpasswd -mc .htpasswd username
    # chgrp apache .htpasswd
    # chmod g+r .htpasswd

    besides this make an entry in httpd.conf
    inside the <Directory> block..

    AllowOverride AuthConfig


  4. $spacer_open
  5. #4

    problem with htaccess...

    the problem is with the encryption algorithm used be htpaccess
    you might use this perl script to generate the password for .htaccess file.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts