Skip to content

Instantly share code, notes, and snippets.

Created September 5, 2012 19:29
Show Gist options
  • Save anonymous/3643109 to your computer and use it in GitHub Desktop.
Save anonymous/3643109 to your computer and use it in GitHub Desktop.
apache vhost conf for rails
<VirtualHost *:80>
ServerAdmin [email protected]
ServerName hostname.com
DocumentRoot /var/www/vhosts/ruby/htdocs/public
CustomLog /var/www/vhosts/ruby/log/access.log combined
ErrorLog /var/www/vhosts/ruby/log/error.log
<Directory "/var/www/vhosts/ruby/htdocs/public">
SetOutputFilter DEFLATE
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4\.0[678] no-gzip
BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html
SetEnvIfNoCase Request_URI \ \.(?:gif|jpe?g|png|swf|mov|mp4)$ no-gzip dont-vary Header append Vary User-Agent env=!dont-vary
</Directory>
ErrorDocument 503 /system/maintenance.html
RewriteEngine On
RewriteCond %{REQUEST_URI} !.(css|gif|jpg|png)$
RewriteCond %{DOCUMENT_ROOT}/system/maintenance.html -f
RewriteCond %{SCRIPT_FILENAME} !maintenance.html
RewriteRule ^.*$ - [redirect=503,last]
</VirtualHost>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment