Solved

trouble with .htaccess file, apache

Posted on 2015-02-06
4
108 Views
Last Modified: 2015-02-08
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?
0
Comment
Question by:jmarkfoley
  • 2
4 Comments
 

Accepted Solution

by:
bvtech earned 400 total points
ID: 40594196
Hi there,
have you tried to insert also
AuthUserFile /etc/httpd/passwords
in the second configuration file?
This is necessary, if you use "local grants'" configuration.
Let me know.
Ciao
0
 
LVL 1

Author Comment

by:jmarkfoley
ID: 40595019
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?
0
 
LVL 16

Assisted Solution

by:Lucas Bishop
Lucas Bishop earned 100 total points
ID: 40596559
They're not talking about the OS password file, they're talking about the Apache password file, right?

Correct. The list of "valid users" is contained inside the file specified via AuthUserFile, hence needing to specify the path to this file in the config.
0
 
LVL 1

Author Closing Comment

by:jmarkfoley
ID: 40597503
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
0

Featured Post

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

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

If you are running a LAMP infrastructure, this little code snippet is very helpful if you are serving lots of HTML, JavaScript and CSS-related information. The mod_deflate module, which is part of the Apache 2.2 application, provides the DEFLATE…
Over the last year I have answered a couple of basic URL rewriting questions several times so I thought I might as well have a stab at: explaining the basics, providing a few useful links and consolidating some of the most common queries into a sing…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

776 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