This script will install the entire web app stack to run Rails apps. This was written for and tested with Ubuntu 12.04 LTS on Amazon EC2.
Once you start up an EC2 instance, log in and run this one command:
sudo apt-get install -y git && git clone git://gist.github.com/4013787.git gist-4013787 && bash ./gist-4013787/install_ruby_passenger_nginx.sh
It will run through an auto install process.
- Ruby 1.9.3 (p286) from source with bundler
- Nginx (including init.d and logrotate tasks)
- Phusion Passenger
- ImageMagick (which we use all the time for things like Paperclip)
sudo service nginx start
sudo service nginx stop
sudo service nginx restart
The base of this came from Chris Oliver.
The Nginx start/stop init.d script came from Linode.
The Nginx ubuntu log rotation config came from Mell Zamora
Just a note of gratitude. I had to get a legacy RoR ( ChiliProject ) app up that runs on 1.9.3 and this was a life saver. Two changes I had to make. Line 32 I had to install RACK first and then specify a passenger version:
gem install rack -v 1.6.4
gem install passenger -v 4.0.42