无聊的apache错误(.htaccess pcfg_openfile)

简介:

apache的错误见得不少,可是这个错误还真被忽略了,今天一台web服务器出现访问403异常,查看配置文件均无问题,而在error.log文件中,给出了类似这么几行提示:

[Tue Oct 26 12:42:58 2010] [crit] [client 8.8.8.8] (13)Permission denied: /cicro/.htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable
[Tue Oct 26 12:42:59 2010] [crit] [client 8.8.8.8] (13)Permission denied: /cicro/.htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable
[Tue Oct 26 12:42:59 2010] [crit] [client 8.8.8.8] (13)Permission denied: /cicro/.htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable
[Tue Oct 26 12:42:59 2010] [crit] [client 8.8.8.8] (13)Permission denied: /cicro/.htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable
[Tue Oct 26 12:42:59 2010] [crit] [client 8.8.8.8] (13)Permission denied: /cicro/.htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable
[Tue Oct 26 12:43:28 2010] [crit] [client 8.8.8.8] (13)Permission denied: /cicro/.htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable

刚开始认为是/cicro/.htaccess 文件权限导致的,结果发现根本无此文件,接着创建了一个/cicro/.htaccess文件,错误仍然继续, 经过分析,不是缺少这个文件导致的错误,因为没有此文件,是不会影响web访问的。

经过仔细分析,发现了问题的根源,如果日志提示是其它目录的.htaccess不可读取,一般是因为上级目录的权限或者属主用户组错误。目录的正确权限应该为755,不过权限不是apache的root目录,而是存放程序文件的主目录,由此将问题定位到了/cicro这个目录上,查看cicro目录的权限,发现了问题的实质!

drw-rw-rw   9 root root  4096 10-26 13:03 cicro

这个权限真是有意思,不知道是误操作还是别人在练习命令,改回755应该就好了。

chmod -R 755 /cicro

其实linux下root创建的目录,默认权限都是755,可能忽略了这个,而思考其他方面而偏离了主题。在此记录下,以备查用!




















本文转自南非蚂蚁51CTO博客,原文链接:http://blog.51cto.com/ixdba/526045 ,如需转载请自行联系原作者








相关文章
|
11月前
|
Apache
Apache配置文件httpd.conf/htaccess中deny和allow的使用
Apache配置文件httpd.conf/htaccess中deny和allow的使用
122 0
|
Apache Windows
Apache下htaccess文件不起作用/rewrite 没有效果
Apache下htaccess文件不起作用/rewrite 没有效果
248 0
|
JavaScript Apache PHP
Apache的.htaccess利用技巧
Apache的.htaccess利用技巧
201 0
|
Apache
apache 设置.htaccess 禁止ip访问
网站遭受攻击,拦截ip访问
250 0

热门文章

最新文章

推荐镜像

更多