Take the 2-minute tour ×

So I've been trying to setup mod security now on our dev server for a few days now, and with certain rules it causes apache to hang when it restarts.

An example of a rule that causes it to hang:

SecRule REQUEST_HEADERS:Content-Type "text/xml" \

(btw this rule is from modsecurity.conf-recommended

An example of a rule, that if no other rules that make it hang are present, works:

SecRule ARGS "\.\./" "t:normalisePathWin,id:99999,severity:2,msg:'Drive Access',phase:1,deny,status:400"

Our server setup is such:

Debian 6 "Squeeze"
Apache 2.2.22 (Binary install located in /usr/local/apache2)
Mod security 2.7.2 (located in /usr/local/modsecurity)

I have made sure all the dependencies are installed and at the correct versions (libxml2, mod_unique_id, etc...)

Nothing shows up in the logs, and nothing errors on screen, it just hangs and does not actually restart

modifying modsecurity.c and mod_security2.c to print out information I can see it gets to pfn_register in the c application, but seems to screw up around there (still trying to pinpoint a location)

I really have no clue what else to check or do, I was able to set it up on my laptop rather quickly and without a problem. It's just on our actual server it screws up.

Any help would be appreciated!

share|improve this question
add comment

1 Answer

So Googeling like a mad man (I don't mean to sound like I wasn't before I submitted the question, but you know what I mean) I came across the answer. Or at least it appears so far to be working, and I can restart apache without it hanging

When configuring mod security use this command:

./configure --enable-pcre-study=no

I sincerely hope this helps someone else out in the future, because this has been driving me mad for the last few days.

share|improve this answer
add comment

Your Answer


