无法启动 Apache HTTP 服务器

无法启动 Apache HTTP 服务器
● apache2.service - The Apache HTTP Server
   Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor pres
   Active: **failed** (Result: exit-code) since Sun 2018-07-08 22:32:36 SAST; 18
  Process: 18097 ExecStart=/usr/sbin/apachectl start (code=exited, status=1/

Jul 08 22:32:36 anonymous apachectl[18097]: AH00558: apache2: Could not reli
Jul 08 22:32:36 anonymous apachectl[18097]: (98)Address already in use: AH00
Jul 08 22:32:36 anonymous apachectl[18097]: (98)Address already in use: AH00
Jul 08 22:32:36 anonymous apachectl[18097]: no listening sockets available, 
Jul 08 22:32:36 anonymous apachectl[18097]: AH00015: Unable to open logs
Jul 08 22:32:36 anonymous apachectl[18097]: Action 'start' failed.
Jul 08 22:32:36 anonymous apachectl[18097]: The Apache error log may have mo
Jul 08 22:32:36 anonymous systemd[1]: apache2.service: Control process exite
Jul 08 22:32:36 anonymous systemd[1]: apache2.service: Failed with result 'e
Jul 08 22:32:36 anonymous systemd[1]: **Failed to start The Apache HTTP Server**
lines 1-15/15 (END)

答案1

Apache 无法启动的原因是已有程序正在监听端口/IP 组合。日志中的“地址已在使用中”条目表明了这一点。

您需要确定这些端口上正在运行的其他服务,然后在打开 Apache 之前将其关闭。

但是,由于您的日志片段仅有的是部分的(而不是来自,sudo systemctl -l status apache2所以我们可以以大形式或直接从中看到所有实际有用的信息/var/log/apache2/error.log),我们无法真正指出您要查看哪些应用程序,因为我们无法确定正在使用的端口(我的假设是端口 80,在这种情况下,sudo ss -ntlp 'sport = 80'我们将更好地了解已经在端口 80 上监听的内容。请根据长日志数据将“80”替换为实际正在使用的其他端口,该数据在您在此处粘贴的内容中被截断。)

相关内容