Apache2“无法启动 Apache HTTP 服务器”

Apache2“无法启动 Apache HTTP 服务器”

大家好,我在 Apache2(在 ubuntu 上)上遇到了问题。我的服务器无法启动,当我进入时,systemctl status apache2.service我看到了以下内容;

        ● apache2.service - The Apache HTTP Server
   Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset: enabled)
  Drop-In: /lib/systemd/system/apache2.service.d
           └─apache2-systemd.conf
   Active: failed (Result: exit-code) since Sat 2019-01-12 13:11:24 +03; 22min ago
  Process: 7336 ExecStart=/usr/sbin/apachectl start (code=exited, status=1/FAILURE)

Jan 12 13:11:24 lvlzyro apachectl[7336]: 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
Jan 12 13:11:24 lvlzyro apachectl[7336]: (98)Address already in use: AH00072: make_sock: could not bind to address [::]:80
Jan 12 13:11:24 lvlzyro apachectl[7336]: (98)Address already in use: AH00072: make_sock: could not bind to address 0.0.0.0:80
Jan 12 13:11:24 lvlzyro apachectl[7336]: no listening sockets available, shutting down
Jan 12 13:11:24 lvlzyro apachectl[7336]: AH00015: Unable to open logs
Jan 12 13:11:24 lvlzyro apachectl[7336]: Action 'start' failed.
Jan 12 13:11:24 lvlzyro apachectl[7336]: The Apache error log may have more information.
Jan 12 13:11:24 lvlzyro systemd[1]: apache2.service: Control process exited, code=exited status=1
Jan 12 13:11:24 lvlzyro systemd[1]: apache2.service: Failed with result 'exit-code'.
Jan 12 13:11:24 lvlzyro systemd[1]: Failed to start The Apache HTTP Server.

答案1

最有可能的是 Apache 或其他 Web 服务器(例如 nginx)已在运行。要检查这一点,请在进程列表中查找apachehttpdnginx使用 或netstat -anp | grep ':80\s'进行查找。

了解哪个进程使用端口 80 后,您可以决定是否要终止它,或者如果您的配置不受支持并且无法在端口 80 上使用 Apache

答案2

你需要禁用防火墙 进而重启电脑

代码:sudo ufw disable

相关内容