2015-11-09 25 views
0

我在/ home/ivan/host/name/web中克隆項目並創建虛擬主機。 a2ensite並重新加載並重新啓動服務器。Apache Symfony Vitrual主機

<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主機/但仍然有錯誤 什麼我'做錯了什麼?

解決

<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> 

回答

1

看起來像你使用的是Apache 2.4, 添加指令要求的所有批准,如下圖所示:

<Directory /home/ivan/host/name/web> 
    AllowOverride All 
    Options +FollowSymlinks 
    Require all granted 
</Directory> 
+0

我不明白這是因爲另一個許可爲這個目錄主機?所有權限要求所有授予? –

+0

根據升級文檔,這是所有的允許替換,http://httpd.apache.org/docs/current/upgrading.html – helios