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

This error is displayed after restarting the virtual machine

 Why is there such an error? First, check whether there is a problem with the configuration file of nginx.conf

into sbin and then  

./nginx -s reload reload and no error is reported, indicating that there is no problem with the configuration file

Then I went to check the error report and found that it was caused by insufficient permissions.

Why is there insufficient permission to use ./nginx?

 

Here you can see that the permission setting of ./nginx is root, which means that after restarting the server, you need to obtain root permission and then start nginx

Obtain root privileges and start nginx again

Summary: If ps -ef |grep nginx finds that if this is www, then you need to open it

chown [option] [owner]:[group] file... Open it and get permission to start normally./nginx service

 

 

Guess you like

Origin blog.csdn.net/weixin_59539033/article/details/127725087