FIX: ModSecurity: Output filter: Response body too large (over limit of 524288, total not specified)

Lately, I’ve been getting some Internal Server Errors (500) on my WordPress sites whenever I tend to use things like Visual Composer, Live Composer and so on. Checking the Cpanel error logs doesn’t seem to help so I tend to tail the Apache error logs. This is what I will encounter:

ModSecurity: Output filter: Response body too large (over limit of 524288, total not specified)

The first thing that I will do is to disable ModSecurity for the domain that I’m working on either via Mod Security configuration file or using Configserver ModSec Control for Cpanel. A restart of the Apache service (httpd) should fix it. But, did it? NO!

What could have possible went wrong? Despite ModSecurity being disabled for that domain, how come it’s still showing some ModSecurity related errors? Apparently, the best thing to do here is to increase the ResponseBodyLimit directly within the Apache configuration file itself.

    1. Go to Apache configuration file
       
       
      1. vi /usr/local/apache/conf/httpd.conf

       

    2. Search for the domain’s virtual host entry in that file. Then, within <VirtualHost Domain/IP>, add the following:
       
       
      1. <IfModule mod_security2.c>
      2. SecResponseBodyLimit 546870912
      3. </IfModule>
    3. Save the Apache configuration file, then execute ‘service httpd restart’ to restart the Apache service and for the changes to take effect.
    4. Refresh your WordPress site/page that produced the error initially and voila, it should work now!

Comments

comments

1 Comment

  1. Thank you man it worked like a charm

Leave a Reply

Your email address will not be published. Required fields are marked *

© 2020 Viknea.com

Theme by Anders NorénUp ↑

Close
"