production環境 no capistrano

EC2

セットアップ

RDS

セットアップ

RVM

development環境に合わせてセットアップ
http://d.hatena.ne.jp/macperl/20140929

Railsインストール

インストール

nginx

インストール

設定編集
/etc/etc/nginx/nginx.conf

起動

$ sudo /etc/init.d/nginx restart

サーバ起動時自動起動

$ chkconfig nginx on

git

gitにてソース配置

$ sudo yum install git
$ git init
$ git clone path app_dir

rails

Gemインストール

$ bundle install

DB処理

$ rake db:create RAILS_ENV=production
$ rake db:migrate RAILS_ENV=production

静的ファイルのコンパイル

$ bundle exec rake assets:precompile RAILS_ENV=production

unicorn起動

unicorn_rails -c config/unicorn.rb -E production -D

unicorn停止

cat tmp/pids/unicorn.pid | xargs kill