Solve Nginx: [error] open() "/usr/local/Nginx/logs/Nginx.pid

  
                  

Restart the server and access the web service and find it impossible to browse! After logging in to the server, go to nginx and re-read the configuration file using ./nginx -s reload and find that nginx: [error] open() "/usr/local/nginx/logs/nginx.pid" failed (2: No such File or directory) error, go to the logs file and find that there is no nginx.pid file

[root@localhost sbin]# ./nginx -s reload

nginx: [error] open() "/usr/local/nginx/logs/nginx.pid" failed (2: No such file or directory)

Solution:

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

Specify the location of the nginx.conf file using the nginx -c parameter


[root@localhost nginx]# cd logs/

[root@localhost logs]# ll

Total usage 12

-rw-r--r-- 1 root root 1246 December 9 18:10 access.log

-rw-r--r-- 1 root root 516 December 10 15:39 error.log

-rw- R--r-- 1 root root 5 December 10 15:38 nginx.pid


See the nginx.pid file already.

Copyright © Windows knowledge All Rights Reserved