Deploy A Rails App: To Heroku &&ubuntu Server
Deploy A Rails App: To Heroku &&ubuntu Server
TO HEROKU
&&UBUNTU SERVER
Deploy to HEROKU Server
Tracking your app in git
$cd myapp
$ git init
$ git add .
$ heroku create
$ git remote v
Deploying code
$ heroku open
Setup Server on Ubuntu
# Setup the SSH server to use keys for authentication
https://www.g-loaded.eu/2005/11/10/ssh-with-keys/
# Add user deployer
$ sudo su
$ adduser deployer
$ passwd deployer # deployer
# Install dependencies
$ sudo apt-get update
$ sudo apt-get install git-core curl zlib1g-dev build-essential libssl-dev libreadline-dev libyaml-dev libsqlite3-dev sqlite3
libxml2-dev libxslt1-dev libcurl4-openssl-dev python-software-properties libffi-dev
# Install Nginx
$ sudo apt-get update
$ sudo apt-get install nginx
As deployer
# sudo su deployer
# Libreoffice
export PATH=$PATH:$HOME/libreoffice/opt/libreoffice5.3/program
# Rails ENV
export RACK_ENV="staging"
export RAILS_ENV="staging"
export PORT="80
export SECRET_KEY_BASE
Deploy to Server with Capistrano,
Unicorn and Nginx on Ubuntu
Capistrano is a framework for building automated deployment scripts. Although Capistrano itself is written in Ruby,
it can easily be used to deploy projects of any language or framework, be it Rails, Java, or PHP -
https://github.com/capistrano/capistrano
Install the Capistrano , Unicorn gem