新しくインストールした 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

関連情報