debian

Debian Nginx启动停止管理

小樊
48
2025-07-07 00:41:24
栏目: 智能运维

在Debian系统中,使用Systemd来管理Nginx服务的启动和停止。以下是一些常用的命令:

  1. 启动Nginx服务:
sudo systemctl start nginx
  1. 停止Nginx服务:
sudo systemctl stop nginx
  1. 重启Nginx服务:
sudo systemctl restart nginx
  1. 查看Nginx服务状态:
sudo systemctl status nginx
  1. 设置Nginx服务开机自启:
sudo systemctl enable nginx
  1. 取消Nginx服务开机自启:
sudo systemctl disable nginx
  1. 查看Nginx服务的日志:
sudo journalctl -u nginx

请注意,执行这些命令需要具有root权限。如果你不是root用户,请在命令前加上sudo

0
看了该问题的人还看了