CSF (ConfigServer Security & Firewall) is an important tool for secured  and managing your server and generally more advanced firewall options its support to cPanel/WHM, DirectAdmin and Webmin.

Before beginning, install CSF firewall required dependencies

yum install perl-libwww-perl

CSF is a free packages to download using wget command and install in your system,
 
# wget  http://configserver.com/free/csf.tgz

# tar  zxvf  csf.tgz

# cd  csf

As there are two types of installing  scripts available in folder,

If you are running a cPanel in your server:
 
#  ./install.cpanel.sh

If you are running a non-cpanel in your server:
 
# ./install.sh

Next, test whether you have the required iptables modules:
 
#  perl /etc/csf/csftest.pl
Testing ip_tables/iptable_filter...OK
Testing ipt_LOG...OK
Testing ipt_multiport/xt_multiport...OK
Testing ipt_REJECT...OK
Testing ipt_state/xt_state...OK
Testing ipt_limit/xt_limit...OK
Testing ipt_recent...OK
Testing xt_connlimit...OK
Testing ipt_owner/xt_owner...OK
Testing iptable_nat/ipt_REDIRECT...OK
Testing iptable_nat/ipt_DNAT...OK

RESULT: csf should function on this server

If you required to update configuration in cPanel/WHM services. Let’s disable testing mode in main CSF configure file.
 
# vi /etc/csf/csf.conf

# # lfd will not start while this is enabled
TESTING = "1"
change to
TESTING = "0"

Once the installation process has complete, to enable CSF/LFD run the below command,
 
#/etc/init.d/csf restart
or
# csf -e

Disable the CSF service
# csf  -x

Restart the CSF service
# csf –r

Update the CSF 
# csf –u

Do you want to uninstalling CSF/LFD from server,
 
./etc/csf/uninstall.sh

Uninstalling csf and lfd...
Flushing chain `INPUT'
Flushing chain `FORWARD'
...