阅读面临的错误列表Apache 启动
root@siddhant-VirtualBox:/home/siddhant# systemctl status apache2.service
● apache2.service - The Apache HTTP Server
Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset: enabled)
Drop-In: /lib/systemd/system/apache2.service.d
└─apache2-systemd.conf
Active: failed (Result: exit-code) since Wed 2018-07-11 17:06:57 IST; 36s ago
Process: 26248 ExecStop=/usr/sbin/apachectl stop (code=exited, status=1/FAILURE)
Process: 26675 ExecStart=/usr/sbin/apachectl start (code=exited, status=1/FAILURE)
Main PID: 21162 (code=exited, status=0/SUCCESS)
Jul 11 17:06:57 siddhant-VirtualBox systemd[1]: Starting The Apache HTTP Server...
Jul 11 17:06:57 siddhant-VirtualBox apachectl[26675]: apache2: Syntax error on line 151 of /etc/apache2
Jul 11 17:06:57 siddhant-VirtualBox apachectl[26675]: Action 'start' failed.
Jul 11 17:06:57 siddhant-VirtualBox apachectl[26675]: The Apache error log may have more information.
Jul 11 17:06:57 siddhant-VirtualBox systemd[1]: apache2.service: Control process exited, code=exited st
Jul 11 17:06:57 siddhant-VirtualBox systemd[1]: apache2.service: Failed with result 'exit-code'.
Jul 11 17:06:57 siddhant-VirtualBox systemd[1]: Failed to start The Apache HTTP Server.
答案1
启用并安装 MPM 文件并重新启动 apache 后,我发现我的主机没有错误。
sudo a2enmod mpm_prefork
service apache2 restart