Server Configuration & Customization
This article will walk you through the typical configuration applied to servers built by the Spree Deployment Service and how to customize the configuration.
All servers configured with the Spree Deployment Service are configured as clients to our public Puppet server. Puppet is a ruby based configuration management system (similar to Chef), and using it allows us to centrally control and update all configurations to ensure your server is always running the best possible configuration.
Using Puppet also restricts how you can edit or change certain key configuration files, we provide several extension points when you can make your changes to files while still receiving the benefits of Puppet for other files.
NOTE: Puppet is not configured (or intended) to be run as a client daemon on your server, you should only run the update commands on an as needed basis.
All servers are currently configured with the following basic elements:
- Ruby – compiled from source using ruby-build, installed system wide
- Puppet client 2.7.x
- Foreman – process management
Depending on the role assigned to a server it may get some or all of the following:
- Unicorn – rack application server
- Nginx – web server / unicorn front end
- MySQL – database server
Every server contains a single directory that houses the application and all serves as a location to configure several key aspects of the servers software stack:
- /data/ – top level directory that contains all application specific data.
- /data/spree/ – houses the application itself, serves as the deploy destination in Capistrano scripts.
- /data/spree/current/ – the current live / production version of the application code (symlink to the relevant releases subdirectory).
- /data/spree/releases/ – contains current and last 5 deployed releases of the application’s code.
- /data/spree/shared/ – directories and files that are common among all deployed versions of an application (like assets, configuration files, etc).
- /data/spree/shared/config/ – conatins several application specific configuration files including:
- - database.yml – Automatically generated configuration file for Rails / ActiveRecord, contains all the details required to connect the associated applications database. This file is sym-linked into place as part of the Capistrano deploy process.
- - Procfile – Automatically generated process configuration files, for more see the Application Processes article. This file is sym-linked into place as part of the Capistrano deploy process.
- - unicorn.rb – Automatically generated unicorn configuration file, reference by the Procfile above when starting the application server processes.
- /etc/ssl – You can upload your SSL certificate files into this directory and the will be automatically used by Puppet in your application Nginx configuration file. See the Requesting and Configuring SSL Guide for more details.