Skip to content

Instantly share code, notes, and snippets.

@erfanimani
Created April 20, 2014 17:19
Show Gist options
  • Save erfanimani/11119611 to your computer and use it in GitHub Desktop.
Save erfanimani/11119611 to your computer and use it in GitHub Desktop.
Simple Apache2.2 configuration that allows you to use deployments through git for very basic sites.
<Directory /var/www>
Order Deny,Allow
Allow from all
AllowOverride All
</Directory>
<Directorymatch "^/.*/\.git/">
Order deny,allow
Deny from all
</Directorymatch>
<Files ~ "^(bower.json|Gruntfile.js|.gitignore|package.json)$">
Order deny,allow
Deny from all
</Files>
NameVirtualHost *:80
<VirtualHost *:80>
# get the server name from the Host: header
UseCanonicalName Off
# include the server name in the filenames used to satisfy requests
VirtualDocumentRoot /var/www/%0/public
</VirtualHost>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment