/ec2-rails-setup

Bash script for prepping a fresh AWS EC2 Ubuntu instance for Rails deployment.

Primary LanguageShell

ec2-rails-setup

Bash script for prepping a fresh AWS EC2 Ubuntu instance for Rails deployment.

This script will install packages and config files necessary to deploy a MySQL-backed Rails app utilizing Apache2 and Phusion Passenger.

To run:

curl -O https://raw.github.com/ilunderskov/ec2-rails-setup/master/ec2-rails-setup.sh 
sudo vim ec2-rails-setup.sh

Edit the bash script's user-defined fields, identified by EDIT comments, and then run the following:

chmod 777 ec2-rails-setup.sh
./ec2-rails-setup.sh

What the script does:

  • Updates the EC2 instance
  • Changes the time zone
  • Installs Rails-related apt-get packages (see script for specifics)
  • Disables some Apache mods, edits Apache config file
  • Installs rbenv and ruby-rbuild
  • Installs Ruby 1.9.3-p392
  • Installs MySQL cilent
  • Installs Rails and Passenger gems
  • Install Passenger Apache2 module
  • Adds Passenger config files

Remember to touch tmp/restart.txt within your Rails app once you have the code loaded up to restart the Passenger module.

LICENSE:

(The MIT License)

Copyright © 2013 Ian Lunderskov

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the ‘Software’), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED ‘AS IS’, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.