Skip to content

Complete Production Installation

Luke Baker edited this page Sep 18, 2015 · 6 revisions

If you haven’t completed the Installing instructions do, complete those first.

Set up the mysql database

Open config/database.yml and add a production block in the file, adding the appropriate database, host, username, and password for accessing the MySQL server. The production block should look something like this:

production:
  <<: *default
  database: pairwise_production
  host: localhost
  username: root
  password: my_password

Create the database with RAILS_ENV=production ./bin/rake db:create and then RAILS_ENV=production ./bin/rake db:schema:load.

Install and start the server

Install apache or nginx through your operating system’s package manager. We recommend using Phusion Passenger with either Apache or nginx. You’ll need to configure nginx or Apache with a host that’ll serve the pairwise site. The specifics of how you do that will depend on your particular needs.

The application occasionally needs to write to the public/ directory, so the user that runs the application server (e.g., Passenger) should be able to write to the directories and files within the public/ directory.

Start DelayedJob Workers

For proper working of catchup algorithm, you’ll need to have some delayed_job workers. This worker is also needed if you’re using the feature that allows you to export results as CSV in association with the All Our Ideas code. RAILS_ENV=production bundle exec ./script/delayed_job start