我使用Symfony框架创建了项目,当我在prod或dev中运行build in server时运行正常,但现在我将项目移动到debian服务器,安装apache并创建虚拟主机。它仅显示目录列表而不启动应用程序。我认为我的虚拟主机配置有问题。我使用的是Apache / 2.4.10(Debian)服务器,PHP 5.6.19-0 + deb8u1(cli)。
以下是虚拟主机的代码:
<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 :(得分:0)
正确答案是来自Dawid Sajdak的AllowOverride All。 Tnx寻求帮助