1. 程式人生 > >nginx -s reload "/alidata/server/nginx/logs/nginx.pid" failed

nginx -s reload "/alidata/server/nginx/logs/nginx.pid" failed

沒有 ida html directory cgi logs erro 方法 錯誤

[root@snoopy 15:36:58 vhosts]# nginx -s reload
nginx: [error] open() "/alidata/server/nginx/logs/nginx.pid" failed (2: No such file or directory)

修改完nginx的配置後,想重啟下nginx,結果提示這個錯誤,服務器是阿裏雲的ECS服務器

檢查後發現 logs文件發現的確沒有nginx.pid文件

解決方法(使用nginx -c的參數指定nginx.conf文件的位置 ):

[root@snoopy 15:37:39 nginx]# /alidata/server/nginx/sbin/nginx -c /alidata/server/nginx/conf/nginx.conf

去 logs 目錄下查看,發現pid文件已經有了

[root@snoopy 15:51:05 nginx]# ll
total 36
drwx------  2 www  root 4096 Nov 12 15:13 client_body_temp
drw-r--r--  4 root root 4096 Oct 25 20:10 conf
drwx------ 12 www  root 4096 Aug 25  2016 fastcgi_temp
drwxr-xr-x  2 root root 4096 Jul  1  2015 html
drwxrwxr-x  2 www  www  4096 Nov 12
15:39 logs drwx------ 12 www root 4096 Jun 1 20:30 proxy_temp drwxr-xr-x 2 root root 4096 Oct 23 2016 sbin drwx------ 2 www root 4096 Jul 1 2015 scgi_temp drwx------ 2 www root 4096 Jul 1 2015 uwsgi_temp [root@snoopy 15:54:27 nginx]# cd logs [root@snoopy 15:54:30 logs]# ll total 4348 -rw-r--r-- 1
www root 4026619 Nov 12 14:49 access.log -rw-r--r-- 1 root root 408896 Nov 12 15:39 error.log -rw-r--r-- 1 root root 6 Nov 12 15:39 nginx.pid [root@zhipuzi 15:54:31 logs]#

nginx -s reload "/alidata/server/nginx/logs/nginx.pid" failed