Restart the server, access the web service and find that you can’t browse! After logging in to the server, I went to nginx and used. /nginx -s reload to re-read the configuration file, and found that nginx: [error] open() “/usr/local/nginx/logs/nginx.pid” failed (2: No such file or directory), went to the logs file and found that there was 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
Use the nginx -c argument to specify the location of the nginx.conf file
[root@localhost nginx]# cd logs/
[root@localhost logs]# ll
Total usage 12
-rw-r–r– 1 root root 1246 Dec 9 18:10 access.log
-rw-r–r– 1 root root 516 Dec 10 15:39 error.log
-rw-r–r– 1 root root 5 Dec 10 15:38 nginx.pid
Look at the nginx.pid file already.
Similar Posts:
- [Solved] Nginx Restart Error: nginx: [error] open() “/usr/local/nginx/logs/nginx.pid” failed (2: No such file or directory)
- nginx: [error] open() “/usr/local/nginx/logs/nginx.pid“ failed (2: No such file or directory)
- CentOS starts nginx and prompts nginx: [emergency] still could not bind ()
- Nginx Error: nginx: [error] CreateFile() “D:\nginx-1.20.1/logs/nginx.pid” failed (2: The system cannot find the file specified)
- [Solved] Nginx Startup Error: nginx: [alert] could not open error log file: open() “/usr/local/nginx/logs/error.log“ failed
- nginx Server Start Error: nginx: [emerg] open() “/var/run/nginx/nginx.pid” failed (Linux Restart)
- [Solved] Nginx Log Error: open() “/opt/Nginx/nginx/nginx.pid” failed (2: No such file or directory)
- [Solved] Nginx restart error: nginx: [error] open() “/run/nginx.pid” failed (2: No such file or directory)
- nginx: [error] CreateFile() “D:\nginx-1.20.1/logs/nginx.pid“ failed (2: The system cannot find the
- nginx: [emerg] getpwnam(“nginx”) failed [How to Fix]