什么导致这些403错误的DocumentRoot在我的Apache设置?

我自己configuration​​Apache,并试图强制自己(重新)学习configuration过程。 已经很久了!

版本是在Amazon Linux上运行的Apache / 2.2.21

我打算从这台服务器上运行几个站点。

我创build了:

  • /家庭/ EC2用户/地点
  • /home/ec2-user/sites/www.domain.ca
  • /家庭/ EC2用户/日志

前两个包含index.html文件。 在我的实验过程中,我将树设置为777而没有任何成功,并将目录和文件的所有权和组更改为apache(这是httpd.conf中发送的)。

我已经切掉了我的httpd.conf文件的一些相关部分:

DirectoryIndex index.html index.html.var DocumentRoot "/home/ec2-user/sites" <Directory "/"> Options None AllowOverride None </Directory> <Directory "/home/ec2-user/sites"> Options Indexes Order Allow,Deny Allow from All # Any other directory-specific stuff </Directory> <Directory "/home/ec2-user/www.domain.ca"> Order Allow,Deny Allow from All # Any other directory-specific stuff </Directory> # Default for when no domain name is given (ie access by IP address) <VirtualHost *:80> ServerAdmin [email protected] DocumentRoot /home/ec2-user/sites ErrorLog /home/ec2-user/logs/error_log TransferLog /home/ec2-user/logs/access_log </VirtualHost> # Add a VirtualHost definition for your domain which was once the system default. <VirtualHost www.domain.ca> ServerName www.domain.ca ServerAlias domain.ca ServerAdmin [email protected] DocumentRoot /home/ec2-user/sites/www.domain.ca ErrorLog /home/ec2-user/logs/domain.ca.error_log TransferLog /home/ec2-user/logs/domain.ca.access_log </VirtualHost> 

在错误日志中,我只是得到:

 Sun Dec 11 02:50:11 2011] [error] [client 174.95.145.253] (13)Permission denied: access to / denied [Sun Dec 11 02:50:14 2011] [error] [client 174.95.145.253] (13)Permission denied: access to / denied [Sun Dec 11 02:54:27 2011] [error] [client 174.95.145.253] (13)Permission denied: access to / denied [Sun Dec 11 02:54:32 2011] [error] [client 174.95.145.253] (13)Permission denied: access to / denied 

诚然,这不是一个非常有趣的问题,但是我很困惑,现在我只是在试图确定是什么原因造成问题。

你整棵树的树是777吗?

chmod 755父导向器

你也可能想看看修改或禁用selinux

请参阅: https : //stackoverflow.com/questions/1225594/apache-13-permission-denied-in-users-home-directory