1.nginx默认监听80端口,在首次启动过程中莫名其妙启动失败
详情如下:
Jul 04 12:17:21 nginx-test nginx[26479]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
Jul 04 12:17:21 nginx-test nginx[26479]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
Jul 04 12:17:22 nginx-test nginx[26479]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
Jul 04 12:17:22 nginx-test nginx[26479]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
Jul 04 12:17:23 nginx-test nginx[26479]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
Jul 04 12:17:23 nginx-test nginx[26479]: nginx: [emerg] still could not bind()
2.实际上只有nginx在使用80端口,不应该存在占用情况
[root@nginx-test yum.repos.d]# ss -tunlp
Netid State Recv-Q Send-Q Local Address:Port Peer Address:Port
udp UNCONN 0 0 :68 : users:((“dhclient”,pid=2789,fd=6))
udp UNCONN 0 0 127.0.0.1:323 : users:((“chronyd”,pid=2054,fd=1))
udp UNCONN 0 0 ::1:323 ::: users:((“chronyd”,pid=2054,fd=2))
tcp LISTEN 0 128 *:80 : users:((“nginx”,pid=16727,fd=6),(“nginx”,pid=16726,fd=6))
tcp LISTEN 0 128 *:22 : users:((“sshd”,pid=3176,fd=3))
3.反正被占用了,也不知为何?先恢复服务,后续持续跟踪
[root@nginx-test ~]# ps -ef |grep nginx
root 16726 1 0 12:11 ? 00:00:00 nginx: master process nginx
nginx 16727 16726 0 12:11 ? 00:00:00 nginx: worker process
root 26437 16630 0 12:16 pts/1 00:00:00 vim /var/log/nginx/error.log
root 26488 26438 0 12:18 pts/2 00:00:00 grep --color=auto nginx
[root@nginx-test ~]# kill -9 16727 16726