重啟或殺掉Nginx進程后丟失nginx.pid的解決辦法
更新時間:2014年01月14日 15:24:49 作者:
在重啟或殺掉nginx進程后,會丟失nginx.pid文件,導致nginx無法正常啟動,這里分享下解決方法
安裝SSL證書時,強行殺掉了Nginx的進程,就再也沒起來:
Restarting nginx daemon: nginxcat: /usr/local/nginx/logs/nginx.pid: No such file or directory
kill: usage: kill [-s sigspec | -n signum | -sigspec] pid | jobspec … or kill -l [sigspec]
nginx not running.
原因分析:
nginx.pid丟掉了
如何找回:
復制代碼 代碼如下:
issued a nginx -s stop and after that I got this error when trying to reload it.
[error]: invalid PID number “” in “/var/run/nginx.pid”
That /var/run/nginx/pid file is empty atm.
What do I need to do to fix it?
nginx -s reload is only used to tell a running nginx process to reload its config. After a stop, you don't have a running nginx process to send a signal to. Just run nginx (possibly with a -c /path/to/config/file)
運行命令:
復制代碼 代碼如下:
/usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/vhost/jb51.net.conf
此時,nginx已可以正常啟動了。
相關文章
Apache Nginx 禁止目錄執(zhí)行PHP腳本文件的方法
這篇文章主要介紹了Apache Nginx 禁止目錄執(zhí)行PHP腳本文件的方法,小編覺得挺不錯的,現(xiàn)在分享給大家,也給大家做個參考。一起跟隨小編過來看看吧2018-06-06
Nginx代理Vue項目出現(xiàn)Invalid Host header問題及解決
在使用Nginx的upstream對Vue項目進行負載均衡時,如果代理地址無法訪問目標地址且頁面報錯InvalidHostheader(無效主機頭),可能是由于Vue項目的主機檢查配置導致的,解決方法是在Vue項目的webpack.dev.js文件中的devServer下添加disableHostCheck:true,跳過主機檢查2024-12-12
Nginx(PHP/fastcgi)的PATH_INFO問題
PATH_INFO是一個CGI 1.1的標準,經常用來做為傳參載體. 比如, 我們可以使用PATH_INFO來代替Rewrite來實現(xiàn)偽靜態(tài)頁面, 另外不少PHP框架也使用PATH_INFO來作為路由載體.2011-08-08

