在Debian系统上管理Nginx服务,您可以使用以下命令:
sudo apt update
sudo apt install nginx
sudo systemctl start nginx
sudo systemctl stop nginx
sudo systemctl restart nginx
sudo systemctl status nginx
sudo systemctl enable nginx
sudo systemctl disable nginx
nginx -t
sudo nano /etc/nginx/nginx.conf
或者编辑特定站点的配置文件:
sudo nano /etc/nginx/sites-available/your-site-config
修改完成后,保存并退出编辑器。
sudo nginx -t
sudo systemctl reload nginx
sudo tail -f /var/log/nginx/access.log
sudo tail -f /var/log/nginx/error.log
通过以上命令,您可以在Debian系统上轻松地管理Nginx服务。请确保在进行任何更改之前备份配置文件,以防出现问题。