Update yum
$ yum update
Install Sudo
$ yum install sudo
Create Account for Application
$ useradd -m -s /bin/bash deploy
Add write permission to sudoers
$ chmod u+w /etc/sudoers
Modify file to add deploy
group
## Allows people in group wheel to run all commands
# %wheel ALL=(ALL) ALL
%deploy ALL=(ALL) ALL
Remove write permission to sudoers
$ chmod u-w /etc/sudoers
Set the Password for User
$ passwd deploy
Then Exit and Login use Deploy
Install curl
$ sudo yum 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 Requirements and Ruby 1.9.3
$ sudo yum install libyaml-devel
$ rvm use --install --default 1.9.3
$ ruby -v
It should show ruby 1.9.3p545
Install Bundler
$ gem install bundler
$ sudo yum install nginx
Install sqlite3, redis
$ sudo yum install sqlite sqlite-devel
$ sudo yum install redis
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/
$ sudo chown deploy:deploy /var/www/
Clone the project
$ cd /var/www/
/var/www/ $ git clone [email protected]:APAC-Local/school_title_normalization_api.git
Install gems
$ cd /var/www/school_title_normalization_api/
$ bundle
Copy nginx.conf
to /etc/nginx/
$ sudo cp config/nginx.conf /etc/nginx/
Start Nginx
$ sudo service nginx start
Start Redis
$ redis-server config/redis.conf
Start Application
$ rake index_database
$ ruby start_server.rb
Restart Nginx
$ sudo service nginx restart