【问题标题】:Apache not Starting : (98)Address already in useApache 未启动:(98)地址已在使用中
【发布时间】:2020-04-15 01:52:39
【问题描述】:

昨天我的 WordPress 网站离线显示错误 ERR_CONNECTION_REFUSED。今天我发现我的 VPS 中的 Apache 已关闭。启动 Apache,我的控制面板返回:

Job for httpd.service failed because the control process exited with error code. See "systemctl status httpd.service" and "journalctl -xe" for details.
 httpd.service - The Apache HTTP Server
   Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled; vendor preset: disabled)
   Active: failed (Result: exit-code) since Mon 2019-12-23 17:05:28 UTC; 7min ago
     Docs: man:httpd(8)
           man:apachectl(8)
  Process: 7728 ExecStop=/bin/kill -WINCH ${MAINPID} (code=exited, status=1/FAILURE)
  Process: 7727 ExecStart=/usr/sbin/httpd $OPTIONS -DFOREGROUND (code=exited, status=1/FAILURE)
 Main PID: 7727 (code=exited, status=1/FAILURE)

Dec 23 17:05:27 site.com systemd[1]: Starting The Apache HTTP Server...
Dec 23 17:05:28 site.com httpd[7727]: (98)Address already in use: AH00072: make_sock: could not bind to address 0.0.0.0:443 (hidden ip)
Dec 23 17:05:28 site.com httpd[7727]: no listening sockets available, shutting down
Dec 23 17:05:28 site.com httpd[7727]: AH00015: Unable to open logs
Dec 23 17:05:28 site.com systemd[1]: httpd.service: main process exited, code=exited, status=1/FAILURE
Dec 23 17:05:28 site.com kill[7728]: kill: cannot find process ""
Dec 23 17:05:28 site.com systemd[1]: httpd.service: control process exited, code=exited status=1
Dec 23 17:05:28 site.com systemd[1]: Failed to start The Apache HTTP Server.
Dec 23 17:05:28 site.com systemd[1]: Unit httpd.service entered failed state.
Dec 23 17:05:28 site.com systemd[1]: httpd.service failed.

我试图找出端口上正在运行的服务,并杀死它们,但端口 80 和 443 并没有被使用。

通过专门查询这些端口,它们返回:

80/tcp closed http
443/tcp closed https

即使门关闭,尝试启动 apache 服务时也会发生错误。我搜索了 Stack Overflow 的答案,尝试了所有关于这些问题的答案方法,但都没有解决问题。

我在CentOS 7.7.1908 上使用更新的Webmin

【问题讨论】:

    标签: apache centos webmin


    【解决方案1】:

    执行以下命令检查443端口是否被其他服务使用:

    netstat -tunlp | grep 443
    

    如果没有输出,请确保 Listen 443 指令没有在您的域的 Apache 虚拟主机目录中设置多次。

    【讨论】:

    • 我已经尝试检查 80 和 443 端口。而且 Apache 虚拟主机中只有 1 行。
    【解决方案2】:

    我遇到了完全相同的问题,我打开了这个文件:

    /etc/httpd/conf.d/ssl.conf

    看到这两行:

    Listen 443 https
    Listen MY_IP:443
    

    我刚刚评论了第一行,像这样:

    # Listen 443 https
    Listen MY_IP:443
    

    一切都正常了。我能够启动 httpd 服务。

    systemctl start httpd.service

    【讨论】:

      猜你喜欢
      • 2019-09-17
      • 2012-05-31
      • 2013-02-04
      • 1970-01-01
      • 1970-01-01
      • 2011-05-26
      • 1970-01-01
      相关资源
      最近更新 更多