Customize Unicorn

Unicorn does not employ keep files for its configuration file. This page describes how to customize Unicorn without a keep file.

The process is:

  1. Create an alternate Unicorn configuration file.
  2. Start Unicorn with Bundler instead of running the system Unicorn.

To create the customized Unicorn configuration file and restart Unicorn

  1. Add this line to the file /data/_myapp_/shared/config/env.custom (where myapp is the name of your application):

    UNICORN_CONF="/data/_myapp_/shared/config/custom_unicorn.rb" 

    This specifies an alternate configuration file for Unicorn.

    Note: If you are using env_vars, then use the env_vars recipe to customize the environment variable. If you are already using the env_vars recipe, it will override your settings here. Use the recipe to customize your Unicorn settings.

  2. Copy /data/_myapp_/shared/config/unicorn.rb to /data/_myapp_/shared/config/custom_unicorn.rb.

  3. Edit the /data/_myapp_/shared/config/custom_unicorn.rb with the customizations that you want.

  4. Restart Unicorn so that the customizations take effect:

    /engineyard/bin/app_myapp reload 

To start Unicorn in Bundler

  1. Add the Unicorn gem to your Gemfile:

    gem 'unicorn' 
  2. Run these commands to update your Gemfile.lock:

    bundle install 

    git commit -a -m "Gemfile updated for Unicorn"
    git push origin

If you have feedback or questions about this page, add a comment below. If you need help, submit a ticket with Engine Yard Support.

Comments

Article is closed for comments.