On most CentOS 7 machines you might be getting this type of warnings when restarting or updating ConfigServer Firewall (CSF), if you are missing certain commands or packages on your server.
*WARNING* Binary location for [CHATTR] [/usr/bin/chattr] in /etc/csf/csf.conf is either incorrect, is not installed or is not executable *WARNING* Missing or incorrect binary locations will break csf and lfd functionality *WARNING* URLGET set to use LWP but perl module is not installed, reverting to HTTP::Tiny
You also might be getting notifications in mail from your Cron Daemon with subject /usr/sbin/csf -u and following message:
*WARNING* URLGET set to use LWP but perl module is not installed, reverting to HTTP::Tiny
This warnings are showing because of missing packages not being installed on the server, and
chattr command doesn’t exist.
[[email protected] ~]# type chattr -bash: type: chattr: not found
To resolve CHATTR warning, you need to install e2fsprogs with
yum -y install e2fsprogs
To resolve URLGET warning you need to install perl-libwww-perl with
yum -y install perl-libwww-perl with
If you are getting following warning by mail notifications, or when running
csf -u, you are missing perl-LWP-Protocol-https package.
[[email protected] ~]# csf -u Oops: Unable to download: Protocol scheme 'https' is not supported (LWP::Protocol::https not installed)
Install perl-LWP-Protocol-https with:
yum -y install perl-LWP-Protocol-https
You might also be getting a following warning, if you don’t have
unzip commands installed on your server.
*WARNING* Binary location for [UNZIP] [/usr/bin/unzip] in /etc/csf/csf.conf is either incorrect, is not installed or is not executable *WARNING* Binary location for [HOST] [/usr/bin/host] in /etc/csf/csf.conf is either incorrect, is not installed or is not executable
To resolve HOST warning, you needs to install bind-utils package with
yum -y install bind-utils
To resolve UNZIP warning you need to install unzip package with
yum -y install unzip
tl;dr required packages for CSF
If you are getting any kind of warnings when doing
csf -r on CentOS 7 server make sure you have following packages installed.
Needed packages can be installed with following commands:
yum -y install iptables-services yum -y install unzip yum -y install bind-utils yum -y install perl-libwww-perl yum -y install e2fsprogs yum -y install perl-LWP-Protocol-https