Invalid command 'SecRuleEngine'

I have just installed SuSE 11.1. When I try to start Apache 2 from the command line I get the following:

Starting httpd2 (prefork) Syntax error on line 2 of /etc/apache2/conf.d/mod_security2.conf:
Invalid command ‘SecRuleEngine’, perhaps misspelled or defined by a module not included in the server configuration

When I try to install it using YAST I get the following

Cannot adjust ‘Apache2’ service

I have narrowed it down to ModSecurity. I have reinstalled all the Apache 2 apps and all the required libraries and modules. No luck. Is it something I am doing? Any help and advice you can offer would be greatly appreciated.

Thanks,
Bucciacas :question:

Add in the configuration file /etc/sysconfig/apache2
in the string APACHE_MODULES="…security2"
restart apache2

I had the exact same problem. I solved it by simply uninstalling that security2 thing.
Now it works.
If you can not live without that security2 thing, let us know how you solved it.

Hi all

I changed the setting in the /etc/sysconfig/apache like described in this thread. But still apache still didn’t start. I had to create a file named /srv/www/logs/modsec_debug.log with rwx 755 and now it works fine.

Have a nice day.

Carsten

I did that too, and…

[Sat Mar 28 23:27:56 2009] [notice] caught SIGTERM, shutting down
[Sat Mar 28 23:27:56 2009] [notice] ModSecurity for Apache/2.5.6 (ModSecurity: Open Source Web Application Firewall) configured.
[Sat Mar 28 23:27:57 2009] [notice] Apache/2.2.10 (Linux/SUSE) PHP/5.2.8 with Suhosin-Patch configured – resuming normal operations

It works! (Don’t know why, to be honest. 8^)
Harricot

Also log-directory should be created:

mkdir /srv/www/logs/

Man! that was silly
I had the same problem went around and around.
Comment all kinds of stuff.
Created the log folders and log files as recommended above…
still errors.
tried to disable the mods left and right…
Kept getting mod_* not installed.
Argh
Then I thought maybe I should try to install the mod_security2
a2enmod mod_security2
BAM!!!
Worked>:)