LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This 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


Reply
  Search this Thread
Old 12-14-2005, 11:24 AM   #1
scott.anderson
Member
 
Registered: Mar 2005
Location: Natick, MA
Distribution: Redhat EL 5.2, Fedora 8
Posts: 30

Rep: Reputation: 15
permission denied on .htaccess files in Apache


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.

Any idea why this would be an error at all?

Scott
 
Old 12-14-2005, 01:10 PM   #2
Gort32
Member
 
Registered: Sep 2004
Distribution: Slack!
Posts: 150

Rep: Reputation: 15
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.
 
Old 12-14-2005, 01:26 PM   #3
scott.anderson
Member
 
Registered: Mar 2005
Location: Natick, MA
Distribution: Redhat EL 5.2, Fedora 8
Posts: 30

Original Poster
Rep: Reputation: 15
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.
 
Old 12-16-2005, 12:19 PM   #4
Gort32
Member
 
Registered: Sep 2004
Distribution: Slack!
Posts: 150

Rep: Reputation: 15
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.
 
  


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
Permission Denied while coping files busaussie Linux - General 5 01-05-2006 11:26 AM
permission denied for root in FC4: why can't I modify own files? ixis Linux - General 4 12-10-2005 06:05 PM
Python CGI script can't write files, permission denied The_Nerd Programming 4 03-17-2005 12:19 PM
Uploading files using PHP giving Permission Denied error MatthewG Programming 4 05-27-2004 03:38 PM
Keep getting "Permission Denied" when trying to write files dunnd40 Debian 2 02-01-2004 10:29 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 06:09 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