• nginx: [emerg] bind() to 0.0.0.0:80 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:80 failed (98: Address already in use)
    nginx: [emerg] socket() [::]:80 failed (97: Address family not supported by protocol)
    • 1
    • 2

    定位方法

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

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

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

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

  • 相关阅读:
    nodejs install
    taobao sass
    Cors 跨域访问API
    多文件上传
    Next
    实用小工具
    下载包含src,tgz,zip的文件
    HTML5文件API
    Bootstrap (导航、标签、面包屑导航)
    Bootstrap 固定定位(Affix)
  • 原文地址:https://www.cnblogs.com/maohuidong/p/9501925.html
Copyright © 2020-2023  润新知