解決nginx: [error] open() "/usr/local/nginx/logs/nginx.pid" failed錯誤
來源:互聯網
上載者:User
風信網(ithov.com)原創文章:重新開機伺服器,訪問web服務發現無法流覽啦! 登陸伺服器之後進到nginx使用./nginx -s reload重新讀取設定檔,發現報nginx: [error] open() "/usr/local/nginx/logs/nginx.pid" failed (2: No such file or directory)錯誤,進到logs檔發現的確沒有nginx.pid檔 &HTTP://www.aliyun.com/zixun/aggregation/37954.html">nbsp; [root@localhost sbin]# ./nginx -s reload nginx: [error] open() "/usr/local/nginx/logs/nginx.pid" failed (2: No such file o r directory) 解決方法: [root@localhost nginx]# /usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf 使用nginx -c的 參數指定nginx.conf檔的位置 [root@localhost nginx]# cd logs/ [root@localhost logs]# ll 總用量 12 -rw-r--r-- 1 root root 1246 12月 9 18:10 access.log -rw-r--r-- 1 root root 516 12月 10 15:39 error.log -rw-r--r-- 1 root root 5 12月 10 15:38 nginx.pid 看nginx.pid檔已經有了。