美文网首页
解决Nginx: [error] open() "/usr/lo

解决Nginx: [error] open() "/usr/lo

作者: 一觉睡到丶小时候 | 来源:发表于2020-07-25 08:33 被阅读0次

问题

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

解决

./nginx -c /usr/local/nginx/conf/nginx.conf

[root@localhost local]# cd nginx
[root@localhost nginx]# ll
总用量 4
drwx------. 2 nobody root    6 6月   4 11:50 client_body_temp
drwxr-xr-x. 2 root   root 4096 7月  25 08:21 conf
drwx------. 2 nobody root    6 6月   4 11:50 fastcgi_temp
drwxr-xr-x. 3 root   root   51 6月  19 15:24 html
drwxr-xr-x. 2 root   root   41 6月  20 09:05 logs
drwx------. 2 nobody root    6 6月   4 11:50 proxy_temp
drwxr-xr-x. 2 root   root   19 7月  24 17:52 sbin
drwx------. 2 nobody root    6 6月   4 11:50 scgi_temp
drwx------. 2 nobody root    6 6月   4 11:50 uwsgi_temp
[root@localhost nginx]# cd sbin/
[root@localhost sbin]# ll
总用量 6772
-rwxr-xr-x. 1 root root 6932912 6月   4 11:40 nginx
[root@localhost sbin]# ./nginx -c /usr/local/nginx/conf/nginx.conf
[root@localhost sbin]# cd ../
[root@localhost nginx]# ll
总用量 4
drwx------. 2 nobody root    6 6月   4 11:50 client_body_temp
drwxr-xr-x. 2 root   root 4096 7月  25 08:21 conf
drwx------. 2 nobody root    6 6月   4 11:50 fastcgi_temp
drwxr-xr-x. 3 root   root   51 6月  19 15:24 html
drwxr-xr-x. 2 root   root   58 7月  25 08:28 logs
drwx------. 2 nobody root    6 6月   4 11:50 proxy_temp
drwxr-xr-x. 2 root   root   19 7月  24 17:52 sbin
drwx------. 2 nobody root    6 6月   4 11:50 scgi_temp
drwx------. 2 nobody root    6 6月   4 11:50 uwsgi_temp
[root@localhost nginx]# cd logs
[root@localhost logs]# ll
总用量 12
-rw-r--r--. 1 root root 1647 6月  19 15:30 access.log
-rw-r--r--. 1 root root 3131 7月  25 08:24 error.log
-rw-r--r--. 1 root root    5 7月  25 08:28 nginx.pid

相关文章

网友评论

      本文标题:解决Nginx: [error] open() "/usr/lo

      本文链接:https://www.haomeiwen.com/subject/fhcplktx.html