无论出于什么原因,我设法搞砸了Apache相当糟糕(Ubuntu 12.04)。 下面的输出抱怨configtest失败和分段错误。 但是,我在/var/log/apache2/error.log找不到任何东西。 我怎样才能debugging这个“configtest”?
jeroen@jeroen-ubuntu:~$ sudo service apache2 stop * Stopping web server apache2 * The apache2 configtest failed, so we are trying to kill it manually. This is almost certainly suboptimal, so please make sure your system is working as you'd expect now! ... waiting [ OK ] jeroen@jeroen-ubuntu:~$ sudo service apache2 start * Starting web server apache2 Segmentation fault Action 'start' failed. The Apache error log may have more information. [fail]
编辑:这个问题与apache2模块的加载有关。 我在/var/log/kern.log发现了一些问题的痕迹:
Mar 14 20:44:27 jeroen-ubuntu kernel: [13267.367260] show_signal_msg: 9 callbacks suppressed Mar 14 20:44:27 jeroen-ubuntu kernel: [13267.367264] apache2[20784]: segfault at b638f7b5 ip b638f7b5 sp b5ed42e0 error 14 Mar 14 20:44:27 jeroen-ubuntu kernel: [13267.367268] apache2[20786]: segfault at b638f7b5 ip b638f7b5 sp b383f2e0 error 14
我一直在使用这个模块多年,它一直是稳定的。 我最近一直在从PPA存储库安装一些backports,我怀疑这些软件包中有一个坏了我的系统…
如果configtest失败了,那不是什么configtest事情。 这基本上意味着你的Apacheconfiguration文件中有一些东西是拧紧的。 所以这是我应该做的事情的清单:
/etc/apache2/apache2.conf或/etc/apache2/sites-enabled的主要configuration? 如果是在主configuration文件中,它会显示在错误error.log更经常没有? 如果没有,也许在一个单独的日志连接到您的虚拟主机? sudo apachectl -S ? 这可能会给出另外一个关于Apache正在使用的configuration的线索。 /etc/apache2从系统中删除Apache并重新安装它干净。 然后看看干净的安装是否工作,如果它,然后根据备份文件重做您的configuration。 谢谢,在安装PHP 7之后,问题就发生了,并且添加了一些安静的包。
经过一番研究发现/etc/apache2/mods-enabled/php5.load指向一个早期被删除的软件包,或者无法用apache启动加载。 刚刚删除的内容,它开始工作。