Create Account for Application
$ useradd -m -s /bin/bash deploy
Add write permission to sudoers
$ adduser deploy sudo
Set the Password for User
$ passwd deploy
Then Exit and Login use deploy
Update APT
$ sudo apt-get update
Install curl
$ sudo apt-get install curl
Install RVM
$ \curl -sSL https://get.rvm.io | bash
Exit and Relogin with deploy
to initialize RVM
$ type rvm | head -1
It should show rvm is a function
Install Ruby 1.9.3
$ rvm use --install --default 1.9.3
$ ruby -v
It should show ruby 1.9.3p545
Follow the instruction in passenger
Step 1: Install our PGP key
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 561F9B9CAC40B2F7
Step 2: Add HTTPS support for APT
sudo apt-get install apt-transport-https ca-certificates
Step 3: Add APT source
$ sudo echo "deb https://oss-binaries.phusionpassenger.com/apt/passenger precise main" > /etc/apt/sources.list.d/passenger.list
$ sudo apt-get update
Step 4: Install Phusion Passenger package
$ sudo apt-get install nginx-extras passenger
Install git
$ sudo yum install git
Generate SSH keygen
$ ssh-keygen
$ cd ~/.ssh
Copy id_rsa.pub
to the gitsum deploy
Create site folder
$ sudo mkdir -p /var/www/example.com
$ sudo chown deploy:deploy /var/www/example.com
Clone the project
$ cd /var/www/example.com
/var/www/example.com $ git clone https://github.com/YOURNAME/REPO.git .