如何启动,停止和重新启动Nginx(Systemctl和Nginx命令)

原创
2022/06/28 16:46
阅读数 309
  • 查看状态 sudo systemctl status nginx
  • 停止服务 sudo systemctl stop nginx
  • 启动服务 sudo systemctl start nginx
  • reload Nginx sudo systemctl reload nginx
  • 重启nginx sudo systemctl restart nginx
  • 启用服务 sudo systemctl enable nginx
  • 禁用服务 sudo systemctl disable nginx
  • 重新加载配置信息 systemctl daemon-reload
  • 服务路径/usr/lib/systemd/system
[Unit]
Description=tengine
After=syslog.target network.target

[Service]
Type=forking
ExecStart=/usr/local/tengine/sbin/nginx
ExecReload=/usr/local/tengine/sbin/nginx -s reload
ExecStop=/usr/local/tengine/sbin/nginx -s stop

[Install]
WantedBy=multi-user.target
展开阅读全文
加载中
点击引领话题📣 发布并加入讨论🔥
打赏
0 评论
0 收藏
0
分享
返回顶部
顶部