sudo visudo deploy ALL=(ALL) NOPASSWD:ALL
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo systemctl status sidekiq | |
sudo systemctl status sidekiq.service | |
sudo systemctl status redis | |
sudo systemctl status website_puma_staging.service (staging / production) | |
sudo systemctl status nginx |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Clear from console, all: | |
Sidekiq.redis(&:flushdb) |
sudo su
cd /etc/sudoers.d/
visudo -f deploy-user-puma-services
Add deploy ALL=(ALL) NOPASSWD: /bin/systemctl restart puma_website.service
Install Redis:
- https://www.digitalocean.com/community/tutorials/how-to-install-and-secure-redis-on-ubuntu-22-04
- https://dev.to/kevinluo201/start-sidekiq-6-as-daemon-in-production-environment-on-ubuntu-20-04-4m7b
- https://github.com/sidekiq/sidekiq/wiki/Deployment
[Unit]
Description=sidekiq
After=syslog.target network.target
Assume the name of the application is "website":
For socket: sudo vi /etc/systemd/system/website_puma_production.socket
[Unit]
Description=Puma Socket for website (production)
[Socket]
Now, the final part of the initial deployment for Rails with RVM, Postgres, Ubuntu, NGINX, Capistrano, Puma 6 & Systemd.
Go to /etc/nginx/sites-available
Create a conf file, I usually name it after my app. For this tutorial, let's call it "website":
upstream puma_website {
server unix:///home/deploy/website/shared/sockets/puma.sock;
}
Summary:
- Add Capistrano and other relevant gems to Gemfile.
# Deployment
gem 'capistrano'
gem 'capistrano-rvm'
gem 'capistrano-rails'
gem 'capistrano-bundler'
grep something from text file:
grep "phrase-here" production.log; tail -f production.log
NewerOlder