Reliably Deploying Rails Applications

By Ben Dixon

https://leanpub.com/deploying_rails_applications

Mastering Rails program deployment

This booklet will convey you from begin to end how to:

Setup a VPS from Scratch
Setup extra servers in minutes
Use Capistrano three to install fast and reliably
Automate uninteresting upkeep tasks

If you've received functions on Heroku that are costing you a fortune, this can give you the instruments you want to flow them onto a VPS. This contains operating numerous Rails functions on a unmarried VPS - nice for small aspect projects.

If you're already working your app on a VPS however the set up technique is flaky - it occasionally doesn't restart or rather a lot the incorrect model of the code - this ebook presents a template for making the method difficulty free.
Section 1: Chef

How to automate provisioning new servers with chef. by way of the top you'll have the ability to get a brand new server up and able to use inside of minutes.

Many common Rails approach configurations are supported out of the field with the instance code (MySQL, PostgreSQL, MongoDB and Redis). For anything, exact directions for establishing your individual customized configurations are supplied.

The goal of this part is to construct a re-usable blueprint you should use everytime you have to setup a brand new VPS.
Section 2: Capistrano 3

Using Capistrano three to automate each point of deployment, from updating code to dealing with resources and historical past workers.

Particular awareness is paid to establishing 0 downtime deployment - crucial if you're iterating speedily and need to install numerous occasions in line with day. This encompasses a part on universal gotchas reminiscent of failing to reload the gemfile on deployment in addition to a close advisor to troubleshooting whilst it is going wrong.

I've spent 1000's of hours combing via weblog posts, documentation and tweaking config records. This has bought me to the level the place deploying to a VPS is as effortless as - in truth usually more straightforward than - deploying to Heroku. for you to do an identical, this publication will prevent loads of time.
Current finishing touch & Feedback

The first part - provisioning a server with chef - is entire, together with directions for PostgreSQL, MySQL and MongoDB. This encompasses a "Five minute VPS" quickstart part for the impatient.

The moment part - deploying with Capistrano three - is usually to be had and comprises the entire info had to get 0 downtime deployments operating with Rails 3/4 and Unicorn. in addition to distinct pattern code, it comprises entire directions for deploying Sidekiq staff, a close part on Configuring 0 Downtime deployment and directions for configuring NGinx Virtualhosts and SSL

Over the following few months I'll be including extra chapters which move into element on backups and database administration in addition to modifying the ebook in line with the suggestions I've bought up to now (please preserve this coming!). I'll additionally proceed so as to add additional chapters as and whilst I stumble upon new tips and tricks.

Any suggestions on content material, constitution or corrections very gratefully got, you may get me on twitter (@talkingquickly) or utilizing the leanpub talk about button below.

Show description

Preview of Reliably Deploying Rails Applications PDF

Similar Computing books

Recoding Gender: Women's Changing Participation in Computing (History of Computing)

At the present time, girls earn a comparatively low percent of desktop technological know-how levels and carry proportionately few technical computing jobs. in the meantime, the stereotype of the male "computer geek" appears all over in pop culture. Few humans be aware of that girls have been an important presence within the early a long time of computing in either the us and Britain.

PHP and MySQL for Dynamic Web Sites: Visual QuickPro Guide (4th Edition)

It hasn't taken net builders lengthy to find that after it involves growing dynamic, database-driven websites, MySQL and personal home page offer a successful open-source mix. upload this e-book to the combo, and there is no restrict to the strong, interactive sites that builders can create. With step by step directions, whole scripts, and professional find out how to advisor readers, veteran writer and database fashion designer Larry Ullman will get all the way down to company: After grounding readers with separate discussions of first the scripting language (PHP) after which the database software (MySQL), he is going directly to disguise safety, periods and cookies, and utilizing extra internet instruments, with a number of sections dedicated to growing pattern functions.

Game Programming Algorithms and Techniques: A Platform-Agnostic Approach (Game Design)

Video game Programming Algorithms and methods is an in depth review of a few of the very important algorithms and methods utilized in online game programming at the present time. Designed for programmers who're accustomed to object-oriented programming and easy information constructions, this e-book makes a speciality of sensible strategies that see genuine use within the video game undefined.

Guide to RISC Processors: for Programmers and Engineers

Information RISC layout ideas in addition to explains the variations among this and different designs. is helping readers collect hands-on meeting language programming adventure

Extra info for Reliably Deploying Rails Applications

Show sample text content

22 22 22 24 five. three - an easy chef position . . review . . . . . . . . making a position definition Default Attributes . . . . json_class and chef_type run_list . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25 25 25 25 26 26 five. four - using a node definition to a VPS evaluate . . . . . . . . . . . . . . . . obtain extra cookbooks . . . . arrange the VPS . . . . . . . . . . . . . . set up chef at the distant computer . . . Make a metamorphosis and re-apply . . . . . . Summing Up . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27 27 27 27 28 29 30 6. zero - A Template for Rails Servers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . evaluate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . the instance Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31 31 31 6. 1 - handling Cookbooks with Berkshelf evaluate . . . . . . . . . . . . . . . . . How Berkshelf works with knife solo . . Getting began . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33 33 34 34 7. zero - uncomplicated server setup . . . . . . . . . . . . . . . . . . . . . . . . evaluate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . uncomplicated applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . including a visible queue should you log right into a creation atmosphere Rails gem dependencies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36 36 36 36 38 7. 1 - clients . review clients . . . Sudo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39 39 39 forty 07. 2 - protection . . . . evaluation . . . . . A observe on safety protection Gotchas . simple Measures . . SSH Hardening . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . forty two forty two forty two forty two forty three forty four CONTENTS Unattended improvements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . instantly Updating Time . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . forty five forty six 7. three - Firewall . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . evaluate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . UFW (Uncomplicated Firewall) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . forty seven forty seven forty seven 7. four - employing the pattern template to a VPS review . . . . . . . . . . . . . . . . . . Pre-requisites . . . . . . . . . . . . . . . . step-by-step . . . . . . . . . . . . . . . . . exhibiting that its labored . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50 50 50 50 fifty one eight. zero - fitting Ruby . . evaluation . . . . . . Rbenv v RVM . . . . How rbenv works . . The rbenv Cookbook . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . fifty two fifty two fifty two fifty two fifty four nine.

Download PDF sample

Rated 4.70 of 5 – based on 23 votes