sudo visudo deploy ALL=(ALL) NOPASSWD:ALL
  
    
      This file contains hidden or 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 hidden or 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) | 
The clean and secure way to allow the deploy user to run sudo commands without a password is to create a custom sudoers file in /etc/sudoers.d/.
Switch to root:
sudo su
Navigate to the sudoers directory:
cd /etc/sudoers.d/
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.service
[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