How to install CSF inside cPanel

Installation is quite straightforward:

cd /usr/src
rm -fv csf.tgz
tar -xzf csf.tgz
cd csf

Next, test whether you have the required iptables modules:

perl /usr/local/csf/bin/

Don't worry if you cannot run all the features, so long as the script doesn't
report any FATAL errors

You should not run any other iptables firewall configuration script. For
example, if you previously used APF+BFD you can remove the combination (which
you will need to do if you have them installed otherwise they will conflict):

sh /usr/local/csf/bin/

That's it. You can then configure csf and lfd by reading the documentation and
configuration files in /etc/csf/csf.conf and /etc/csf/readme.txt directly or
through the csf User Interface.

csf installation for cPanel and DirectAdmin is preconfigured to work on those
servers with all the standard ports open.

csf auto-configures your SSH port on installation where it's running on a non-
standard port.

csf auto-whitelists your connected IP address where possible on installation.

You should ensure that kernel logging daemon (klogd) is enabled. Typically, VPS
servers running RedHat/CentOS v5 have this disabled and you should check
/etc/init.d/syslog and make sure that any klogd lines are not commented out. If
you change the file, remember to restart syslog.

See the csf.conf and readme.txt files for more information.

Perl Modules

While most should be installed on a standard perl installation the following
may need to be installed manually:

# On rpm based systems:
yum install perl-libwww-perl.noarch perl-LWP-Protocol-https.noarch perl-GDGraph

# On APT based systems:
apt-get install libwww-perl liblwp-protocol-https-perl libgd-graph-perl

# Via cpan:
perl -MCPAN -eshell
cpan> install LWP LWP::Protocol::https GD::Graph



1. Enable csf in InterWorx > NodeWorx > Plugins > csf

2. See the InterWorx section in /etc/csf/readme.txt

Webmin Module Installation/Upgrade

To install or upgrade the csf webmin module:

Install csf as above
Install the csf webmin module in:
Webmin > Webmin Configuration > Webmin Modules >
From local file > /usr/local/csf/csfwebmin.tgz > Install Module

Removing csf and lfd is even more simple:

cd /etc/csf

  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

How to Empty / Delete files .trash folder cPanel users

The .trash folder in /home/$username/.trash contains any files that a user has deleted via their...

How to fix cPanel 500 internal server error

How to fix cPanel 500 internal server errorYou need to run the following command in SSH to fix...

How to fix YumRepo Error and Cannot find valid baseurl

When you try to update or install any software inside your centos 6/7 you might will see the...

How to install WordPress Toolkit inside cPanel/WHM

The WordPress Toolkit interface allows you to easily install, configure, and manage WordPress®....

How to install let's encrypt cpanel/WHM

We are here to guide to let you know how to install the let's encrypt plugin inside cpanel/whm...