apache2 не может перезагрузиться в Ubuntu 16.04

Я установил apache2 на свой компьютер Ubuntu, сначала он работал нормально, когда я начал и многократно перезапускался в ходе курса. Но теперь, когда я попытался перезапустить, он дал мне сообщение об ошибке:

[....] Restarting apache2 (via systemctl): apache2.serviceJob for apache2.service failed because the control process exited with error code. See "systemctl status apache2.service" and "journalctl -xe" for details.

Когда отмечено systemctl status apache2.service, он дал мне следующее сообщение:

● apache2.service - LSB: Apache2 web server Loaded: loaded (/etc/init.d/apache2; bad; vendor preset: enabled) Drop-In: /lib/systemd/system/apache2.service.d └─apache2-systemd.conf Active: failed (Result: exit-code) since Mon 2017-06-12 05:49:53 IST; 16s ago Docs: man:systemd-sysv-generator(8) Process: 9478 ExecStart=/etc/init.d/apache2 start (code=exited, status=1/FAILURE) Jun 12 05:49:53 yathartha-inspiron apache2[9478]: * Jun 12 05:49:53 yathartha-inspiron apache2[9478]: * The apache2 configtest failed. Jun 12 05:49:53 yathartha-inspiron apache2[9478]: Output of config test was: Jun 12 05:49:53 yathartha-inspiron apache2[9478]: apache2: Syntax error on line 140 of /etc/apache2/apache2.conf: Syntax error on line 2 of /et Jun 12 05:49:53 yathartha-inspiron apache2[9478]: Action 'configtest' failed. Jun 12 05:49:53 yathartha-inspiron apache2[9478]: The Apache error log may have more information. Jun 12 05:49:53 yathartha-inspiron systemd[1]: apache2.service: Control process exited, code=exited status=1 Jun 12 05:49:53 yathartha-inspiron systemd[1]: Failed to start LSB: Apache2 web server. Jun 12 05:49:53 yathartha-inspiron systemd[1]: apache2.service: Unit entered failed state. Jun 12 05:49:53 yathartha-inspiron systemd[1]: apache2.service: Failed with result 'exit-code'.

Что journalctl -u apache2 показал:

Jun 12 05:47:21 yathartha-inspiron systemd[1]: Time has been changed -- Subject: Time change -- Defined-By: systemd -- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel -- -- The system clock has been changed to REALTIME microseconds after January 1st, 1970. Jun 12 05:47:21 yathartha-inspiron systemd[1]: snapd.refresh.timer: Adding 5h 39min 46.253658s random time. Jun 12 05:47:21 yathartha-inspiron systemd[1]: apt-daily.timer: Adding 1h 20min 25.260017s random time. Jun 12 05:49:53 yathartha-inspiron sudo[9466]: yathartha : TTY=pts/1 ; PWD=/home/yathartha ; USER=root ; COMMAND=/etc/init.d/apache2 restart Jun 12 05:49:53 yathartha-inspiron sudo[9466]: pam_unix(sudo:session): session opened for user root by (uid=0) Jun 12 05:49:53 yathartha-inspiron systemd[1]: Stopped LSB: Apache2 web server. -- Subject: Unit apache2.service has finished shutting down -- Defined-By: systemd -- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel -- -- Unit apache2.service has finished shutting down. Jun 12 05:49:53 yathartha-inspiron systemd[1]: Starting LSB: Apache2 web server... -- Subject: Unit apache2.service has begun start-up -- Defined-By: systemd -- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel -- -- Unit apache2.service has begun starting up. Jun 12 05:49:53 yathartha-inspiron apache2[9478]: * Starting Apache httpd web server apache2 Jun 12 05:49:53 yathartha-inspiron apache2[9478]: * Jun 12 05:49:53 yathartha-inspiron apache2[9478]: * The apache2 configtest failed. Jun 12 05:49:53 yathartha-inspiron apache2[9478]: Output of config test was: Jun 12 05:49:53 yathartha-inspiron apache2[9478]: apache2: Syntax error on line 140 of /etc/apache2/apache2.conf: Syntax error on line 2 of /et Jun 12 05:49:53 yathartha-inspiron apache2[9478]: Action 'configtest' failed. Jun 12 05:49:53 yathartha-inspiron apache2[9478]: The Apache error log may have more information. Jun 12 05:49:53 yathartha-inspiron systemd[1]: apache2.service: Control process exited, code=exited status=1 Jun 12 05:49:53 yathartha-inspiron systemd[1]: Failed to start LSB: Apache2 web server. -- Subject: Unit apache2.service has failed -- Defined-By: systemd -- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel -- -- Unit apache2.service has failed. -- -- The result is failed. Jun 12 05:49:53 yathartha-inspiron systemd[1]: apache2.service: Unit entered failed state. Jun 12 05:49:53 yathartha-inspiron systemd[1]: apache2.service: Failed with result 'exit-code'. Jun 12 05:49:53 yathartha-inspiron sudo[9466]: pam_unix(sudo:session): session closed for user root Jun 12 05:51:28 yathartha-inspiron org.gnome.evolution.dataserver.Sources5[1582]: ** (evolution-source-registry:1869): WARNING **: secret_servi lines 1602-1643/1643 (END)

Я не могу понять, что может быть ошибкой, кто-нибудь может помочь мне.

2
задан 12 June 2017 в 03:25

2 ответа

Поскольку сообщение Cannot load /usr/lib/apache2/modules/libphp7.0.so into server предположило, что ваш mod_php может быть поврежден / отсутствует / случайно удален / etc. Попробуйте запустить sudo apt-get install --reinstall libapache2-mod-php7.0, чтобы переустановить пакет, а затем снова перезапустите apache.

0
ответ дан 18 July 2018 в 11:49

Поскольку сообщение Cannot load /usr/lib/apache2/modules/libphp7.0.so into server предположило, что ваш mod_php может быть поврежден / отсутствует / случайно удален / etc. Попробуйте запустить sudo apt-get install --reinstall libapache2-mod-php7.0, чтобы переустановить пакет, а затем снова перезапустите apache.

0
ответ дан 24 July 2018 в 19:51

Другие вопросы по тегам:

Похожие вопросы: