无聊的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,可能忽略了这个,而思考其他方面而偏离了主题。在此记录下,以备查用!

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值