Skip to content

Instantly share code, notes, and snippets.

@ar2pi
Last active April 9, 2018 13:43
Show Gist options
  • Save ar2pi/08a3e30e4ff1e04e3d4892fabe7bf7e7 to your computer and use it in GitHub Desktop.
Save ar2pi/08a3e30e4ff1e04e3d4892fabe7bf7e7 to your computer and use it in GitHub Desktop.
Simple Apache vhost configuration file for a Symfony 3+ website
<VirtualHost *:80>
ServerAdmin [email protected]
ServerName example.com
ServerAlias www.example.com
DocumentRoot /var/www/project/web
<Directory /var/www/project/web>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
Allow from all
</Directory>
# uncomment the following lines if you install assets as symlinks
# or run into problems when compiling LESS/Sass/CoffeScript assets
# <Directory /var/www/project>
# 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/project/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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment