为什么新安装的 apache2 无法在 Ubuntu Server 20 中启动

为什么新安装的 apache2 无法在 Ubuntu Server 20 中启动

安装了新的 Ubuntu Server 20。然后尝试安装 apache2,但出现这些错误并且 apache 无法启动。

Aug 16 21:06:47 xxx apachectl[2563820]: 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 
Aug 16 21:06:47 xxx apachectl[2563820]: (98)Address already in use: AH00072: make_sock: could not bind to address [::]:80
Aug 16 21:06:47 xxx apachectl[2563820]: (98)Address already in use: AH00072: make_sock: could not bind to address 0.0.0.0:80
Aug 16 21:06:47 xxx apachectl[2563820]: no listening sockets available, shutting down
Aug 16 21:06:47 xxx apachectl[2563820]: AH00015: Unable to open logs
Aug 16 21:06:47 xxx apachectl[2563802]: Action 'start' failed.
Aug 16 21:06:47 xxx apachectl[2563802]: The Apache error log may have more information.
Aug 16 21:06:47 xxx systemd[1]: apache2.service: Control process exited, code=exited, status=1/FAILURE
Aug 16 21:06:47 xxx systemd[1]: apache2.service: Failed with result 'exit-code'.
Aug 16 21:06:47 xxx systemd[1]: Failed to start The Apache HTTP Server.
Processing triggers for systemd (245.4-4ubuntu3.2) ...

答案1

请发布输出

netstat -tulpen | grep 80

看来端口 80 已被使用。

查看您的错误日志:

(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

相关内容