Apache Permission Denied问题

配置好apache的虚拟主机之后访问出现错误 

Forbidden
You don't have permission to access / on this server.

查看日志发现如下错误 

(13)Permission denied: access to / denied (filesystem path '/home/xxx/') because search permissions are missing on a component of the path

判断这个问题首先出现了日志应该apache是可以访问的,然后判断可能会是apache配置站点访问权限的问题,检查了一下conf文件如下:

 1 <VirtualHost *:9990>
 2     ServerName be.daozhang.org
 3     DocumentRoot /home/daozhang/git/public
 4 
 5     ErrorLog /var/log/httpd/daozhang/error_log
 6     CustomLog /var/log/httpd/daozhang/be_access_log combined
 7     <Directory "/home/daozhang/git/public">
 8         Options -Indexes MultiViews FollowSymLinks
 9         AllowOverride All 
10         Order allow,deny
11         Allow from all
12     </Directory>
13 </VirtualHost>

这个是没问题的,然后判断应该是代码目录的权限问题,apache对代码目录需要755的权限,也就是x权限,使用ls -la查看了一下public文件夹是没问题的,然后apache需要父层文件夹都具有x权限,后来检查时/daozhang这一层没有,使用chmod +x daozhang修改后成功访问。

补充:nginx会出现File not Found错误的时候也可以查看日志是不是没有访问权限。

 

参考 http://wiki.apache.org/httpd/13PermissionDenied

转载于:https://www.cnblogs.com/songxk/p/4514541.html

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值