Solved

htaccess -problems getting it to authenticate

Posted on 2004-08-23
2
282 Views
Last Modified: 2010-03-04
Hi all,
I'm try to protect some folders using htaccess and can't seem to get it working, it just won't authenticate when I go into the test folder. I'm prompted to enter a password, it never accepts it and after 3 attemps brings up the Authentication Required Error 401 page.
It's Apache running under RedHat 9.
The .htaccess file is placed into the test folder /var/www/html/test and it is:
AuthUserFile /var/www/html/.htpasswd
AuthGroupFile /dev/null
AuthName "Secure Section"
AuthType Basic
require valid-user

I create user 'test' for the .htpasswd file in /var/www/html using the command:
htpasswd -c .htpasswd test
...and enter a password.

The file gets created ok and contains:
test:passwordhash

The httpd config file has AllowOverride set to All. From the httpd.conf file:

# First, we configure the "default" to be a very restrictive set of
# features.  
#
<Directory />
    Options FollowSymLinks
    AllowOverride None
</Directory>

# This should be changed to whatever you set DocumentRoot to.
#
<Directory "/var/www/html">
    Options Indexes FollowSymLinks
    AllowOverride All
    Order allow,deny
    Allow from all
</Directory>

<LocationMatch "^/$>
    Options -Indexes
    ErrorDocument 403 /error/noindex.html
</LocationMatch>

<IfModule mod_userdir.c>
    UserDir public_html
</IfModule>

<Directory /home/*/public_html>
    AllowOverride All
    Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec
    <Limit GET POST OPTIONS>
        Order allow,deny
        Allow from all
    </Limit>
    <LimitExcept GET POST OPTIONS>
        Order deny,allow
        Deny from all
    </LimitExcept>
</Directory>

DirectoryIndex index.html index.html.var

AccessFileName .htaccess

<Files ~ "^\.ht">
    Order allow,deny
    Deny from all
</Files>

-----
Any ideas on what the problem is or what to check out next?

cheers
Andrew

0
Comment
Question by:manta357
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 19

Accepted Solution

by:
ramazanyich earned 150 total points
ID: 11875817
It seems that apache server can't read .htpasswd file. Check errors log file of apache server. Check also that user who owns httpd processes has access to .htpasswd file
0
 

Author Comment

by:manta357
ID: 11884622
thanks that got me on the right track. Was a problem with the ownership of the htpasswd file.
0

Featured Post

Prepare for your VMware VCP6-DCV exam.

Josh Coen and Jason Langer have prepared the latest edition of VCP study guide. Both authors have been working in the IT field for more than a decade, and both hold VMware certifications. This 163-page guide covers all 10 of the exam blueprint sections.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction As you’re probably aware the HTTP protocol offers basic / weak authentication, which in combination with the relevant configuration on your web server, provides the ability to password protect all or part of your host.  If you were not…
If you've heard about htaccess and it sounds like it does what you want, but you're not sure how it works... well, you're in the right place. Read on. Some Basics #1. It's a file and its filename is .htaccess (yes, with a dot in the front). #…
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…

630 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question