Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have mod security2 in ubuntu 14.04 LTS server. I saw the below tutorial: http://blog.cherouvim.com/simple-dos-protection-with-mod_security/

The above sadly do not work on me apache error :

 * Restarting web server apache2                                                                                                                                            [fail] 
 * The apache2 configtest failed.
Output of config test was:
AH00526: Syntax error on line 226 of /etc/modsecurity/modsecurity.conf:
ModSecurity: No action id present within the rule
Action 'configtest' failed.

The Apache error log may have more information.

Can you recommend something similar?

Thnaks. :)

share|improve this question

1 Answer 1

https://launchpad.net/ubuntu/trusty/+source/modsecurity-apache

Ubuntu has ModSecurity 2.7+ which requires [1]

  • Added Rules must have ID action and must be numeric.

So best would be to add ID's to those rules and that will do the trick. For instance rule

SecRule ip:block "@eq 1" "phase:1,deny,log,logdata:'req/sec: %{ip.requests}, blocks: %{ip.blocks}',status:403"

should be

SecRule ip:block "@eq 1" "id:12345,phase:1,deny,log,logdata:'req/sec: %{ip.requests}, blocks: %{ip.blocks}',status:403"

Or some other ID which is not already used by some other rule.

[1] https://github.com/SpiderLabs/ModSecurity/blob/master/CHANGES

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.