Nginx 开启,关闭,重启,查看命令,错误解决:Job for nginx.service failed because the control process exited with error

  

启动nginx服务时如果遇到这个错误 Job for nginx.service failed because the control process exited with error code. See “systemctl stat 可能原因如下:

  

  1.nginx配置文件有错误

    运行下面命令查看修改

 nginx -t  

  2.已经启动nginx或者配置文件中的端口号被占用

    检查端口是否被占用

netstat -tnlp

 如果端口已经被占用,自己权衡一下是换个端口还是把占用端口的进程杀掉

    如果已经启动使用下面命令干掉即可

pkill -9 nginx

  3.关闭

service nginx stop
systemctl stop nginx

  4.启动

service nginx start
systemctl start nginx

  5.重启

service nginx reload
systemctl restart nginx

  6.随系统启动自动运行

systemctl enable nginx

  7.禁止随系统启动自动运行

systemctl disable nginx

  

  扩展:

  首先利用配置文件启动nginx命令: nginx -c /usr/local/nginx/conf/nginx.conf
  重启服务: service nginx restart
  快速停止或关闭Nginx:nginx -s stop
  正常停止或关闭Nginx:nginx -s quit
  配置文件修改重装载命令:nginx -s reload

 

上一篇:org.springframework.security.web.firewall.RequestRejectedException: The request was rejected because


下一篇:queue instance " " dropped because it is full 由于过载或已满而丢弃所有队列