Mod_Security For WordPress
-
Okie, I think this is a common problem for all of us who are on a VPS or a Dedi. Mod Security does not play nice with WordPress and sometimes renders the site blank, generates error 500, kills comment posting and what not. On my blog Nokia Symbian Themes it have had some issues in the past and though I think I have fixed almost all of em – there may always be more. After searching the web I found bits n pieces everywhere but nothing that is regularly updated & tested to work.
Hence I am starting this thread so that anyone with issues with mod_security and wordpress can bank in this thread ?? for the solutions.
This is so far what I have included in my Mod_Security Custom/Whitelist setting which makes my site act kinda nicely so far:
<LocationMatch "/wp-admin/post.php"> SecRuleRemoveById 300015 300016 300017 950907 950005 950006 960008 960011 960904 SecRuleRemoveById phpids-17 SecRuleRemoveById phpids-20 SecRuleRemoveById phpids-21 SecRuleRemoveById phpids-30 SecRuleRemoveById phpids-61 </LocationMatch> <LocationMatch "/wp-admin/admin-ajax.php"> SecRuleRemoveById 300015 300016 300017 950907 950005 950006 960008 960011 960904 SecRuleRemoveById phpids-17 SecRuleRemoveById phpids-20 SecRuleRemoveById phpids-21 SecRuleRemoveById phpids-30 SecRuleRemoveById phpids-61 </LocationMatch> <LocationMatch "/wp-admin/page.php"> SecRuleRemoveById 300015 300016 300017 950907 950005 950006 960008 960011 960904 SecRuleRemoveById phpids-17 SecRuleRemoveById phpids-20 SecRuleRemoveById phpids-21 SecRuleRemoveById phpids-30 SecRuleRemoveById phpids-61 </LocationMatch> <LocationMatch "/wp-admin/options.php"> SecRuleRemoveById 300015 300016 300017 950907 950005 950006 960008 960011 960904 SecRuleRemoveById phpids-17 SecRuleRemoveById phpids-20 SecRuleRemoveById phpids-21 SecRuleRemoveById phpids-30 SecRuleRemoveById phpids-61 </LocationMatch> <LocationMatch "/wp-admin/theme-editor.php"> SecRuleRemoveById 300015 300016 300017 950907 950005 950006 960008 960011 960904 SecRuleRemoveById phpids-17 SecRuleRemoveById phpids-20 SecRuleRemoveById phpids-21 SecRuleRemoveById phpids-30 SecRuleRemoveById phpids-61 </LocationMatch> <LocationMatch "/wp-includes/"> SecRuleRemoveById 960010 960012 950006 SecRuleRemoveById phpids-17 SecRuleRemoveById phpids-20 SecRuleRemoveById phpids-21 SecRuleRemoveById phpids-30 SecRuleRemoveById phpids-61 </LocationMatch>
Some of these rules are WordPress Specific while some are plugin specific. Do you have anything else included that makes your wordpress & the plugins act nicely with Mod_Security? If yes, then please post it so that we can compile the ultimate mod_security and wordpress specific whitelist ruleset!
Cheers!
Btw on my VPS – Running WP 3.03, Apache 2.2, CSF Firewall and E-Accelerator with PHP 5.2.
- The topic ‘Mod_Security For WordPress’ is closed to new replies.