The nginx server keeps reporting the following error when the server is shut down and restarted:
[[email protected] sbin]# nginx: [emerg] open() "/var/run/nginx/nginx.pid" failed (2: No such file or directory)
Solution:
/> /local/nginx/conf/
cd /usr/local/nginx/conf/
- Edit the configuration file nginx.conf
vi nginx.conf
- The following code is commented in the configuration file:
#pid logs/nginx.pid;
- removes the comment, i.e. #, and changes it to the following code:
pid /usr/local/nginx/logs/nginx.pid;
- Press ESC, enter the following code, save and exit
:wq
- > create logs directory in /usr/local/nginx:
[[email protected] conf]# mkdir /usr/local/nginx/logs
- Start the nginx service:
/usr/local/nginx/sbin/nginx
Pro test successful!
Read More:
- nginx: [error] open() "/var/run/nginx/nginx.pid" failed (2: No such file or directory)
- Nginx startup error: nginx: [error] open() “/ var / run / nginx/ nginx.pid The solution of “failed (2: no such file or directory)”
- nginx: [error] open() “/usr/local/var/run/nginx.pid” failed (2: No such file or directory)
- Nginx start error: job for nginx.service failed because the control process exited with error code
- Solve the problem of starting nginx nginx.pid error
- Error! Failed to start nginx
- Nginx configures different domain names to access different projects
- Ubuntu 20.04 builds nginx 1.18.0 and MAC file transfer / download to server
- CentOS7 nginx Failed to read PID from file /run/nginx.pid: Invalid argument?
- nginx: [error] invalid PID number in /var/run/nginx.pid
- Centos7 offline installation of redis and PHP extension redis
- Nginx installation in MAC
- Nginx error: nginx: [error] invalid PID number “” in “/run/nginx.pid”
- nginx: [error] open() “/run/nginx.pid” failed (2: No such file or directory)
- nginx: [emerg] bind() to 0.0.0.0:443 failed (98: Address already in use)
- nginx: open() “/var/run/nginx.pid“ failed (2: No such file or directory)
- Nginx error log (error_ Log) configuration and information explanation
- Nextcloud error: “access forbidden CSRF check failed”
- Boot nginx flash back under Windows
- Solve the problem of syntax error: unexpected end of file or syntax error near unexpected token ` fi ‘error