Nginx 開啟,關閉,重啟,查看命令,錯誤解決:Job for nginx.service failed because the control process exited with error code


  

啟動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

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM