LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 07-12-2003, 02:55 AM   #1
terek
Member
 
Registered: Jun 2002
Location: Utah
Distribution: Fedora 5
Posts: 32

Rep: Reputation: 15
401 Authorization Required


I have spent a long time researching this and have been reading various posts here (using the search engine of course) and have been reading on www.apache.org. I cannot seem to solve this problem.

K, I am trying to make it so each individual's directory will require a user authentication for them to access their /public_html/ directory. Here is the last little bit I have on my /etc/httpd/conf/httpd.conf file

<Directory "home/*/public_html">
AuthType Basic
AuthName MyPrivateFile
AuthUserFile /home/.htpasswd-allusers
Satisfy All
Require file-owner
</Directory>

the file owner in this example is testapache

When I try to access the webpace of mydomain.com/~testapache
and type in user name of testapache, with testapache's password
it doesn't accept it and gives me a 401 authorization required error after 3 attempts.

Yet when I make 1 simple change of Require file-owner to:
Require user testapache
it will accept testapache with testapache's password.

Do I just create one of these for every single directory with the Require user command or is there a way for me to authenticate it with a specific owner.

I am using Apache 2.0.40
 
Old 07-12-2003, 05:01 AM   #2
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 64
I can't see anything about that option in the apache docs:
http://httpd.apache.org/docs-2.0/mod/core.html#require

I don't know but maybe you could use:
require user *
 
Old 07-12-2003, 10:26 AM   #3
terek
Member
 
Registered: Jun 2002
Location: Utah
Distribution: Fedora 5
Posts: 32

Original Poster
Rep: Reputation: 15
I found it in the FAQ.

I went to the FAQ (http://httpd.apache.org/docs/misc/FAQ.html)
section G Authentication and access restrictions

Item 2 How do I set up Apache to require a username and password to access certain documents?

Then took the mod_Auth link (http://httpd.apache.org/docs/mod/mod_auth.html)

Here is what it says.

file-owner
[Available after Apache 1.3.20] The supplied username and password must be in the AuthUserFile database, and the username must also match the system's name for the owner of the file being requested. That is, if the operating system say the requested file is owned by jones, then the username used to access it through the Web must be jones as well.

It looks like they probably disabled this option in 2.0 and their FAQ is for 1.3 still.

Unfortunately the asterisk does not work either (Require user *)

Thank you for your help david_ross
 
Old 07-12-2003, 10:33 AM   #4
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 64
maybe you could put the * in the AuthUserFile - eg have one in each home directory or just use a virtual path such as just ".htaccess" (I think this should let you specify one in each of the home dirs) From there you could just use "require valid-user"
 
Old 07-12-2003, 10:54 AM   #5
terek
Member
 
Registered: Jun 2002
Location: Utah
Distribution: Fedora 5
Posts: 32

Original Poster
Rep: Reputation: 15
The * in the AuthUserFile doesnt work either. Looks like I will have to just either set it up for each directory or allow the .htaccess file to allow the override and set it up in each directory.

Thanks for your help david_ross
 
Old 07-12-2003, 11:01 AM   #6
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 64
The only other solution I can think of is not to use the home feature at all and use a perl script (you can include a script in the config) to build a list of users from the htpasswd file and create an entry for each in the config file.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
1905-s277,401, and arch goffa Linux - Networking 3 07-22-2004 06:25 PM
problems with satellite 2450-401 jamaso Linux - Laptop and Netbook 1 02-28-2004 02:12 PM
[access] continuous authorization required wuck LQ Suggestions & Feedback 2 09-26-2003 04:38 AM
401 ErrorDocument with Apache c0c0deuz Linux - General 3 11-17-2002 07:43 AM
Mpu-401 Serena Linux - General 0 04-24-2002 09:05 PM


All times are GMT -5. The time now is 09:26 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration