Bobcares

How we configure CSF firewall in Webmin and fix related errors

by | Aug 9, 2019

Protecting the server from malicious attack at any cost is one of the primary needs of server owners.

CSF offers an effective way to prevent unauthorized server access and it detects intrusion easily.

Luckily, control panels like Webmin offer a user-friendly interface to set up a CSF firewall. But, to make it work, we need to configure CSF.

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.

While installing the CSF, it helps to control inbound and outbound traffic from existing connections. Therefore, it is worth to install CSF on the server to enhance server security.

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.

perl /etc/csf/csftest.pl

5. Next, we login into the Webmin control panel and go to Webmin > Webmin Configuration > Webmin Modules.

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

From our experience in managing servers, we’ve seen customers facing problems while installing and configuring CSF 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.

Here, one of our customers had an error while restarting the CSF service. He got an 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.

csf -r

That solved the problem with firewall.

[Having difficulty in installing CSF firewall in Webmin? We’ll fix it for you.] 

 

Conclusion

In short, CSF is a firewall that helps to protect the server from malicious attacks. Today, we saw how our Support Engineers set up the CSF firewall in Webmin and fix related errors.

PREVENT YOUR SERVER FROM CRASHING!

Never again lose customers to poor server speed! Let us help you.

Our server experts will monitor & maintain your server 24/7 so that it remains lightning fast and secure.

GET STARTED

var google_conversion_label = "owonCMyG5nEQ0aD71QM";

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *

Never again lose customers to poor
server speed! Let us help you.