New in CWP Edge-LatestFree with every CWPpro licenceWebsites up to 300x faster

CWP now includes LSPHP, LSAPI-Cache and CWP Cage at no extra cost with all CWPpro licences. The LSAPI-Cache plugin is integrated into our WordPress and other script installers, and CWP Cage gives every user complete isolation. Available now in the CWP Edge-Latest version.

Get CWPpro ›

ModSecurity:if Response body too large Soluation

Started by iqbalthakur, January 19, 2016, 10:56:30 AM

Previous topic - Next topic

iqbalthakur

If you are facing any internal server error in your website after enabling mod security  than most possibly that there is two issue
ONE OF THEM IS RESPONSE BODY TOO LARGE SOLUATION.
For Example :-
go in Centos Web Panel  CWP:- https://your Ip :2031/index.php?module=mod_security
and see........................

[Mon Jan 18 18:46:07 2016] [error] [client 192.168.1.1] ModSecurity: Output filter: Response body too large (over limit of 524288, total not specified). [hostname "example.com"] [uri "/website page path/post.php"] [unique_id "Vp15PX8AAAEAADPPMLAAAAAC"]

Than there is a Soluation for Centos Web Panel  CWP:-

open https://your IP :2031/index.php?module=file_editor&file=/usr/local/apache/conf.d/mod_security.conf
or /usr/local/apache/conf.d/mod_security.conf

YOU ARE MOST PRPROBABLY SEE THE FOLLOWING CODE:-

LoadFile /usr/lib/libxml2.so
LoadFile /usr/lib/liblua-5.1.so
LoadModule security2_module modules/mod_security2.so

<IfModule mod_security2.c>
SecPcreMatchLimit 1000000
SecPcreMatchLimitRecursion 1000000
SecDataDir logs/tmp
</IfModule>

ServerName *
AddDefaultCharset UTF-8
<IfModule mod_security2.c>
Include /usr/local/apache/modsecurity-crs/modsecurity_crs_10_config.conf
Include /usr/local/apache/modsecurity-crs/base_rules/*.conf
SecRuleEngine On
SecRequestBodyAccess On
SecResponseBodyAccess On
        Include /usr/local/apache/conf/mod_sec_disabled_rules.conf
</IfModule>


IN THIS CODE  .. SEE THE LAST 3RD LAST LINES AFTER

SecRequestBodyAccess On
SecResponseBodyAccess On

PUT THESE LINES

SecResponseBodyLimit 546870912
SecRequestBodyInMemoryLimit 546870912


SAVE

AND NOW IN  RESTART APACHE  OR IN YOUR PUTTY  TERMINAL RUN THIS COMMNAD
service httpd restart
THAKUR