Installing CSF (ConfigServer Security & Firewall)

The CSF, ConfigServer Security & Firewall, is a powerful firewall that is made for Linux systems. It comes with an easy to use CLI (Command Line Interface) and integrates with DirectAdmin and cPanel control panels as a graphical user interface (GUI) that is just as powerful as it's CLI counterpart. Installing CSF is easy but as with making changes to any server, if you do not know what you are doing, you can cause damage. If you are unfamiliar with using the command line interface via SSH, we recommend contacting our sales department to get an installation quote.

Note that this tutorial was written for Linux systems running a RedHat variant such as RHEL or CentOS. If you are using a different Linux flavor, you may need to adapt certain commands to work with your system. As with all our tutorials, this is written as-is and comes with no warranty or support what so ever. Should you rather Mean Servers install CSF for you, please contact the sales department for a quote.

Installing CSF

1.) Login to your server via SSH.

2.) Obtain the latest CSF package directly from ConfigServer by running: wget https://download.configserver.com/csf.tgz

3.) Untar the downloaded package by running: tar -xvzf csf.tgz

4.) Change directories to the newly created csf directly by running: cd csf/

If you are installing on a DirectAdmin system, proceed to Step 5-DA. If you are installing on a cPanel system, proceed to Step 5-CP. If you are installing on a Linux system without a control panel, proceed to Step 5-NP.

5-DA.) Run the following command: ./install.directadmin.sh

5-CP.) Run the following command: ./install.cpanel.sh

5-NP.) Run the following command: ./install.sh

6.) CSF has now been installed. If you wish to add the graphing ability, run the following command: yum install perl-GDGraph

7.) CSF now needs to be configured, which is beyond the scope of this article. Luckily, CSF is pretty much self explanatory when using either the CLI or GUI. Just read the instructions or hints if you are unsure what the purpose of a certain function is.

You can configure CSF via CLI or the GUI when using DirectAdmin/cPanel and the CLI if you do not have a control panel installed. The DirectAdmin GUI is located at the Admin Level under Extra Features titled ConfigServer Firewall&Security. In cPanel, the CSF GUI is available from the left handed menu, just search for ConfigServer Firewall&Security. If you are using the CLI, you can access CSF by running csf from command line. Running csf will show you a list of available commands along with helpful hints.

**Important**: Do not forget to whitelist your IP address and take CSF out of test mode once you have tested your settings to ensure they work as you expected. Being locked out of CSF is quite common, if you end up getting locked out, you will need to login via VNC if on a VPS or IPMI when on a dedicated server. Mean Servers does not provide assistance for lockouts unless you are an enterprise client, it is important that you whitelist your IP address and test your settings to ensure the system won't lock you out by accident.
  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

Setup Your Own Private VPN with PPTP

PPTP VPN IntroductionTired of being geo blocked and not being able to watch your favorite TV...

Protect DirectAdmin from Brute Force Attacks

A common method of gaining access over a server is to use a technique called a brute force...

Changing Your Server's Time Zone

Changing the time zone that your server is set to is relatively simple and straight forward. In...

Synchronizing Your Server's Clock

Synchronizing your server's clock is not very difficult as there is a program that can be ran by...

CSF Error: *WARNING* URLGET set to use LWP but perl module is not installed, reverting to HTTP::Tiny

A common error clients come across after initially installing the Cnfig Server Security and...