圣诞节快乐!
我正在设置 Ubuntu 12.04 网络服务器。因此我安装了 Apache2,还有 mod_security。我编辑了有关 mod_security 的配置。昨天一切都运行正常。
今天我尝试重新启动 Apache,但失败并出现以下错误:
$ /etc/init.d/apache2 restart
Syntax error on line 2 of /etc/apache2/conf.d/DEADJOE:
Invalid command '***', perhaps misspelled or defined by a module not included in the server configuration
Action 'configtest' failed.
The Apache error log may have more information.
...fail!
我检查了 apache 错误日志,但在 syslog 中找不到任何相同内容。/etc/apache2/conf.d/DEADJOE 的内容是:
*** These modified files were found in JOE when it aborted on Mon Dec 23 14:48:44 2013
*** JOE was aborted because the terminal closed
*** File '(Unnamed)'
/etc/modsecurity/modsecurity.conf
/etc/apache2/mods-available/mod-security.conf
/etc/modsecurity/modsecurity.conf
/var/log/apache2/error.log
/etc/apache2/conf.d/modsecurity.conf
/etc/apache2
security
/etc/modsecurity/modsecurity.conf
/var/log/apache2/error.log
/etc/modsecurity/modsecurity.conf
/var/log/apache2/error.log
谢谢你的帮助!
托尼
答案1
看起来 joe 编辑器崩溃了,并产生了某种转储。将 /etc/apache2/conf.d/DEADJOE 移到其他地方(例如 /var/tmp),然后尝试重新启动。或者,您可以将 apache 配置为仅查找具有特定扩展名的配置文件
Include /etc/apache2/sites-available/*.conf