重新安装 Apache 失败,出现“无法绑定到地址”错误

重新安装 Apache 失败,出现“无法绑定到地址”错误

我尝试重新安装 Apache Web 服务器,但收到以下错误消息:

 * Starting web server apache2                                                  AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1. Set the 'ServerName' directive globally to suppress this message
(98)Address already in use: AH00072: make_sock: could not bind to address [::]:80
(98)Address already in use: AH00072: make_sock: could not bind to address 0.0.0.0:80
no listening sockets available, shutting down
AH00015: Unable to open logs
Action 'start' failed.
The Apache error log may have more information.
 * 
 * The apache2 instance did not start within 20 seconds. Please read the log files to discover problems
invoke-rc.d: initscript apache2, action "start" failed.
Processing triggers for ureadahead (0.100.0-16) ...

有谁有同样的经历并知道如何解决这个问题?

答案1

与许多服务器应用程序一样,您无法绑定到已被其他应用程序绑定的端口。导致错误的原因是 Apache 无法绑定到端口 80,因为其他程序已在该端口监听。

运行sudo netstat -tulpn | grep :80并查找监听端口 80 的进程的名称。然后,重新配置或删除该程序。(如果您在编辑问题时提供输出,我们可以尝试进一步帮助您)。

相关内容