LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 04-17-2004, 06:23 PM   #1
Louie55
Member
 
Registered: Oct 2003
Location: Nebraska
Distribution: SuSE 9.0, Redhat 9.0
Posts: 41

Rep: Reputation: 15
AuthUserFile Invalid !!???


I am running a web server with Apache 2 on Redhat 9.0. I am trying to password protect a directory with .htaccess. I have done it before (on a different server) and I am pretty sure I have the .htaccess and httpd.conf files setup right. However, when I try to access that directory with a web browser, it gives me an Internal Server Error. If I change the AllowOverride statement from AuthConfig back to None, then the page comes up fine (with no username and password of course). I thought this was weird, so I checked my Apache Error log and there are many of these statements in it:

Code:
[Sat Apr 17 18:27:32 2004] [alert] [client 186.54.31.52] /var/www/html/mydomain.com/public_html/admin/.htaccess: Invalid command 'AuthUserFile', perhaps mis-spelled or defined by a module not included in the server configuration
What the heck is wrong? I've searched the internet and have not found anything.

Louie
 
Old 04-18-2004, 05:03 AM   #2
coolamit78
Member
 
Registered: Aug 2003
Location: New Delhi, India
Distribution: RHEL AS 3/4, Windows XP
Posts: 546

Rep: Reputation: 31
Hello Louie,

Ok..looks like I caught your problem..

Well, there are 2 files required when restricting access to a directory. One of them is the .htaccess file and the other is the password file which stores passwords for all users that are entitled to access the protected directories once they enter the password.

Now, in your .htaccess file, you seem to have written something like

AuthUserFile /var/www/html/mydomain.com/public_html/admin/.htaccess

If thats the case, then the above line is incorrect.

The correct line should be

AuthUserFile /var/www/html/mydomain.com/public_html/admin/mypasswd

This file 'mypasswd' ( you can choose your own name for the password file) needs to be created too. The command to create and store password of first user to the password file 'mypasswd' would be:

htpasswd -mc /var/www/html/mydomain.com/public_html/admin/mypasswd <username>

for second user onwards, the command would be

htpasswd -c /var/www/html/mydomain.com/public_html/admin/.htaccess <username>

Note that while the .htaccess file must be located into a directory for which you want to control/restrict access. But, the password file can be located anywhere. Of course, the AuthUserFile option in the .htaccess file will let apache know the location of the password file.

I hope this helps..

Regards,

amit
 
Old 04-18-2004, 07:41 PM   #3
Louie55
Member
 
Registered: Oct 2003
Location: Nebraska
Distribution: SuSE 9.0, Redhat 9.0
Posts: 41

Original Poster
Rep: Reputation: 15
Well, my .htaccess file is pointing to the password file (/webusers). The log file is telling you which file it encountered the error in, not what file the AuthUserFile statement is pointing to. It looks like to me that the problem is deeper than a bad filepath. It is like Apache doesn't even recognize the AuthUserFile statement??

Louie

Last edited by Louie55; 04-18-2004 at 07:45 PM.
 
  


Reply



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
proftpd AuthUserFile problem nicolas9510 Linux - Software 0 01-28-2005 07:22 PM
squirremail ...it says invalid user or invalid password. rnj Fedora 9 10-25-2004 09:56 PM
proFTPD AuthUserFile Question hct224 Linux - Newbie 0 07-01-2004 01:51 AM
ProFTPD AuthUserFile/AuthGroupFile question. hct224 Linux - Newbie 0 02-17-2004 12:57 PM
proftpd AuthUserFile problem niehls Linux - Software 1 08-11-2003 06:20 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 10:05 AM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration