Results 1 to 3 of 3

Thread: .htaccess

  1. #1

    .htaccess

    Dear forum,

    I'm trying to protect one of the folder on my webserver and after googling few alternatives I've decided to use the .htaccess file and this is what I've done:

    edited "/etc/httpd/conf/httpd.conf" as follow:

    <Directory "/var/www/html">
    Options Indexes Includes FollowSymLinks
    AllowOverride all
    Allow from from all
    Order allow,deny
    </Directory>
    <Directory "/var/www/icons">
    Options Indexes MultiViews
    AllowOverride None
    Allow from from all
    Order allow,deny
    </Directory>
    <Directory "/var/www/cgi-bin">
    Options ExecCGI
    AllowOverride None
    Allow from from all
    Order allow,deny
    </Directory>


    the .htaccess file contains:

    AuthName "Enter Password"
    AuthType Basic
    AuthUserFile /var/www/html/Mydirectory/.htpasswd
    require valid-user

    then I've created the "/var/www/html/Mydirectory/.htpasswd" file with the command "htaccess -c .htpasswd username"
    then I've successfully entered the password.


    Result:

    I get promped for username and password when I open the protected pages with Netscape or IE but... for some reason is not authenticating, it keeps asking for username and password.

    does any one have any clue on what is causing the authentication to fail???

    Any help is appreciated!!!

    Thanks in advance.

  2. #2
    Administrator Moderator
    Member
    starfish's Avatar
    Join Date
    Apr 2004
    Posts
    141
    You probably need to add the AuthConfig option to the Directory container.

    <Directory /var/www/html>
    AllowOverride AuthConfig
    </Directory>

    Check this URL

    http://www.linuxhomenetworking.com/l...pachebasic.htm

    Hope this helps.

  3. #3
    Some times the solution is so obvious and simple that I even don't think about it!!!

    Thanks a lot Starfish, I've forgotten to give read permission to all users on the .htpasswd file!!!!

    Now is working!!!

    Thanks again, really appreciated!

Similar Threads

  1. .htaccess-any help on this?
    By fareen in forum Linux - General Topics
    Replies: 0
    Last Post: 01-20-2006, 08:16 PM
  2. .htaccess security
    By pinehead in forum Linux - Software, Applications & Programming
    Replies: 2
    Last Post: 06-02-2004, 03:57 PM
  3. htaccess and cookies
    By coltrane in forum Linux - Software, Applications & Programming
    Replies: 4
    Last Post: 12-27-2002, 06:29 AM
  4. apache 1.3: realms and .htaccess
    By Blaqb0x in forum Linux - Hardware, Networking & Security
    Replies: 1
    Last Post: 11-20-2002, 05:47 AM
  5. .htaccess
    By gmoreno in forum Linux - Hardware, Networking & Security
    Replies: 9
    Last Post: 05-07-2002, 02:35 PM

Bookmarks

Posting Permissions

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