# zena apache2 vhost for <%= host %> # automatically generated file ServerName <%= host %> DocumentRoot /var/www/zena/<%= host %>/public ErrorLog /var/www/zena/<%= host %>/log/apache2.error.log CustomLog /var/www/zena/<%= host %>/log/apache2.access.log combined /public"> Options FollowSymLinks AllowOverride None Order allow,deny Allow from all <% if static.include?('cgi-bin') %> ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/ AllowOverride None Options ExecCGI -MultiViews +SymLinksIfOwnerMatch Order allow,deny Allow from all <% end %> <% if static.include?('awstats-icon') %> Alias /awstats-icon/ /usr/share/awstats/icon/ Options None AllowOverride None Order allow,deny Allow from all <% end %> # hide all .whatever files ErrorDocument 403 /404.html Order allow,deny Deny from all Satisfy All RewriteEngine On <% if debug_rewrite %> # rewrite debugging RewriteLog /var/www/zena/<%= host %>/log/rewrite.log RewriteLogLevel 9 <% end %> # Check for maintenance file and redirect all requests RewriteCond %{DOCUMENT_ROOT}/system/maintenance.html -f RewriteCond %{SCRIPT_FILENAME} !maintenance.html RewriteRule ^.*$ /system/maintenance.html [L] # Rewrite index to check for static RewriteRule ^/$ /index.html [QSA] # Rewrite to check for Rails cached page RewriteRule ^([^.]+)$ $1.html [QSA] # Redirect all non-static requests to cluster RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME}%{QUERY_STRING} !-f RewriteRule ^/(.*)$ balancer://<%= balancer %>%{REQUEST_URI} [P,QSA,L] <% if deflate %> # Deflate (compress data before sending to browser) AddOutputFilterByType DEFLATE text/html text/plain text/xml application/xml application/xhtml+xml text/javascript text/css BrowserMatch ^Mozilla/4 gzip-only-text/html BrowserMatch ^Mozilla/4.0[678] no-gzip BrowserMatch \bMSIE !no-gzip !gzip-only-text/html <% end %> <% if debug_deflate && deflate %> # Deflate debugging DeflateFilterNote Input input_info DeflateFilterNote Output output_info DeflateFilterNote Ratio ratio_info LogFormat '"%r" %{output_info}n/%{input_info}n (%{ratio_info}n%%)' deflate CustomLog /var/www/zena/<%= host %>/log/deflate.log deflate <% end %>