0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

AWSでのデプロイ時によく使うコマンド

0
Posted at

AWSでデプロイ時によく使うコマンドまとめ

最近AWSのEC2でデプロイした際によく使ったコマンドを忘れないように記録します。

・EC2インスタンスにログイン

ssh -i キーペアの名前.pem ec2-user@EC2インスタンスと紐付けたElastic IP

・データベースの状態を確認(今回はMySQL,MariaDBを使用)

sudo systemctl status mariadb

・デプロイ予定の開発中アプリケーションへ移動

cd  /var/www/開発中アプリケーション

・railsの起動

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

・Unicornのプロセスを確認

ps aux | grep unicorn

・Unicornのエラーログを確認(shift + g で最新のログへ)

less log/unicorn.stderr.log

・EC2内でのエラーログ確認(shift + g で最新のログへ)

less log/production.log

自動デプロイ(Capistranoの導入後)

bundle exec cap production deploy

まとめ

個人的によく使うコマンドをまとめました。
こういったコマンドは忘れやすいので、定期的に学習したことは投稿していきたいと思います。

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?