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

created at 11-16-2021 views: 32

Today, the operation and maintenance colleague changed the server password, saying that it was for security, and the password was changed regularly. Ah yeah~ This password has not been changed for several years. There are mainly too many services in it. After the change is completed, many places have to be changed. trouble

The operation and maintenance said that the machine was restarted, and then the nginx service was shut down, and it needs to be restarted

First restart the command (two commands)

cd /usr/local/nginx/sbin
./nginx -s reload

Then it reported an error

NGINX ERROR

This is not a trivial matter, go to the configuration file,

vim /usr/local/nginx/conf/nginx.conf

Go to find the pid and find it is annotated, then remove it and restart again

Then I was too young, my bug maker, how could one problem be solved, and then I remembered that I didn’t specify the configuration directory

Then go to execute this command

sudo /usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf

Then restart it again, pay attention to the directory or something

created at:11-16-2021
edited at: 11-16-2021: