Apache HTTP サーバーを起動できません。ユニット apache2.service が失敗しました。

Apache HTTP サーバーを起動できません。ユニット apache2.service が失敗しました。

私は最近を通じてApache2をインストールしましたが、うまくsudo apt install apache2いかないようです。再起動サービスを使用しようとすると、このエラーが発生しますsudo /etc/init.d/apache2 restart。私はKubuntu 18.04.1 64ビットを使用しています。

-- Subject: Unit apache2.service has begun start-up
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
-- 
-- Unit apache2.service has begun starting up.
Aug 29 13:31:47 alpaca-desktop apachectl[10871]: AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1. Set the 'ServerName' di
Aug 29 13:31:47 alpaca-desktop apachectl[10871]: (2)No such file or directory: AH02291: Cannot access directory '/var/log/apache2/' for main error log
Aug 29 13:31:47 alpaca-desktop apachectl[10871]: (2)No such file or directory: AH02291: Cannot access directory '/var/log/apache2/' for error log of vhost defined at /etc/apache2
Aug 29 13:31:47 alpaca-desktop apachectl[10871]: AH00014: Configuration check failed
Aug 29 13:31:47 alpaca-desktop apachectl[10871]: Action 'start' failed.
Aug 29 13:31:47 alpaca-desktop apachectl[10871]: The Apache error log may have more information.
Aug 29 13:31:47 alpaca-desktop systemd[1]: apache2.service: Control process exited, code=exited status=1
Aug 29 13:31:47 alpaca-desktop systemd[1]: apache2.service: Failed with result 'exit-code'.
Aug 29 13:31:47 alpaca-desktop systemd[1]: Failed to start The Apache HTTP Server.
-- Subject: Unit apache2.service has failed
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
-- 
-- Unit apache2.service has failed.
-- 
-- The result is RESULT.

ベストアンサー1

その理由は次のとおりです。

(2)No such file or directory: AH02291: Cannot access directory '/var/log/apache2/' for main error log

ディレクトリが存在しない場合、Apacheはどのように起動しますか?その場合、Apacheに割り当てられたユーザーはそのファイルにアクセスできず、これはファイル権限が正しくないことを意味します。

おすすめ記事