Question:
Nginx: [error] open() “/var/run/nginx/nginx.pid” failed (2: No such file or directory)
Cause of the problem:
The nginx.pid file cannot be found in /var/run/nginx/. There are two ways to do this:
The default directory is /var/run/nginx/.
The second way: Modify the nginx.conf file to specify the directory where the PID file resides. Let’s demonstrate the second way. As follows:
Solution:
(1) to CD/usr/local/nginx/conf/directory, edit the configuration file nginx. Conf.
#pid logs/nginx.pid; #pid logs/nginx.pid;
(3) the annotation, go out and amended as: pid/usr/local/nginx/logs/nginx pid;
Mkdir /usr/local/nginx/logs = ‘/usr/local/nginx/logs’
CD /usr/local/nginx/sbin/ CD /usr/local/nginx/sbin
Read More:
- nginx: [error] open() "/var/run/nginx/nginx.pid" failed (2: No such file or directory)
- /var/run/nginx/nginx.pid” failed (2: No such file or directory)
- nginx: [error] open() “/usr/local/var/run/nginx.pid” failed (2: No such file or directory)
- nginx: open() “/var/run/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)
- nginx: [error] open() “/run/nginx.pid” failed (2: No such file or directory)
- nginx: [error] invalid PID number in /var/run/nginx.pid
- Nginx error: nginx: [error] invalid PID number “” in “/run/nginx.pid”
- CentOS7 nginx Failed to read PID from file /run/nginx.pid: Invalid argument?
- nginx: [error] invalid PID number ““ in “/data/nginx/logs/nginx.pid“
- Solve the problem of starting nginx nginx.pid error
- Nginx start error: job for nginx.service failed because the control process exited with error code
- Resolve nginx startup failure
- Error! Failed to start nginx
- nginx: [emerg] bind() to 0.0.0.0:443 failed (98: Address already in use)
- Ubuntu 20.04 builds nginx 1.18.0 and MAC file transfer / download to server
- Nginx upload error 413 request entity too large
- Nginx reports 502 error, log connect() failed (111: Connection refused) while connecting to upstream. A personal effective solution
- Nginx installation in MAC
- Implementation of HTTPS file server based on nginx in win2012