Thursday 4 April 2013

Virtual host configuration for Symfony2 project on ubuntu.
 (In Development Environment )
Open Terminal and execute below steps
  1. Go to : sudo gedit /etc/apache2/sites-enabled/000-default
  2. Edit: 
<VirtualHost *:80>
    DocumentRoot /var/www/sample/web
    ServerName sample.com
   
    <Directory /var/www/sample/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_dev.php [QSA,L]
        </IfModule>
    </Directory>
</VirtualHost>

    3.  Go to: sudo gedit /etc/hosts
    4.  Edit :
         127.0.0.1 sample.com 
    5. Restart apache server: sudo service apache2 restart
    6. Open browser and type http://sample.com/app_dev.php
     
 Enjoy...


No comments:

Post a Comment