Author Topic: ModSecurity:if Response body too large Soluation  (Read 17928 times)

0 Members and 1 Guest are viewing this topic.

Offline
*
ModSecurity:if Response body too large Soluation
« on: January 19, 2016, 10:56:30 AM »
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:-

Code: [Select]
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

Code: [Select]
SecResponseBodyLimit 546870912
SecRequestBodyInMemoryLimit 546870912

SAVE

AND NOW IN  RESTART APACHE  OR IN YOUR PUTTY  TERMINAL RUN THIS COMMNAD
Code: [Select]
service httpd restart
« Last Edit: January 28, 2016, 03:24:06 PM by iqbalthakur »
THAKUR