![apache2 未处于活动状态](https://linux22.com/image/1155100/apache2%20%E6%9C%AA%E5%A4%84%E4%BA%8E%E6%B4%BB%E5%8A%A8%E7%8A%B6%E6%80%81.png)
错误是什么?请给我完整的解决方案!谢谢)
sudo service apache2 status
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: inactive (dead) since Бс 2018-04-05 16:53:39 +06; 5s ago
Docs: man:systemd-sysv-generator(8)
Process: 5334 ExecStop=/etc/init.d/apache2 stop (code=exited, status=0/SUCCESS)
Process: 5317 ExecStart=/etc/init.d/apache2 start (code=exited, status=0/SUCCESS)
Сәу 05 16:53:39 moldir systemd[1]: Starting LSB: Apache2 web server...
Сәу 05 16:53:39 moldir apache2[5317]: * Starting Apache httpd web server apache2
Сәу 05 16:53:39 moldir apache2[5317]: Segmentation fault (core dumped)
Сәу 05 16:53:39 moldir apache2[5317]: Action 'start' failed.
Сәу 05 16:53:39 moldir apache2[5317]: The Apache error log may have more information.
Сәу 05 16:53:39 moldir apache2[5334]: * Stopping Apache httpd web server apache2
Сәу 05 16:53:39 moldir apache2[5334]: *
Сәу 05 16:53:39 moldir systemd[1]: Started LSB: Apache2 web server.
答案1
这可能不是一个完整的答案(虽然它太长而无法作为评论发布),因为您收到的错误是分段错误,如果没有更多信息就很难找出问题所在。
然而,我每次遇到这个问题最终都是由于一些冲突的模块造成的。
您可以通过运行以下命令检查 Apache 上启用了哪些模块:
apache2ctl -M
但是,此命令很可能会实际中断并给出以下输出:
Segmentation fault (core dumped)
Action '-M' failed.
The Apache error log may have more information.
如果是这种情况,您将需要使用以下命令:
ls /etc/apache2/mods-enabled/
确保没有相互冲突的模块,例如php5.6
和php7.0
,或mpm_event
和mpm_prefork
。
要禁用它们,请使用以下a2dismod <module_name>
命令。例如:
sudo a2dismod php5.6