在上,我和Apache有个问题。在操作系统更新之后,Apache (使用Brew)不再工作了。因此,我决定卸载httpd公式。然后测试了Apache的预装版本,并进行了测试。
sudo apachectl stop。sudo launchctl unload -w /System/Library/LaunchDaemons/org.apache.httpd.plist 2>/dev/nullbrew updatebrew doctorbrew upgradebrew install httpd (成功安装)sudo brew services start httpd但是,检查状态sudo brew services list,我可以看到httpd服务具有状态error。当我尝试使用sudo apachectl start启动apache时,我会收到以下错误:
(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上是否还有别的东西在运行,但事实并非如此。
我检查了使用了哪个Apache (which apachectl),它似乎是正确的(/usr/local/bin/apachectl)
无论我试图使用哪个端口,始终存在一个错误,即地址已经在使用中。
有人知道如何解决这个问题吗?
发布于 2020-11-19 22:04:09
我也面临着同样的问题。到INADDR_ANY (0.0.0.0)的绑定似乎失败了。
为了避免绑定错误,我在/usr/local/etc/httpd/httpd.conf中修改了以下行:
Listen 8080至:
Listen 127.0.0.1:8080之后,我可以在没有绑定错误的情况下启动apache,使用以下命令:
sudo apachectl -k start发布于 2020-12-13 01:24:41
我也遇到了同样的问题,但需要在端口80上运行apache。首先,我让它使用上面@FrankStappers的解决方案,在8080上使用:
Listen 127.0.0.1:8080
ServerName localhost:8080接下来,我尝试在Listen和ServerName指令中将端口更改为80。“重新启动”给我留下了以下错误:
(13)Permission denied: AH00072: make_sock: could not bind to address 127.0.0.1:80
no listening sockets available, shutting down
AH00015: Unable to open logs最后,按照以下方法更改Listen和ServerName:
Listen 0.0.0.0:80
ServerName localhost解决方案记录在故障排除https://getgrav.org/blog/macos-bigsur-apache-multiple-php-versions的非苏丹httpd服务启动部分中。
发布于 2021-03-16 16:04:39
我的解决方案:
brew services stop httpdhttpd.conf可能位于/usr/local/etc/httpd/httpd.confListen 80
ServerName localhostbrew services start httpdhttps://stackoverflow.com/questions/64912014
复制相似问题