Mac OS Big Sur-Homebrew Apache-48)地址已在使用中:AH00072:make_sock:无法绑定到地址0.0.0.0:8080 [英] Mac OS Big Sur - Homebrew Apache - 48)Address already in use: AH00072: make_sock: could not bind to address 0.0.0.0:8080

查看:107
本文介绍了Mac OS Big Sur-Homebrew Apache-48)地址已在使用中:AH00072:make_sock:无法绑定到地址0.0.0.0:8080的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Mac OS Big Sur上的Apache遇到问题.操作系统更新后,Apache(使用Brew)不再起作用.因此,我决定卸载 httpd 公式.然后测试了预安装的Apache版本是否可以运行.

I have a problem with Apache on Mac OS Big Sur. After the OS update, the Apache (using Brew) doesn't work anymore. So I have decided to uninstalled the httpd Formula. Then tested is the preinstalled version of Apache works and it does.

  1. 所以我已经停止了预装的Apache sudo apachectl stop
  2. 已卸载的启动器 sudo launchctl卸载-w/System/Library/LaunchDaemons/org.apache.httpd.plist 2>/dev/null
  3. 更新了自制软件
    • 酿造更新
    • 酿造医生
    • 酿造升级

但是检查状态 sudo brew服务列表我可以看到httpd服务的状态为错误.当我尝试使用 sudo apachectl start 启动apache时,收到错误消息:

However checking the status sudo brew services list I can see that the httpd service has status error. When I try to start apache using sudo apachectl start I'm receiving the error:

(48)Address already in use: AH00072: make_sock: could not bind to address 0.0.0.0:8080
no listening sockets available, shutting down
AH00015: Unable to open logs

我已经检查了8080端口上是否还有其他运行的 lsof -i TCP:8080 ,但不是.

I've checked if maybe there is something else running on the 8080 port lsof -i TCP:8080 but it's not.

我检查了使用哪个Apache(哪个apachectl ),它似乎是正确的((code)/usr/local/bin/apachectl )

I've checked which Apache is used (which apachectl) and it seems to be the right one (/usr/local/bin/apachectl)

无论我要使用哪个端口,总是会出现一个错误,表明该地址已被使用.

No matter what port I'm trying to use, always there is an error that the address is already in use.

有人知道如何解决此问题吗?

Does anyone has any idea how to fix this problem?

推荐答案

我遇到了同样的问题.似乎与 INADDR_ANY(0.0.0.0)的绑定失败.

I was facing the same problem. It appears that bindings to INADDR_ANY (0.0.0.0) fail.

为避免绑定错误,我在/usr/local/etc/httpd/httpd.conf 中更改了以下行:

To circumvent the bind error, I changed in /usr/local/etc/httpd/httpd.conf the following line:

Listen 8080

收件人:

Listen 127.0.0.1:8080

然后,我可以使用以下命令启动没有绑定错误的apache:

Afterwards, I could start apache without the bind error, using the following command:

sudo apachectl -k start

这篇关于Mac OS Big Sur-Homebrew Apache-48)地址已在使用中:AH00072:make_sock:无法绑定到地址0.0.0.0:8080的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆