LoginSignup
1
3

More than 5 years have passed since last update.

nginx rails さくらVPSのデプロイ 自分用

Last updated at Posted at 2017-12-16

初めてさくらVPSのレンタルして、Railsデプロイをキメこんだので置いとく。 基本的にはリンク集の方針

ドットインストールのさくらVPSの項目:https://dotinstall.com/lessons/basic_sakura_vps
ファイアウォールの設定くらいまでは、良かったのでほぼそのまま使いました。

nginx インストール
# rpm -ivh http://nginx.org/packages/centos/6/noarch/RPMS/nginx-release-centos-6-0.el6.ngx.noarch.rpm
# yum -y install nginx

nginx 起動
# /etc/init.d/nginx start

railsのインストール:http://blog.otsukasatoshi.com/entry/2016/08/07/180633

nginx&unicornでrails new:https://qiita.com/noraworld/items/c8acf4bb981c8d8535df

nginxのエラーはここにある

/var/log/nginx/error.log

Permissionがどうみたいなエラーがでたら:
https://qiita.com/madaran0805/items/a5b064105852656cca0e
どっかしらProcessのnameが一致していないから。
私のところではnginxのnameがrootになっていたので、↓で設定

/etc/nginx/nginx.conf

たぶん再デプロイしたらこれが必要↓

bundle exec rails unicorn:restart
sudo /etc/init.d/nginx restart
bundle exec rails s RAILS_ENV=production
bundle exec rails assets:precompile RAILS_ENV=production

##使ったやつ
https://qiita.com/akito1986/items/56198edcafc222b320a8
https://qiita.com/a_ishidaaa/items/74de8bdaecd637063c40
1
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
3