Wednesday, June 1, 2016

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





Firstly check your apache error log, If you are  getting the following error:

=====================================
[Thu Feb 04 22:08:36 2016] [error] [client 116.202.181.214] ModSecurity: Output filter: Response body too large (over limit of 524288, total not specified). [hostname "example.sg"] [uri "/wp-admin/post-new.php"] [unique_id "VrNbY7Tw6W0AAEf@BuYAAAAD"]

[Thu Feb 04 22:08:44 2016] [error] [client 116.202.181.214] ModSecurity: Output filter: Response body too large (over limit of 524288, total not specified). [hostname "example.sg"] [uri "/wp-admin/post-new.php"] [unique_id "VrNba7Tw6W0AAEhuMh0AAAAI"]
 =====================================

It was due the ModSecurity over limit, So we have to increase the limit of that  domain.

Go to your server Apache configuration file

vi /usr/local/apache/conf/httpd.conf
find the domain’s virtual host entry

Add the following lines inside virtualhost entry

<VirtualHost Domainname/IP>
<IfModule mod_security2.c>
    SecResponseBodyLimit 549658718
  </IfModule>
</VirtualHost>
Save and exit, It will fix the issue....
 

Friday, January 15, 2016

Name or service not known: mod_unique_id: unable to find IPv4 address of "-" Configuration Failed


Name or service not known: mod_unique_id: unable to find IPv4 address of "-" Configuration Failed



root@- [~]# /etc/init.d/httpd restart
httpd not running, trying to start
root@- [~]# tail -f /usr/local/apache/logs/error_log

[Tue Jan 12 20:19:33 2016] [alert] (EAI 2)Name or service not known: mod_unique_id: unable to find IPv4 address of "-"
Configuration Failed
[Tue Jan 12 20:21:52 2016] [alert] (EAI 2)Name or service not known: mod_unique_id: unable to find IPv4 address of "-"
Configuration Failed


I have checked the Apache configuration syntax file and it was fine.
 


root@- [~]# httpd -t
Syntax OK


checking the file “/etc/hosts” the server hostname was incorrect. After correcting the Apache service was working fine.
 




iptables-restore : iptables-restore: unable to initialize table 'mangle'




iptables-restore: unable to initializetable ‘mangle’



If you’re getting the following error on your server, iptables update might have caused this issue.
 
=====================


[root@mon ~]# /etc/init.d/iptables start
iptables: Applying firewall rules: FATAL: Module ip_tables not found.
iptables-restore v1.4.7: iptables-restore: unable to initialize table 'mangle'

Error occurred at line: 2
Try `iptables-restore -h' or 'iptables-restore --help' for more information.

====================



To resolve this, check the output of iptables -L if that gives any output, save it using following command and then restart iptables as shown below.
Saving iptables rules:

[root@mon ~]# iptables -L
Chain INPUT (policy ACCEPT)
target     prot opt source               destination        

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination        

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination         

[root@mon ~]# iptables-save > /etc/sysconfig/iptables

[root@mon ~]#  /etc/init.d/iptables restart
iptables: Setting chains to policy ACCEPT: filter          [  OK  ]
iptables: Flushing firewall rules:                         [  OK  ]
iptables: Unloading modules:                               [  OK  ]
iptables: Applying firewall rules:                         [  OK  ]

 



The issue has been sorted out. It removed the unsupported rules from iptables list.