Skip to content

Instantly share code, notes, and snippets.

@fracasula
Created September 12, 2013 09:16
Show Gist options
  • Select an option

  • Save fracasula/6534862 to your computer and use it in GitHub Desktop.

Select an option

Save fracasula/6534862 to your computer and use it in GitHub Desktop.
Simple Apache2 Virtual Host
# /etc/apache2/sites-enabled/site
<VirtualHost *:80>
RewriteEngine On
RewriteOptions Inherit
ServerAdmin [email protected]
ServerName example.com
ServerAlias www.example.com
ServerAlias admin.example.com
DocumentRoot /var/www/example
<Directory />
Options FollowSymLinks
AllowOverride All
</Directory>
<Directory "/var/www/example/">
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>
LogLevel warn
ErrorLog ${APACHE_LOG_DIR}/error_example.log
CustomLog ${APACHE_LOG_DIR}/access_example.log combined
ServerSignature Off
</VirtualHost>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment