How to category Design category Development category News category

How to Turn Off ModSecurity for a Site

This was copied from – here, I've posted this here for referance…

Question: My dedicated server is running ModSecurity, but one of the websites needs it turned off in order to operate correctly. How do I turn it off for just one site?

Answer: Before you proceed, keep in mind the reason you have ModSecurity installed in the first place. It is there to prevent security problems. Turning it off opens up that site and possibly even your server to attacks. The more practical approach would be to turn off certain features of ModSecurity to accommodate that site. By default, the restrictions are pretty stringent. You can ease some of them and still provide blanket security.

Nevertheless, if you insist on turning it off completely on a site, simply enter the following into an .htaccess file for ModSecurity 1:

<ifmodule mod_security.c>
SecFilterEngine Off
SecFilterScanPOST Off
</IfModule>

For ModSecurity 2, enter the following in the site’s virtual host section of the Apache configuration file:

<ifmodule mod_security2.c>
SecRuleEngine Off
</ifmodule>

Craig

Craig enjoys producing usable and friendly sites that look great and function well. He often also experiments with workflow automation and owns and runs web-engineer.
qr code

Leave a Comment

Your more than welcome to enter the discussion, all comments are moderated however - so please don't leave spam, it will be canned...