apache2.4之后网站目录不是放在/var/www下,访问网站会提示403错误。新版本多了Require all granted这个参数
以debian8的Apache/2.4.10为例,如果网站目录指定为/home/wwwroot,则需要编辑/etc/apache2/apache2.conf
在
<Directory /var/www/>
Options Indexes FollowSymLinks
AllowOverride None
Require all granted
</Directory>
的附近添加一段
<Directory /home/wwwroot/>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
然后
service apache2 restart