How to install csf

How to install csf:

wget http://www.configserver.com/free/csf.tgz

tar zxvf csf.tgz
cd csf
./install.sh

To test all the iptable modules are available

./csftest.pl

If you are running apf_bfd firewall, it has to be removed for csf works

./remove_apf_bfd.sh

To configure csf config file to implement firewall as per our need

vi /etc/csf/csf.conf

TESTING = “1″
(We will change it to zero “0″ when we finished and sure we have configured correctly)

TCP_IN = “20,21,22,25,53,80,110,143,443,465,587,993,995″
TCP_OUT = “20,21,22,25,53,80,110,113,443″
UDP_IN = “20,21,53″
UDP_OUT = “20,21,53,113,123″
(Put your all ports which you want to be open on your server for incoming & outgoing traffic seperated by comma)

PORTFLOOD = “80;tcp;20;5″
(To protect your server any specific port from DOS attacks, you can define it in PORTFLOOD tag. By default its empty and i did like to limit 20 connections per 5 sec to port 80 (webserver))

After this save the file and restart the csf service

# /etc/init.d/csf start

If you completed with configuation and sure that every rules is implemented correctly then change Testing from 1 to 0 for run CSF permanently.

TESTING = “0″

and restart the service again to activate it

/etc/init.d/csf restart

Was this answer helpful?

 Print this Article

Also Read

How to install nginx

  How to install nginx Installing nginx on centOS by admin on Aug.16, 2010, under How to...

How to install zend Optimizer

  How to install zend Optimizer How to install zend Optimizer by admin on Aug.17, 2010, under...

Easy ruTorrent installer + Web server, FTP, Webmin (Ubuntu/Debian/Fedora/More)

All credit goes to Author brock from forums.rutorrent.org  original post here for reference also...

How to change the root password

How to change the root password Change root password: There are two kind of things we need to...

Vi Editor

vi editor : The VI editor is a screen-based editor used by many Unix users. The VI editor has...