Results 1 to 6 of 6

Thread: .htaccess problems, not working!

  1. #1
    Squeeler Vini's Avatar
    Join Date
    Jul 2003
    Location
    Sheffield
    Posts
    1,769
    Thanks
    44
    Thanked
    8 times in 8 posts

    .htaccess problems, not working!

    got a WAMP setup, dropped a .htaccess:

    Code:
    AuthType Basic
    AuthUserFile .htpasswd
    AuthName "Vini"
    require valid-user
    satisfy all
    into my /dir/ with a .htpasswd file in there too

    but when i browse to http://site.site.site/dir/ it just lists the contents in a listing.

    what am i doing wrong?

  2. #2
    Member
    Join Date
    Sep 2005
    Posts
    59
    Thanks
    0
    Thanked
    0 times in 0 posts
    Does you host allow .htaccess?

    I use:
    Code:
    <Limit GET POST PUT>
    deny from all
    AuthUserFile /FULL/PATH/.htpasswd
    AuthGroupFile /dev/null
    AuthName "VALIDATED ACCESS REQUIRED - LOGIN!"
    AuthType Basic
    require valid-user
    </Limit>

  3. #3
    Squeeler Vini's Avatar
    Join Date
    Jul 2003
    Location
    Sheffield
    Posts
    1,769
    Thanks
    44
    Thanked
    8 times in 8 posts
    still having problems.

    getting

    PHP Code:
    [Mon Sep 26 11:47:14 2005] [error] [client 10.1.10.217user viniauthentication failure for "/admin"Password Mismatchrefererhttp://site.site.co.uk/ 
    in my apache log.

  4. #4
    Registered User
    Join Date
    Oct 2005
    Posts
    13
    Thanks
    0
    Thanked
    0 times in 0 posts
    You might need to put the full path to the password file, e.g. this is one of my .htaccess files, which does work:

    AuthName "Website log files"
    AuthType Basic
    AuthUserFile /pub/home/richardl/.htpasswd
    Require valid-user

  5. #5
    Registered User
    Join Date
    Oct 2005
    Posts
    13
    Thanks
    0
    Thanked
    0 times in 0 posts
    Oh, and it just occurred to me that in the above example, the password file is not in the same directory as the .htaccess file (in fact it is not in the website directory tree at all).

    I seem to remember that it's recommended to keep the password file separate for security - if not, make sure that the permissions on the password file don't allow it to be read (except by Apache, obviously).

  6. #6
    Member
    Join Date
    Oct 2005
    Posts
    92
    Thanks
    0
    Thanked
    0 times in 0 posts
    Also for security you should make the file only readable by the web user (i think) just in case someone gets into your box and starts digging around.

    How have you put the names into your password file. You need to use the tool htpasswd which converts the password into a MD5 hash. If you don't have a command line on the server you can also run this tool at a number of websites if you can find one you trust.

    If that isn't your problem check the permissions on the file. The bit below is quoted from the apache site.

    The password is stored in the password file in encrypted form, so that users on the system will not be able to read the file and immediately determine the passwords of all the users. Nevertheless, you should store the file in as secure a location as possible, with whatever minimum permissions on the file so that the web server itself can read the file. For example, if your server is configured to run as user nobody and group nogroup, then you should set permissions on the file so that only the webserver can read the file and only root can write to it:

    chown root.nogroup /usr/local/apache/passwd/passwords
    chmod 640 /usr/local/apache/passwd/passwords
    I hope this helps.
    Nick

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. My experience with Windows XP Pro x64 Edition
    By Paul Adams in forum Software
    Replies: 7
    Last Post: 20-04-2007, 11:59 PM
  2. SE K750i file manager and software problems
    By autopilot in forum Smartphones and Tablets
    Replies: 16
    Last Post: 27-07-2005, 12:39 PM
  3. SQL problems and CSS problems
    By Kezzer in forum Software
    Replies: 7
    Last Post: 11-12-2004, 03:20 AM
  4. Having a few new rig problems, please help!
    By sagramore in forum PC Hardware and Components
    Replies: 33
    Last Post: 03-08-2004, 06:34 PM
  5. Troubleshooting - Software & Driver problems
    By Steve in forum Help! Quick Relief From Tech Headaches
    Replies: 0
    Last Post: 09-07-2004, 06:30 PM

Posting Permissions

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