Comando Úteis para servidores Linux (ubuntu)
Em 18/07/2025 | Por Digital Apps | 143 visualizações
Tabela de comandos links utilizadas na implantação de servidores VPS. Estes comando auxiliam na instalação da Linguagem Python, Certificado SSL Let's Encrypt, Banco de dados PostgreSQL e ambiente de produção dom PostgreSQL.
| 1 | Remover certbot | sudo apt remove certbot python3-certbot-nginx -y |
| 2 | Instale via Snap (recomendado pelo próprio Certbot) | sudo snap install core; sudo snap refresh core sudo snap install --classic certbot sudo ln -s /snap/bin/certbot /usr/bin/certbot |
| 3 | Rodar Certbot no NGINX Versão certbot |
sudo certbot --nginx certbot --version |
| 4 | Renovação automatica CERTBOT | sudo systemctl list-timers | grep certbot |
| 5 | Iniciar, Parar e Status NGINX | sudo systemctl start nginx sudo systemctl stop nginx sudo systemctl status nginx |
| 6 | Iniciar Python (DJango) em Produção | sudo gunicorn config.wsgi:application & |
| 7 | Iniciar Python (DJango) em Desenvolvimento | python manage.py runserver 0.0.0.0:8000v |
| 8 | Serviços que estão rodando porta 8000 (PID) | sudo lsof -i :8000 |
| 9 | Matar/Parar Processo | sudo kill -9 31703 (PID) |
| 10 | Acessar PostgreSQL | sudo -u postgres psql |
| 11 | Versão PostgreSQL | psql --version |
| 12 | Listar banco de dados | \l ou \list |
| 13 | Instalar Django conversão específica | pip install django==5.2.4 |
| 14 | Instalar Gunicorn | sudo pip3 install gunicorn |
| 15 | Instalar PIP (Python) | python3.12 get-pip.py |
| 16 | Nova Senha PostgreSQL para usuario postgres | \password postgres |
| 17 | Saber o PID do servido gunicorn | ps aux | grep gunicorn |
| 18 | Acessar o Ambiente VENV | source venv/bin/activate |
| 19 | Sair do Ambiente VENV | deactivate |
| 20 | Listar Tabelas | \dt |
| 21 | Conectar ao Banco de Dados | \c nome_do_banco |