Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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.
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
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:
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.
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??
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.