nginx 启动问题:nginx (pid ) already running.

机器关机重启后,想启动nginx,一直报 nginx (pid ) already running.

一开始 想着是不是端口被占用了?

#netstat -nlpt | grep 80

发现没有啊

看着报错,难道跟pid文件有关?于是把nginx.conf默认配置的pid 文件删除

#rm /usr/local/nginx/log/nginx.pid

再重启,还是不行。这就尴尬啦。端口没有被占用,pid文件删了还是同样的错误

没办法,只能用strace来看看能不能找到问题

#strace /etc/init.d/nginx start

在后面的内容:


pid文件确实是/usr/local/nginx/log/nginx.pid,所以????

不甘心,想来想去还是pid文件的问题,于是,只能找找了

嗯?还有个/usr/local/nginx/nginx.pid

把这两个Pid文件都删除,启动nginx,发现可以了,可以了,可以了。

再重新find一次


只有/usr/local/nginx/logs/nginx.pid。。黑人小问号。

/usr/local/nginx/nginx.pid怎么来的?有怎么会跟nginx的启动有关系?

[root@iZbp11irq8z6b1plo30y63Z ~]# systemctl status nginx.service --no-pager ● nginx.service - LSB: starts the nginx web server Loaded: loaded (/etc/rc.d/init.d/nginx; bad; vendor preset: disabled) Active: failed (Result: exit-code) since Mon 2025-03-10 09:10:25 CST; 1min 35s ago Docs: man:systemd-sysv-generator(8) Process: 32724 ExecStop=/etc/rc.d/init.d/nginx stop (code=exited, status=1/FAILURE) Process: 6383 ExecStart=/etc/rc.d/init.d/nginx start (code=exited, status=1/FAILURE) Mar 10 09:10:23 iZbp11irq8z6b1plo30y63Z nginx[6383]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use) Mar 10 09:10:24 iZbp11irq8z6b1plo30y63Z nginx[6383]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use) Mar 10 09:10:24 iZbp11irq8z6b1plo30y63Z nginx[6383]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use) Mar 10 09:10:25 iZbp11irq8z6b1plo30y63Z nginx[6383]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use) Mar 10 09:10:25 iZbp11irq8z6b1plo30y63Z nginx[6383]: nginx: [emerg] still could not bind() Mar 10 09:10:25 iZbp11irq8z6b1plo30y63Z nginx[6383]: failed Mar 10 09:10:25 iZbp11irq8z6b1plo30y63Z systemd[1]: nginx.service: control process exited, code=exited status=1 Mar 10 09:10:25 iZbp11irq8z6b1plo30y63Z systemd[1]: Failed to start LSB: starts the nginx web server. Mar 10 09:10:25 iZbp11irq8z6b1plo30y63Z systemd[1]: Unit nginx.service entered failed state. Mar 10 09:10:25 iZbp11irq8z6b1plo30y63Z systemd[1]: nginx.service failed. [root@iZbp11irq8z6b1plo30y63Z ~]#
03-11
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值