Installation & Deployment Guide: Web Server Recipes

These recipes are a starting point for configuring your web server to run Wheelhouse CMS.

Apache VirtualHost Recipe

<VirtualHost *:80>
  ServerName *DOMAIN*
  ServerAlias www.*DOMAIN*

  DocumentRoot /var/www/*DOMAIN*/current/public

  <Directory /var/www/*DOMAIN*/current/public>
    Options FollowSymLinks
    AllowOverride None
    Order allow,deny
    Allow from all
  </Directory>

  # Log location
  ErrorLog /var/www/*DOMAIN*/shared/log/error.log
  LogLevel warn
  CustomLog /var/www/*DOMAIN*/shared/log/access.log combined

  # Output compression
  AddOutputFilterByType DEFLATE text/html text/plain text/xml text/javascript text/css application/x-javascript application/javascript
  BrowserMatch ^Mozilla/4 gzip-only-text/html
  BrowserMatch ^Mozilla/4\.0[678] no-gzip
  BrowserMatch \bMSIE !no-gzip !gzip-only-text/html

  RewriteEngine On

  # Redirect non-www to www
  RewriteCond %{HTTP_HOST} !^www.*DOMAIN*$ [NC]
  RewriteRule ^/(.*)$ http://www.*DOMAIN*/$1 [L,R=301]

  # Page caching
  RewriteRule ^/cache - [F,L]

  RewriteCond %{THE_REQUEST} ^(GET|HEAD)
  RewriteCond %{REQUEST_URI} ^/([^.]+)$
  RewriteCond %{DOCUMENT_ROOT}/cache/%1.html -f
  RewriteRule ^/[^.]+$ /cache/%1.html [QSA,L]

  RewriteCond %{THE_REQUEST} ^(GET|HEAD)
  RewriteCond %{DOCUMENT_ROOT}/cache/index.html -f
  RewriteRule ^/$ /cache/index.html [QSA,L]
</VirtualHost>

Nginx Server Recipe

server {
listen 80;
server_name *DOMAIN* www.*DOMAIN*;

root /var/www/*DOMAIN*/current/public;

access_log /var/www/*DOMAIN*/shared/log/access.log;
error_log /var/www/*DOMAIN*/shared/log/error.log;

location / {

try_files $uri /cache/$uri/index.html /cache/$uri.html /cache/$uri @passenger;
}

location @passenger {

passenger_enabled on;
}

location ~ ^/assets/tinymce/ {
break;
}

location ~ ^/assets/ {
gzip_static on;
expires 1y;
add_header Cache-Control public;
add_header Last-Modified "";
add_header ETag "";
break;
}
}