Tag Archives: nginx: [emerg] open() “/var/run/nginx/nginx.pid” failed

nginx Server Start Error: nginx: [emerg] open() “/var/run/nginx/nginx.pid” failed (Linux Restart)

Question:

After Linux restarts, an error is reported when starting the nginx server

Solution:

1. Use the command CD/usr/local/nginx/conf to enter the specified directory

2. Use the command VI nginx Conf modify the configuration file # and remove the # number in the figure

3. Change to PID/usr/local/nginx/logs/nginx.pid;

4. Use the command MKDIR/usr/local/nginx/logs to create a directory

5. Start nginx service