Symfony2 部署到 ubuntu 服务器
Symfony2 deployment to ubunt server
我是服务器部署的新手,我最近将我的 symfony 网站部署到基于 ubuntu 的服务器上。为了 运行 我的网站没有指定 app.php
我在我的 apache conf 中添加了 DirectoryIndex app.php
所以我的网站在 www.abc.com 上可见但是任何其他 link 都不是在职的;
例如下面的 link 不起作用
www.abc.com/route
非常感谢任何帮助!
如果您在 ubuntu 上并且拥有 root 访问权限,请尝试将此虚拟主机添加到 /etc/apache2/apache2.conf
<VirtualHost *:80>
ServerName abc.com
ServerAlias abc.com
ErrorLog /var/log/httpd/abc.com.log
DocumentRoot /var/www/html/abc.com/web/
<Directory /var/www/html/abc.com/web/>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ /app.php [QSA,L]
</IfModule>
</Directory>
</VirtualHost>
我是服务器部署的新手,我最近将我的 symfony 网站部署到基于 ubuntu 的服务器上。为了 运行 我的网站没有指定 app.php
我在我的 apache conf 中添加了 DirectoryIndex app.php
所以我的网站在 www.abc.com 上可见但是任何其他 link 都不是在职的;
例如下面的 link 不起作用
www.abc.com/route
非常感谢任何帮助!
如果您在 ubuntu 上并且拥有 root 访问权限,请尝试将此虚拟主机添加到 /etc/apache2/apache2.conf
<VirtualHost *:80>
ServerName abc.com
ServerAlias abc.com
ErrorLog /var/log/httpd/abc.com.log
DocumentRoot /var/www/html/abc.com/web/
<Directory /var/www/html/abc.com/web/>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ /app.php [QSA,L]
</IfModule>
</Directory>
</VirtualHost>