Solved

trouble with .htaccess file, apache

Posted on 2015-02-06
4
100 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

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

As Wikipedia explains 'robots.txt' as -- the robot exclusion standard, also known as the Robots Exclusion Protocol or robots.txt protocol, is a convention to prevent cooperating web spiders and other web robots from accessing all or part of a websit…
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…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

757 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

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now