配置虚拟主机root


Configure virtualhost root

我需要配置我的虚拟主机,我有一个symfony安装在/home/sfproduction/www/prod/public/我需要改变我的根目录,以便指向我的文件夹/public/

我检查了symfony文档,但我不明白。

我当前的虚拟主机设置是这样的,但是它不工作(显示坏网关):

----(我在&lt后加上了。)为了在论坛上展示)——

<./VirtualHost *:80>
  ServerName sfproduction.alwaysdata.net
  DocumentRoot "/home/sfproduction/www/prod/public/web"
  DirectoryIndex index.php
Alias /  /home/sfproduction/www/prod/public/
  <Directory /sfproduction/www/prod/public>
   AllowOverride All
   Allow from All
  </Directory>
<*/VirtualHost>

参考食谱:http://symfony.com/doc/current/cookbook/configuration/web_server_configuration.html

<VirtualHost *:80>
  ServerName sfproduction.alwaysdata.net
  DocumentRoot /home/sfproduction/www/prod/public/web        
  <Directory /home/sfproduction/www/prod/public/web>
      AllowOverride All
      Order allow,deny
      Allow from All
  </Directory>
</VirtualHost>

注释后更新:

原来的问题是解决,实际上现在你的url指向你的symfony app.php

现在你的php页面被下载而不是被看到。这个问题可能是由于Apache的错误配置造成的;

查看相关问题了解如何解决:
PHP文件由浏览器下载,而不是由本地开发服务器(MAMP)处理

https://serverfault.com/questions/215455/what-causes-php-pages-to-consistently-download-instead-of-running-normally