CSF offers an effective way to prevent unauthorized server access and it detects intrusion easily.
At Bobcares, we often get requests from our customers to install and configure the CSF firewall in Webmin as part of our Server Management Services.
Today, we’ll see how our Support Engineers set up CSF in Webmin and fix related errors.
How we install CSF firewall on Centos7 Webmin server
Before proceeding further, let’s have a quick look at CSF.
CSF is a firewall configuration script used to protect the server from malicious attack and provide better server security. Also, it helps to prevent public access to services and only allow certain connections to the server.
Here, let’s see how our Support Engineers install the CSF firewall on Centos7 Webmin server.
1. Initially, we SSH into the server as a root user.
2. We download and unpack the CSF package by using the following commands.
wget http://www.configserver.com/free/csf.tgz tar -xzf csf.tgz
3, Next, we switch to the CSF directory and run the install script too.
cd csf sh install.sh
4. Then, we ensure that the server has required iptables modules with the following command.
6. We select From local file filed and paste /etc/csf/csfwebmin.tgz in the same field.
7. Finally, we click on the Install Module button. And, restart the csf service.
That’s it. Now the CSF module in Webmin is ready to use.
How we fixed CSF install errors in Webmin
Now let’s see how our Support Engineers fix the top errors.
1. Bad Firewall configuration
Recently, one of our customers contacted us with a problem related to CSF firewall installation. After installing CSF on the Webmin server, he was getting an error while restating CSF. The error said,
csf: FASTSTART loading Packet Filter (IPv4) Error: FASTTART: (Packet Filter IPv4)  [iptables-restore: line 14 failed]. Try restarting csf with FASTSTART disabled, at line 4285
On checking, our Support Engineers found that the problem was due to bad settings in the firewall configuration.
Therefore, we solved the problem by tweaking the settings in the file csf.conf.
We edited the csf config fileat /etc/csf/csf.conf and disabled FASTSTART by changing FASTSTART = “1” to
FASTSTART = “0”.
This fixed the problem and CSF started working fine.
2. Missing Perl modules
Many customers may have problems because of missing Perl modules too. In order to run CSF properly, we need to install dependency Perl modules as well.
However, it is very easy to install the Perl modules on the server. Now, let’s see how our Support Engineers solved the error.
*WARNING* URLGET set to use LWP but perl module is not installed, reverting to HTTP::Tiny
So, we fixed the error by simply installing the Perl modules with the following command.
yum install perl-libwww-perl
Also, we restarted the CSF too.
That solved the problem with firewall.
[Having difficulty in installing CSF firewall in Webmin? We’ll fix it for you.]