nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)

冷不防 2022-06-12 01:28 525阅读 0赞

nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)

报错信息

  1. nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
  2. nginx: [emerg] socket() [::]:80 failed (97: Address family not supported by protocol)

定位方法

1.先使用ps -e | grep nginx查看是否已经启动了nginx

2.如果没有的话则按照提示,查看0.0.0.0:80端口谁占用了,使用netstat -ltunp命令,可以看到

  1. Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
  2. tcp 0 0 127.0.0.1:10000 0.0.0.0:* LISTEN 1177/php-fpm
  3. tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 1109/httpd
  4. tcp 0 0 0.0.0.0:21 0.0.0.0:* LISTEN 836/vsftpd
  5. tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 823/sshd
  6. tcp 0 0 0.0.0.0:3306 0.0.0.0:* LISTEN 1073/mysqld

可以看到0.0.0.0:80端口被httpd这个进程占用了(也就是apcache占用)

发表评论

表情:
评论列表 (有 0 条评论,525人围观)

还没有评论,来说两句吧...

相关阅读