With an Ubuntu 14.04 standard AMI
Create 'app' user
$ sudo adduser --disabled-password app
Install required package (passenger, latest ruby)
$ sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 561F9B9CAC40B2F7
$ sudo apt-get install apt-transport-https ca-certificates
$ echo "deb https://oss-binaries.phusionpassenger.com/apt/passenger trusty main" | sudo tee /etc/apt/sources.list.d/passenger.list
$ sudo apt-add-repository ppa:brightbox/ruby-ng
$ sudo apt-get update
$ sudo apt-get upgrade
$ sudo apt-get install git ruby2.1 bundler nginx-extras passenger
$ sudo gem install bundler
Checkout app code
sudo su app -l
cd
git clone https://github.com/c4mprod/c4m-rubygems.git
cd c4m-rubygems
bundle install --without development:test --path vendor/bundle --binstubs vendor/bundle/bin --deployment
Configure nginx
$ sudo unlink /etc/nginx/sites-available/default
# /etc/nginx/conf.d/passenger.conf
passenger_ruby /usr/bin/ruby;
passenger_root /usr/lib/ruby/vendor_ruby/phusion_passenger/locations.ini;
# /etc/nginx/sites-available/c4m-rubygems
server {
listen 80;
root /home/app/c4m-rubygems/public;
passenger_enabled on;
passenger_user app;
}
$ sudo ln -s /etc/nginx/sites-available/c4m-rubygems /etc/nginx/sites-enabled/c4m-rubygems
$ sudo service nginx restart