최근에 를 통해 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에 할당된 사용자는 해당 파일에 액세스할 수 없으며 이는 파일 권한이 올바르지 않음을 의미합니다.