Install Firewall on a cPanel Server

First, you would need to login as root via ssh, then as root issue the following commands:

wget http://www.configserver.com/free/csf.tgz
tar zxfv csf.tgz
cd csf
./install.cPanel.sh

Now the CSF establishment is finished and the arrangement document should suit your necessities, to alter the CSF setup issue this summons:

pico /etc/csf/csf.conf

Set the TESTING variable to 1 instead of and make sure that the MONOLITHIC_KERNEL variable is set to 1 this is important for OpenVZ VPS servers You may open/filter incoming and outgoing ports by editing the TCP_IN and TCP_OUT variables. Save your configuration by pressing CTRL + x, when asked press “y” then press the enter key

Now start CSF by issuing:

/etc/init.d/csf start