2016-06-01 101 views
0

我創建了使用Symfony框架的項目,並且當我在prod中運行構建服務器或dev時,env運行正常,但是現在我將項目移動到debian服務器,安裝apache並創建虛擬主辦。它只顯示目錄列表,不啓動應用程序。我認爲這是我的虛擬主機配置有問題。我使用Apache/2.4.10(Debian)服務器,PHP 5.6.19-0 + deb8u1(cli)。Symfony項目的Apache虛擬主機配置錯誤

這裏是虛擬主機代碼:

<VirtualHost *:80> 
ServerName mose 
ServerAlias 10.5.0.62 

DocumentRoot /var/www/mose/web 
<Directory /var/www/mose/web/> 
    AllowOverride None 
    Require all granted 
    Allow from All 

    <IfModule mod_rewrite.c> 
     Options -MultiViews 
     RewriteEngine On 
     RewriteCond %{REQUEST_FILENAME} !-f 
     RewriteRule ^(.*)$ app.php [QSA,L] 
    </IfModule> 

</Directory> 

# uncomment the following lines if you install assets as symlinks 
# or run into problems when compiling LESS/Sass/CoffeScript assets 
# <Directory /var/www/mose> 
#  Options FollowSymlinks 
# </Directory> 

# optionally disable the RewriteEngine for the asset directories 
# which will allow apache to simply reply with a 404 when files are 
# not found instead of passing the request into the full symfony stack 
<Directory /var/www/mose/web/bundles> 
    <IfModule mod_rewrite.c> 
     RewriteEngine Off 
    </IfModule> 
</Directory> 
ErrorLog /var/log/apache2/project_error.log 
CustomLog /var/log/apache2/project_access.log combined 
</VirtualHost> 
+0

AllowOverride全部 –

+0

如果我這樣做,它將我重定向到/app.php,它是空的頁面 – sanof

+0

正確的,現在你應該檢查你的日誌。 –

回答

0

的正確答案是從的Dawid Sajdak的AllowOverride全部。 Tnx尋求幫助