Link to home
Start Free TrialLog in
Avatar of Mark
Mark

asked on

trouble with .htaccess file, apache

I'm running apache 2.4.10 on Linux Slackware64 14.1 kernel 3.10.17.

This .htaccess file works:
AuthType Basic
AuthName "DAV-upload"
AuthUserFile /etc/httpd/passwords
Require user joe

Open in new window

This one does not:
AuthType Basic
AuthName "DAV-upload"
Require valid-user

Open in new window

I get
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Why? Apache docs indicates 'valid-user' "will allow anyone in that is listed in the password file, and who correctly enters their password." http://httpd.apache.org/docs/2.4/howto/auth.html. And, 'valid-user' appears to be permitted in .htaccess files:  http://weavervsworld.com/docs/other/passprotect.html

What am I doing wrong?
ASKER CERTIFIED SOLUTION
Avatar of bvtech
bvtech

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Mark
Mark

ASKER

bvtech:
have you tried to insert also  AuthUserFile /etc/httpd/passwords
I did try that and it worked ... sort of. It only authenticates with people in the /etc/httpd/passwords file. But ah ha, maybe that's what it means by 'valid-user' "will allow anyone in that is listed in the password file, and who correctly enters their password."  They're not talking about the OS password file, they're talking about the Apache password file, right?
SOLUTION
Avatar of Lucas Bishop
Lucas Bishop
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Mark

ASKER

Thanks. I did write a script to create the http password file from the /etc/shadow file, so at least that simplifies things and the users don't have to remember 2 passwords:

cut -d: -f1,3 /etc/passwd | grep ":300" | cut -d: -f1 | \
while read
do
    grep "^$REPLY" /etc/shadow | cut -d: -f1,2
done > /etc/httpd/passwords