Provides guidance and utilities for securely accessing the Codante production server via SSH...
This skill guides you through accessing and working with the Codante.io API production server hosted on Digital Ocean.
/var/www/codante-io-api/current (symlink to active release)current, releases/, and shared/ directoriesssh robertotcestari@216.238.103.47
List nginx sites:
ssh robertotcestari@216.238.103.47 "ls /etc/nginx/sites-enabled/"
Check nginx configuration:
ssh robertotcestari@216.238.103.47 "sudo nginx -t"
Check service status:
ssh robertotcestari@216.238.103.47 "sudo supervisorctl status codante-octane"
ssh robertotcestari@216.238.103.47 "systemctl status nginx"
ssh robertotcestari@216.238.103.47 "systemctl status mysql"
ssh robertotcestari@216.238.103.47 "systemctl status redis-server"
Check Supervisor status:
ssh robertotcestari@216.238.103.47 "sudo supervisorctl status"
WARNING: do not transfer files - this is used only for emergency debugging. To change files in the production server, use the deployment pipeline.
scp robertotcestari@216.238.103.47:/path/on/server /local/path
scp /local/path robertotcestari@216.238.103.47:/path/on/server
/var/www/codante-io-api/current/var/www/codante-io-api/releases/ (numbered directories: 1, 2, 3, 4...)/var/www/codante-io-api/shared/ (persistent data between releases)/var/www/codante-io-api/current/storage/logs//var/www/codante-io-api/current/public (served by nginx)/var/www/codante-io-api/shared/.envCodante uses multiple logging channels with all logs stored in /var/www/codante-io-api/current/storage/logs/.
Laravel Main Log:
# View live logs (follow mode)
ssh robertotcestari@216.238.103.47 "tail -f /var/www/codante-io-api/current/storage/logs/laravel.log"
# View last 100 lines
ssh robertotcestari@216.238.103.47 "tail -100 /var/www/codante-io-api/current/storage/logs/laravel.log"
# Get file size and info
ssh robertotcestari@216.238.103.47 "ls -lh /var/www/codante-io-api/current/storage/logs/laravel.log"
Deprecation Logs (PHP deprecation warnings):
ssh robertotcestari@216.238.103.47 "tail -f /var/www/codante-io-api/current/storage/logs/deprecations.log"
Security Logs (daily files, kept for 14 days):
ssh robertotcestari@216.238.103.47 "ls -lh /var/www/codante-io-api/current/storage/logs/security*.log"
ssh robertotcestari@216.238.103.47 "tail -f /var/www/codante-io-api/current/storage/logs/security-2025-10-22.log"
Payment Logs (Pagarme integration):
ssh robertotcestari@216.238.103.47 "tail -f /var/www/codante-io-api/current/storage/logs/payments.log"
Discord Logs (Discord integration):
ssh robertotcestari@216.238.103.47 "tail -f /var/www/codante-io-api/current/storage/logs/discord.log"
nginx access logs:
ssh robertotcestari@216.238.103.47 "tail -f /var/log/nginx/access.log"
nginx error logs:
ssh robertotcestari@216.238.103.47 "tail -f /var/log/nginx/error.log"
Site-specific error logs:
ssh robertotcestari@216.238.103.47 "ls -lh /var/log/nginx/*.log"
Octane service logs:
ssh robertotcestari@216.238.103.47 "journalctl -u codante-octane -n 100 -f"
nginx service logs:
ssh robertotcestari@216.238.103.47 "journalctl -u nginx -n 100"
MySQL service logs:
ssh robertotcestari@216.238.103.47 "journalctl -u mysql -n 100"
Redis logs:
ssh robertotcestari@216.238.103.47 "journalctl -u redis-server -n 100"
Supervisor logs:
ssh robertotcestari@216.238.103.47 "tail -f /var/log/supervisor/supervisord.log"
# List all log files with sizes
ssh robertotcestari@216.238.103.47 "ls -lh /var/www/codante-io-api/current/storage/logs/"
# Count lines in each log file
ssh robertotcestari@216.238.103.47 "wc -l /var/www/codante-io-api/current/storage/logs/*"
# Get total size
ssh robertotcestari@216.238.103.47 "du -sh /var/www/codante-io-api/current/storage/logs/"
Find errors in Laravel logs:
ssh robertotcestari@216.238.103.47 "grep 'ERROR\|Exception' /var/www/codante-io-api/current/storage/logs/laravel.log | head -50"
Find errors from specific date:
ssh robertotcestari@216.238.103.47 "grep '\[2025-10-22' /var/www/codante-io-api/current/storage/logs/laravel.log | grep 'ERROR'"
Search for specific errors:
ssh robertotcestari@216.238.103.47 "grep 'payment\|webhook\|queue\|notification' /var/www/codante-io-api/current/storage/logs/laravel.log"
Laravel logs use Monolog format:
[YYYY-MM-DD HH:MM:SS] CHANNEL.LEVEL: MESSAGE {"context": "data"}
Example:
[2025-10-22 14:32:15] laravel.ERROR: Exception occurred {"exception":"[object] (Exception(code: 0): User not found at /app/User.php:123)"...}
Copy single log file:
scp robertotcestari@216.238.103.47:/var/www/codante-io-api/current/storage/logs/laravel.log ./laravel-backup.log
Copy all logs:
scp -r robertotcestari@216.238.103.47:/var/www/codante-io-api/current/storage/logs/ ./production-logs/
Copy security logs:
scp robertotcestari@216.238.103.47:/var/www/codante-io-api/current/storage/logs/security*.log ./
Check log sizes:
ssh robertotcestari@216.238.103.47 "du -h /var/www/codante-io-api/current/storage/logs/"
Rotate/Clear logs via Artisan:
ssh robertotcestari@216.238.103.47 "cd /var/www/codante-io-api/current && php artisan log:clear"
Manually rotate specific log:
ssh robertotcestari@216.238.103.47 "cd /var/www/codante-io-api/current/storage/logs && mv laravel.log laravel.log.$(date +%Y%m%d) && gzip laravel.log.* && ls -lh"
Watch multiple logs simultaneously:
ssh robertotcestari@216.238.103.47 "tail -f /var/www/codante-io-api/current/storage/logs/laravel.log /var/log/nginx/error.log"
Monitor with grep filter:
ssh robertotcestari@216.238.103.47 "tail -f /var/www/codante-io-api/current/storage/logs/laravel.log | grep -E 'ERROR|Exception|Warning'"
Watch payment logs in real-time:
ssh robertotcestari@216.238.103.47 "tail -f /var/www/codante-io-api/current/storage/logs/payments.log"
Codante uses Supervisor to manage Laravel Octane and queue workers.
# Status of all programs
ssh robertotcestari@216.238.103.47 "sudo supervisorctl status"
# Status of Octane specifically
ssh robertotcestari@216.238.103.47 "sudo supervisorctl status codante-octane"
# Status of queue workers (if configured)
ssh robertotcestari@216.238.103.47 "sudo supervisorctl status codante-worker"
# Main supervisor log
ssh robertotcestari@216.238.103.47 "tail -f /var/log/supervisor/supervisord.log"
# Octane logs
ssh robertotcestari@216.238.103.47 "tail -f /var/log/supervisor/codante-octane.log"
# Queue worker logs (if configured)
ssh robertotcestari@216.238.103.47 "tail -f /var/log/supervisor/codante-worker.log"
# Restart Octane
ssh robertotcestari@216.238.103.47 "sudo supervisorctl restart codante-octane"
# Restart all programs
ssh robertotcestari@216.238.103.47 "sudo supervisorctl restart all"
# Start/stop Octane
ssh robertotcestari@216.238.103.47 "sudo supervisorctl start codante-octane"
ssh robertotcestari@216.238.103.47 "sudo supervisorctl stop codante-octane"
# View active queue jobs
ssh robertotcestari@216.238.103.47 "cd /var/www/codante-io-api/current && php artisan queue:failed"
# Monitor queue in real-time
ssh robertotcestari@216.238.103.47 "cd /var/www/codante-io-api/current && php artisan queue:monitor redis:default --timeout=300"
# Retry failed jobs
ssh robertotcestari@216.238.103.47 "cd /var/www/codante-io-api/current && php artisan queue:retry all"
ssh robertotcestari@216.238.103.47 "cat /etc/supervisor/conf.d/codante-worker.conf"
ssh robertotcestari@216.238.103.47 "df -h"
ssh robertotcestari@216.238.103.47 "top -b -n 1 | head -20"
# Octane processes
ssh robertotcestari@216.238.103.47 "ps aux | grep octane"
# nginx processes
ssh robertotcestari@216.238.103.47 "ps aux | grep nginx"
# Check memory by Octane workers
ssh robertotcestari@216.238.103.47 "ps aux | grep octane | awk '{print \$2, \$4, \$6, \$11}'"
# Restart Octane (via Supervisor)
ssh robertotcestari@216.238.103.47 "sudo supervisorctl restart codante-octane"
# Restart nginx
ssh robertotcestari@216.238.103.47 "sudo systemctl restart nginx"
# Restart MySQL
ssh robertotcestari@216.238.103.47 "sudo systemctl restart mysql"
# Restart Redis
ssh robertotcestari@216.238.103.47 "sudo systemctl restart redis-server"
# Restart Supervisor (and all managed programs)
ssh robertotcestari@216.238.103.47 "sudo systemctl restart supervisor"
# Restart all services
ssh robertotcestari@216.238.103.47 "sudo systemctl restart nginx mysql redis-server && sudo supervisorctl restart all"
ssh robertotcestari@216.238.103.47 "cd /var/www/codante-io-api/current && php artisan cache:clear && php artisan optimize:clear"
# Run migrations
ssh robertotcestari@216.238.103.47 "cd /var/www/codante-io-api/current && php artisan migrate"
# Run seeders
ssh robertotcestari@216.238.103.47 "cd /var/www/codante-io-api/current && php artisan db:seed"
# Check database connection
ssh robertotcestari@216.238.103.47 "cd /var/www/codante-io-api/current && php artisan tinker"
# See current release
ssh robertotcestari@216.238.103.47 "ls -l /var/www/codante-io-api/current"
# Check recent commits
ssh robertotcestari@216.238.103.47 "cd /var/www/codante-io-api/current && git log -5 --oneline"
# Check recent releases
ssh robertotcestari@216.238.103.47 "ls -la /var/www/codante-io-api/releases/ | tail -5"
When deploying via GitHub Actions + Deployer:
main branchCheck deployment status:
ssh robertotcestari@216.238.103.47 "ls -la /var/www/codante-io-api/releases/ | tail -5"
# Quick API health check
ssh robertotcestari@216.238.103.47 "curl -s http://127.0.0.1/health"
# Detailed status
ssh robertotcestari@216.238.103.47 "curl -s http://127.0.0.1/api/status | head -20"
# Check if PHP-FPM is responding
ssh robertotcestari@216.238.103.47 "curl -s -o /dev/null -w '%{http_code}' http://127.0.0.1/"
~/.ssh/authorized_keys on the serversudo for privileged commands (requires password or sudo setup).env and other shared config in /var/www/codante-io-api/shared/ - changes survive deploymentsIf you can't connect:
ssh-keyscan 216.238.103.47~/.ssh/configping 216.238.103.47If you get "Permission denied":
robertotcestarichmod 600 ~/.ssh/id_rsacat ~/.ssh/id_rsa.pubIf services are not running:
sudo systemctl status SERVICE_NAMEsudo journalctl -u SERVICE_NAME -n 50sudo systemctl restart SERVICE_NAMEIf Octane isn't responding:
sudo supervisorctl status codante-octanetail -f /var/log/supervisor/codante-octane.logsudo supervisorctl restart codante-octanesudo netstat -tlnp | grep 8089 or sudo ss -tlnp | grep 8089journalctl -u supervisor -n 100 | grep octaneIf queue workers are not processing:
sudo supervisorctl statustail -f /var/log/supervisor/codante-worker.logsudo supervisorctl restart codante-workercd /var/www/codante-io-api/current && php artisan queue:failedIf Octane is consuming too much memory:
free -hps aux | grep octane | awk '{print $2, $4, $6, $11}'sudo supervisorctl restart codante-octanewatch -n 1 'ps aux | grep octane'/var/log/supervisor/codante-octane.logIf queue jobs are failing or not processing:
cd /var/www/codante-io-api/current && php artisan queue:failedtail -f /var/log/supervisor/codante-worker.logcd /var/www/codante-io-api/current && php artisan queue:retry allcd /var/www/codante-io-api/current && php artisan queue:clearcd /var/www/codante-io-api/current && php artisan queue:monitor redis:defaultIf log files are consuming too much disk space:
du -sh /var/www/codante-io-api/current/storage/logs/cd /var/www/codante-io-api/current && php artisan log:cleargzip /var/www/codante-io-api/current/storage/logs/*.log.oldscp ... && ssh ... rmIf you see 502 errors in nginx:
sudo supervisorctl status codante-octanetail -f /var/log/nginx/error.logcurl http://127.0.0.1:8089sudo supervisorctl restart codante-octanetail -f /var/log/supervisor/codante-octane.logIf Pagarme webhooks are failing:
tail -f /var/www/codante-io-api/current/storage/logs/payments.log.envcd /var/www/codante-io-api/current && php artisan queue:failedcd /var/www/codante-io-api/current && php artisan queue:retry allUse this skill when you need to: