Skip to content

Instantly share code, notes, and snippets.

@juyal-ahmed
Last active April 27, 2019 22:43
Show Gist options
  • Save juyal-ahmed/82ee404097ac45c71b0d5d3c89a04efe to your computer and use it in GitHub Desktop.
Save juyal-ahmed/82ee404097ac45c71b0d5d3c89a04efe to your computer and use it in GitHub Desktop.
Setting up VirtualHost for Symfony App in Ubuntu
sudo vim /etc/apache2/sites-available/symfony-test-app.conf
<VirtualHost *:80>
  ServerName symfony-test-app.com
  <IfModule mod_rewrite.c>
    RewriteEngine on
    RewriteCond %{REQUEST_METHOD} ^(TRACE|TRACK)
    RewriteRule .* - [F]
  </IfModule>
  DocumentRoot /var/www/html/symfony/symfony-test-app/public       
  <Directory /var/www/html/symfony/symfony-test-app/public>
    Options Indexes FollowSymLinks MultiViews
    AllowOverride All
    Require all granted
  </Directory>
</VirtualHost>
sudo vim /etc/hosts
127.0.0.1       symfony-test-app.com
sudo a2ensite symfony-test-app.conf
sudo service apache2 restart
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment