mod_security rules won't save

paulm

Well-Known Member
Oct 13, 2003
60
0
156
I started using mod_Security through cPanel which seemed to work fine for a few months. I just was updating rules on my servers and one server saved ok but two others just go to start saving and start to load a page as if it is saving but never actually saves.

Looked around and could not find anyone else having these issues here so I am hoping maybe someone has heard of this issue before.
 

jayh38

Well-Known Member
Mar 3, 2006
1,212
0
166
That is known to happen if your ruleset is is too long. Load a small ruleset to test.
 

paulm

Well-Known Member
Oct 13, 2003
60
0
156
jayh38 said:
That is known to happen if your ruleset is is too long. Load a small ruleset to test.
You are very right! Thanks for your reply.

It actually looks like if I use anything over 40-50 lines it will not save, my ruleset is about 600 lines long total, taking out comments I could probably get it down to about 500 but that is still not going to help me.

The way I had this running before was a manual install of mod_Security with a ruleset actually within the httpd.conf, I started having some issues with apache dropping after a particular cpanel upgrade a few months ago.

Now when I switched to cpanel modsecurity install through WHM these same rulesets(about 600 lines) saved without any problems and are now for some reason having issues.

Is there another way around this? Could I add my rules to modsec.conf (I believe this is the file) and chattr +i it so that cpanel will not overwrite it?
 

jayh38

Well-Known Member
Mar 3, 2006
1,212
0
166
Something is not quite right. All my installs are via whm addon and are at 511 lines including whitespace. I would try removing and reinstalling via the addon panel again.