LoginSignup
0
0

More than 3 years have passed since last update.

memo AWSデプロイエラー時のコマンド

Posted at

背景

AWSデプロイに詰まったとき、エラーログを見るために頻繁に使用したのでコードをメモしておく

tailコマンドを使う

ファイルの最後の部分を表示する

サーバーログ

アプリのリポジトリ上にて

tail -n 30 log/production.log
  • オプションの意味
    • -n 数字 : ファイルの最終行からその数字行だけ表示できる

nginxログ

アプリのリポジトリ上にて

sudo tail -f /var/log/nginx/error.log
  • オプションの意味
    • -f: リアルタイムで更新されるログファイルを確認しながらプロセスの挙動を確認できる

unicornログ

アプリのリポジトリ上にて

sudo tail -f log/unicorn.log

また、再起動コマンドもよく使ったのでメモしておく

nginx 再起動

sudo service nginx reload

unicorn 再起動

ps -ef | grep unicorn | grep -v grep

PID:プロセス番号を確認した後

kill プロセス番号

再起動コマンド

unicorn_rails -c /var/www/rails/アプリ名/config/unicorn.conf.rb -D -E production
0
0
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
0
0