Apache2虚拟主机403禁止?

我在桌面上运行ubuntu 13.04 64位,我安装了Apache2,MySQL和PHP等

我想让我的web根目录在/home/afflicto/public_html而不是/var/www 。 所以我跟着这个指南:
http://www.maketecheasier.com/install-and-configure-apache-in-ubuntu/2011/03/09
(我做了“configuration不同网站”的所有内容),因为我更喜欢这个解决scheme。

以下是我所做的:
安装了Apache2,MySQL等。
/etc/apache2/sites-avaliable/default复制到/etc/apache2/sites-available/afflicto 。 然后编辑它,现在看起来像下面这样:

在/ etc / apache2的/网站可用/ afflicto

 <VirtualHost *:80> ServerAdmin webmaster@localhost DocumentRoot /home/afflicto/public_html <Directory /> Options FollowSymLinks AllowOverride None </Directory> <Directory /home/afflicto/public_html/> Options Indexes FollowSymLinks MultiViews AllowOverride All Order allow,deny allow from all </Directory> ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/ <Directory "/usr/lib/cgi-bin"> AllowOverride None Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch Order allow,deny Allow from all </Directory> ErrorLog ${APACHE_LOG_DIR}/error.log # Possible values include: debug, info, notice, warn, error, crit, # alert, emerg. LogLevel warn CustomLog ${APACHE_LOG_DIR}/access.log combined </VirtualHost> 

我做了sudo a2dissite default && sudo a2ensite afflicto && sudo service apache2 restart

我在/home/afflicto/public_html/test/创build了一个index.phpindex.html
当访问localhost/testlocalhost/test/index.html等,我得到403禁止错误。

我究竟做错了什么? 提前致谢。

更新1
我已经将public_html目录的所有者设置为www-data
另外sudo chmod -R +x public_html && sudo chmod -R 777 public_html
还是一样的403错误。

这里是apache错误日志的输出:

 [Sun Jul 14 06:10:32 2013] [error] [client 127.0.0.1] (13)Permission denied: access to / denied [Sun Jul 14 06:10:32 2013] [error] [client 127.0.0.1] (13)Permission denied: access to /favicon.ico denied 

我遇到了这个问题。 但我不喜欢把我的主目录的组更改为www-data。 这个问题可以简单地通过修改virtualHost的configuration文件来解决。 只需configurationDirectory标签即可包含这些标签

 <Directory "your directory here"> Order allow,deny Allow from all Require all granted </Directory> 

Require all granted是我猜想的一个新function; 具有denied的默认值。

有关更多信息,请参阅此页面: http : //httpd.apache.org/docs/current/mod/core.html#directory

原来,我不得不chmod不仅/home/afflicto/public_html而且/home/afflicto/目录。

奇怪的。