Skip to content

rossjourdain/ruby_web_server_cookbook

Repository files navigation

Ruby Web Server Cookbook

VPS Provisioning

This cookbook is designed to make setting up a Ruby web server on a VPS using Chef quite simple.
To use the cookbook, it's best to use Matt Schaffer's Knife Solo using the instructions below.

I recommend using Digital Ocean.

The cookbook will install the following stack:

  • Ruby 2.0
  • rbenv
  • PostgreSQL
  • Apache2
  • Phusion Passenger
  • Node.js
  • ImageMagick

Setup

Install gems

gem install knife-solo
gem install berkshelf

Setup kitchen

Init
knife solo init vps-provisioner
berks init vps-provisioner
cd vps-provisioner
Gemfile
## ./Gemfile

source 'https://rubygems.org'

gem 'knife-solo'
gem 'berkshelf'
Berksfile
## ./Berksfile

site :opscode

cookbook 'ruby_web_server', git: '[email protected]:rossjourdain/ruby_web_server_cookbook.git'
Install Gems and Cookbooks
bundle install
berks install --path cookbooks

Build a Ruby web server

Install Chef

knife solo prepare <user>@<server>

Setup the server config

## ./nodes/<server>.json
## NB: password generated using: mkpasswd -m sha-512 deploy

{
  "run_list": [
    "ruby_web_server"
  ],
  "users": {
    "deploy": {
      "password": "$6$Jz61tUIPAEBc4R69$.77ruWIRf36yQ9ySPL2qObbu54jduoCCMUDb.28khUr95YYnuj5AKhslLnGAqSPBEolHC5MNm0yAExSoC6FKy.",
      "ssh_keys": [""]
    }
  },
  "webapps": {
    "test_app": {
      "domain": "www.example.com",
      "rails_env": "production"
    }
  },
  "locale": {
    "lang": "en_NZ.utf8"
  },
  "postgresql": {
    "password": {
      "postgres": "postgres"
    }
  }
}

Upload cookbooks and run them

knife solo cook <user>@<server>

Requirements

TODO

Usage

TODO

Attributes

TODO

Recipes

TODO

Author

Ross Jourdain

About

Ruby Web Server Cookbook - Fast VPS Provisioning

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages