Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
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 was checking the /var/log/httpd/error_log on my server and I found a number of critical messages saying:
...permission denied /home/foo/public_html/bar/baz/.htaccess
unable to check htaccess file, ensure it is readable
Usually, such a message means, obviously, that there's a .htaccess file in the directory with the wrong permissions or the directory has the wrong permissions. However, in the cases I saw, there was no such file at all. There were files in the directory, and they were perfectly readable from the web, so the directory permissions are fine. I double-checked the whole path to be sure, and they are all 755.
There should be a setting httpd.conf that deals with .htaccess files. In short, if someone asks for that file Apache won't even go out and look - it will simply deny access up front. Trying to access .htaccess files is a very common automated attack/scan - it's just part of the background static of being on the Internet and shouldn't be anything major to worry about.
Thanks Gort. Yes, it is possible to turn off .htaccess files entirely (and improve performance as well), but I don't want to do that. I have many users and I want them to be able to protect or unprotect directories without intervention by the sysadmin (me). If they get the permissions wrong, I can fix it, but it's annoying to be told the permissions on a file are wrong when the file doesn't even exist.
Hmm. Your last sentence is intriguing, though. Are you saying that someone might be trying to GET the .htaccess file specifically? Shouldn't I see that in the access log, with a 404 as the return status?
Scott
Last edited by scott.anderson; 12-14-2005 at 01:28 PM.
You should see a GET in your logs, but it wouldn't give a 404, even if the file is not there. Because .htacess is "special" and apache has special security on .ht* files specifically, if you try to GET a .ht* file apache will just outright deny the request with a 403 error. Apache doesn't even tell the client whether the .ht* file is there or not.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.