我在/ home / ivan / host / name / web中克隆项目并创建虚拟主机。 a2ensite并重新加载并重启服务器。
<VirtualHost *:80>
ServerName name.local
DocumentRoot /home/ivan/host/name/web
DirectoryIndex app.php
ErrorLog /var/log/apache2/name-error.log
CustomLog /var/log/apache2/name-access.log combined
<Directory "/home/ivan/host/name/web">
AllowOverride All
Allow from All
</Directory>
和主持人
127.0.0.1 name.local
但有
Forbidden
You don't have permission to access / on this server.
我在做chmod 777 -R host /但仍有错误 我做错了什么?
解决
<VirtualHost *:80>
ServerName aog.local
DocumentRoot /home/ivan/host/name/web
DirectoryIndex app.php
ErrorLog /var/log/apache2/name-error.log
CustomLog /var/log/apache2/name-access.log combined
<Directory "/home/ivan/host/name/web">
AllowOverride All
Require all granted
Allow from All
</Directory>
答案 0 :(得分:1)
看起来你正在使用apache 2.4, add directive要求所有授予如下所示:
<Directory /home/ivan/host/name/web>
AllowOverride All
Options +FollowSymlinks
Require all granted
</Directory>