日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 >

nginx(No such file or directory与invalid PID number)

發布時間:2025/3/21 32 豆豆
生活随笔 收集整理的這篇文章主要介紹了 nginx(No such file or directory与invalid PID number) 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

1.啟動

/usr/local/nginx/sbin/nginx

2.重啟

/usr/local/nginx/sbin/nginx -s reload

3.關閉

/usr/local/nginx/sbin/nginx -s stop

4.檢驗配置文件

/usr/local/nginx/sbin/nginx -t

5.再啟動nginx服務時,無法正常啟動,報錯誤信息如下

[root@localhost nginx]# /usr/local/nginx/sbin/nginx -t nginx: the configuration file /usr/local/nginx/conf/nginx.conf syntax is ok nginx: configuration file /usr/local/nginx/conf/nginx.conf test is successful[root@localhost nginx]# /usr/local/nginx/sbin/nginx -s reload nginx: [error] invalid PID number "" in "/usr/local/nginx/logs/nginx.pid"

-t 沒問題,reload就報錯了。因為是加載配置文件報的錯,所以用-c 選項指定配置文件 ,如此指明后問題解決搜了一下解決:

[root@localhost logs]# /usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf

6.此時如果nginx進程殺死后pid丟失了,下一次再開啟nginx -s reload時無法啟動,重裝可以解決這個問題,但是太麻煩了,也可以用

[root@localhost logs]# /usr/local/nginx/sbin/nginx -c /usr/local/nginx/logs/nginx.pid

注:看是不是端口被占用

ss -nulpt

7.記錄我的一個報錯

1.先用網上查的方法測了

[root@localhost logs]# /usr/local/nginx/sbin/nginx -s reload
nginx: [error] open() "/usr/local/nginx/logs/nginx.pid" failed (2: No such file or directory)

[root@localhost logs]# /usr/local/nginx/sbin/nginx -c /usr/local/nginx/logs/nginx.pid
nginx: [emerg] open() "/usr/local/nginx/logs/nginx.pid" failed (2: No such file or directory)

2.查看是否啟動

[root@localhost logs]# ss -nulpt? | grep :80
tcp??? LISTEN???? 0????? 128?????????????????????? *:80??????????????????????????????????? *:*?????????????????? users:(("nginx",pid=4488,fd=6),("nginx",pid=4487,fd=6))

[root@localhost logs]#? pgrep nginx
4487
4488

3.嘗試手動關閉

[root@localhost nginx]# /usr/local/nginx/sbin/nginx -s stop
nginx: [error] open() "/usr/local/nginx/logs/nginx.pid" failed (2: No such file or directory)

[root@localhost logs]#? killall -9 nginx

[root@localhost logs]#? ps -auxf | grep nginx
root????? 4518? 0.0? 0.0 112720?? 984 pts/1??? S+?? 21:28?? 0:00????????? \_ grep --color=auto nginx

4.重啟就好啦

[root@localhost logs]#? /usr/local/nginx/sbin/nginx

[root@localhost logs]# ss -nulpt | grep nginx
tcp??? LISTEN???? 0????? 128?????? *:80??????????????????? *:*?????????????????? users:(("nginx",pid=4521,fd=6),("nginx",pid=4520,fd=6))

[root@localhost logs]# ls
access.log? error.log? nginx.pid

一開始百度解決該問題。只是找到幾個求助答案。沒有實際有效的方法,搜到的也是-c的那個

總結

以上是生活随笔為你收集整理的nginx(No such file or directory与invalid PID number)的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。