1、nginx重新加载报错:
[root /sbin]# nginx -s reload
nginx: [error] open() "/usr/local/nginx/logs/nginx.pid" failed (2: No such file or directory)
2、然后使用-c进行启动:
[root /]# nginx -c /usr/local/nginx/logs/nginx
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
3、提示端口号被占用了,杀掉进程
[root /]# killall -9 nginx
nginx -c /usr/local/nginx/logs/nginx
4、查询nginx端口
[root /]# ps aux|grep nginx
root 11742 0.0 0.0 21012 1244 ? Ss 2022 0:00 nginx: master process /usr/local/nginx/sbin/nginx
nobody 11743 0.0 0.0 23580 2820 ? S 2022 35:59 nginx: worker process
root 70955 0.0 0.0 112812 976 pts/0 S+ 09:04 0:00 grep --color=auto nginx