【发布时间】:2018-09-01 13:10:49
【问题描述】:
好的,所以,我对 Apache 还很陌生:我试图创建一个本地网站(在 sites-available 文件夹中创建了 .conf 文件,在 var/www/mysite/ 等中创建了该文件夹)然后,我停止了 Apache(使用 systemctl stop apache2.service)但现在如果我尝试重新启动(systemctl restart apache2.service)它会抛出这个错误:
apache2.service 的作业失败,因为控制进程以 >error 代码退出。详见“systemctl status apache2.service”和“journalctl -xe”。
这是 journalctl -xe 的结果:
Mar 22 16:33:13 user-xxx apache2[10403]: * Starting Apache httpd web server apach
Mar 22 16:33:13 user-xxx apache2[10403]: *
Mar 22 16:33:13 user-xxx apache2[10403]: * The apache2 configtest failed.
Mar 22 16:33:13 user-xxx apache2[10403]: Output of config test was:
Mar 22 16:33:13 user-xxx apache2[10403]: apache2: Syntax error on line 140 of /etc/apache2/apache2.conf:
Mar 22 16:33:13 user-xxx apache2[10403]: Action 'configtest' failed.
还有 /etc/apache2/apache2.conf 中的第 140 行:
# Include module configuration:
IncludeOptional mods-enabled/*.load <--This one
IncludeOptional mods-enabled/*.conf
所以我尝试了:
sudo apt-get install libapache2-mod-php
我得到:
libapache2-mod-php is already the newest version (1:7.2+60+ubuntu16.04.1+deb.sury.org+1).
我还尝试了什么:删除 Apache 并再次安装,安装灯 (sudo apt-get install lamp-server^)。 我已经从 available.sites 中删除了:mysite.conf ...
似乎没有任何效果,我不断收到“apache2.service 的作业失败”。
【问题讨论】:
标签: apache configuration linux-mint