Nginx重启出现Address already in use
|启动nginx服务的时候,无法开启,发现提示错误信息,问题描述是地址已被使用,可能nginx服务卡死了,导致端口占用,出现此错误。
下面错误信息:
nginx: [emerg] bind() to 0.0.0.0:443 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:443 failed (98: Address already in use)
查看端口:
[root@localhost letsencrypt]# netstat -ntpl
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 44882/nginx: worker
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 1120/sshd
tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 2245/master
tcp 0 0 0.0.0.0:443 0.0.0.0:* LISTEN 44882/nginx: worker
tcp 0 0 103.73.162.39:8989 0.0.0.0:* LISTEN 1757/ss-server
tcp 0 0 127.0.0.1:2368 0.0.0.0:* LISTEN 2411/node /web/webn
tcp6 0 0 :::3306 :::* LISTEN 2322/mysqld
tcp6 0 0 :::22 :::* LISTEN 1120/sshd
杀掉进程:
kill 44882
重启nginx服务:
nginx -s reload
查看Nginx进程:
ps -ef|grep nginx