Category Archives: CentOS

fail2ban.actions – ERROR Failed to start jail ‘apache-fakegooglebot’ action ‘firewallcmd-ipset’: Error starting action

Got this sh*t on my error logs…

firewall-cmd --direct --add-rule ipv4 filter INPUT 0 -p tcp -m multiport --dports http,https -m set --match-set fail2ban-apache-fakegooglebot src -j REJECT --reject-with icmp-port-unreachable -- killed with signal 124 (return code: 252)
2017-07-08 21:26:11,212 fail2ban.actions [3781]: ERROR Failed to start jail 'apache-fakegooglebot' action 'firewallcmd-ipset': Error starting action
2017-07-08 21:26:11,416 fail2ban.action [3781]: ERROR ipset create fail2ban-apache-modsecurity hash:ip timeout 6000
firewall-cmd --direct --add-rule ipv4 filter INPUT 0 -p tcp -m multiport --dports http,https -m set --match-set fail2ban-apache-modsecurity src -j REJECT --reject-with icmp-port-unreachable -- stdout: ''

Solution? Let’s set banaction to iptables! 🙂

# Override /etc/fail2ban/jail.d/00-firewalld.conf:
banaction = iptables-multiport

!!

centos – Error Summary – Disk Requirements – more space needed on the /boot filesystem

 

Error Summary
-------------
Disk Requirements:
 At least 3MB more space needed on the /boot filesystem.

[[email protected] pjrfigueiredo]# df -H /boot
Filesystem      Size  Used Avail Use% Mounted on
/dev/sda1       199M  156M   29M  85% /boot
[[email protected] pjrfigueiredo]# rpm -qa | grep kernel
kernel-tools-libs-3.10.0-514.16.1.el7.x86_64
abrt-addon-kerneloops-2.1.11-45.el7.centos.x86_64
kernel-tools-3.10.0-514.16.1.el7.x86_64
kernel-3.10.0-514.10.2.el7.x86_64
kernel-3.10.0-514.16.1.el7.x86_64
[[email protected] pjrfigueiredo]# rpm -e kernel-3.10.0-514.10.2.el7.x86_64
[[email protected] pjrfigueiredo]# df -H /boot
Filesystem      Size  Used Avail Use% Mounted on
/dev/sda1       199M  111M   74M  61% /boot

or…

sudo yum remove `rpm -q kernel | grep -v 'uname -r'`

The name org.freedesktop.PolicyKit1 was not provided by any .service files

 

[email protected]:~$ service mysql restart
Failed to restart mysql.service: The name org.freedesktop.PolicyKit1 was not provided by any .service files
See system logs and ‘systemctl status mysql.service’ for details.

 

[email protected]:~$ systemctl start deluged
Failed to start deluged.service: The name org.freedesktop.PolicyKit1 was not provided by any .service files
See system logs and ‘systemctl status deluged.service’ for details.

 

try do sudo!

CentOS – Enable the mod_proxy modules in the HTTPD

In our /etc/httpd/conf/httpd.conf lets see if we have the following lines on it.
Uncomment them or add them.

  1. LoadModule proxy_module modules/mod_proxy.so
    LoadModule proxy_balancer_module modules/mod_proxy_balancer.so
    LoadModule proxy_http_module modules/mod_proxy_http.so
    # Uncomment these to proxy FTP or HTTPS
    #LoadModule proxy_ftp_module modules/mod_proxy_ftp.so
    #LoadModule proxy_connect_module modules/mod_proxy_connect.so
    

 

PHP 5.6 on CentOS 7

This is how I managed to have PHP 5.6 on a fresh CentOS 7.

yum install epel-release
rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm
yum clean
yum update

Then…

yum install php56w php56w-opcache php56w-mcrypt php56w-pdo php56w-mysql php56w-mbstring php56w-gd php56w-dom

 

ImageMagick

yum install ImageMagick php56w-imagick

 

Restart httpd

service httpd restart

Can’t locate CGI/Carp.pm in @INC & Can’t locate LWP/Simple.pm in @INC

 

[Thu Mar 09 02:23:43.435879 2017] [cgi:error] [pid 28444] [client 94.63.XXX.XXX:54192] AH01215: Can’t locate CGI/Carp.pm in @INC (@INC contains: /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) at /path/to/cgi/admin/admin.cgi line 31.

This solved my issue…

yum install perl-CGI

 

[Thu Mar 09 02:26:54.892385 2017] [cgi:error] [pid 28442] [client 94.63.XXX.XXX:54242] AH01215: [Thu Mar 9 02:26:54 2017] admin.cgi: [Thu Mar 9 02:26:54 2017] admin.cgi: Can’t locate LWP/Simple.pm in @INC (@INC contains: /path/to/cgi/admin/ /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) at ./shared/subs3.pm line 1003.
[Thu Mar 09 02:26:54.892456 2017] [cgi:error] [pid 28442] [client 94.63.XXX.XXX:54242] AH01215: [Thu Mar 9 02:26:54 2017] admin.cgi: [Thu Mar 9 02:26:54 2017] admin.cgi: BEGIN failed–compilation aborted at ./shared/subs3.pm line 1003.
[Thu Mar 09 02:26:54.892599 2017] [cgi:error] [pid 28442] [client 94.63.XXX.XXX:54242] AH01215: [Thu Mar 9 02:26:54 2017] admin.cgi: Compilation failed in require at /path/to/cgi/admin/admin.cgi line 151.

This solved my issue!

yum install perl-XML-Simple

 

PHP – It is not safe to rely on the system’s timezone settings.

Edit php.ini, mine, on CentOS 7 is located at /etc/php.ini.
Lets add the following line.

date.timezone = America/New_York

For other timezone take a look at http://www.php.net/manual/en/timezones.php

and then restart httpd

service httpd restart

If you don’t have access to the php.ini, here is another way to do it.
On our app/php…

if(!ini_get('date.timezone'))
{
    date_default_timezone_set('GMT');
}

as seen on http://stackoverflow.com/questions/16765158/date-it-is-not-safe-to-rely-on-the-systems-timezone-settings

😉