- How to Block Traffic by Country in the CSF Firewall
- How to Allow Traffic by Country in the CSF Firewall
- How to Block Ports by Country in CSF
- Basic DoS/DDoS Mitigation with the CSF Firewall
- How to Back up and Restore the CSF Firewall Configuration
Prior to making direct edits to the firewall configuration file or changing advanced firewall settings in WHM, a backup of the current configuration should be taken so that the settings can quickly and easily be reverted if needed.
Pre-Flight Check
- This series assumes you have the ConfigServer Firewall (CSF) installed on your cPanel server, and you have access to WebHost Manager (WHM).
- If your server currently uses APF but you’d prefer CSF, contact Heroic Support® and request a switch. There is no charge, it typically takes only a few minutes, and the only service that needs to be restarted as a result is the firewall itself. Our support technicians also can port your existing APF rules to CSF. If requesting an upgrade, please be sure to indicate whether your server uses the Guardian backup service so that its rules also can be configured.
How to Back up the Firewall Configuration
Step #1:
In WebHost Manager, locate and select ConfigServer Security & Firewall under the Plugins section in the left menu. You also can begin typing “fire” into the search field at the top left to narrow down the options.
Step #2: Open and Back up the Profile
- Scroll down to the csf - ConfigServer Firewall section and click the Firewall Profiles button.
- On the Firewall Profiles page, scroll down to the Backup csf.conf section, enter a name to identify the backup and click the Create Backup button.
- The next screen will show you the location of the backup file, which you’ll want to note in case you need to restore.
How to Restore a Saved Configuration
Step #1: Open the Firewall Plugin in WHM
In WebHost Manager, locate and select ConfigServer Security & Firewall under the Plugins section in the left menu. You also can begin typing “fire” into the search field at the top left to narrow down the options.
Step #2: Open and Restore the Saved Backup
- Scroll down to the csf - ConfigServer Firewall section and click the Firewall Profiles button.
- On the Firewall Profiles page, scroll down to the Restore Backup Of csf.conf section and click on the name of the desired backup.
- Click the Restore Backup button.
- On the next screen, click the Restart csf+lfd button to restart the firewall with the settings from the backup file.
Next Steps
Now that you’re familiar with backing up and restoring a firewall configuration file, you’re ready to explore some of CSF’s advanced features. See Part Two: How to Block by Country in the CSF Firewall.
Related Articles:
- Using MySQL Command Line to Create a User
- How to Use Disk Quotas in Dedicated Linux Servers With cPanel
- How to Use Disk Quotas in Dedicated Linux Servers with Plesk
- Remove a MySQL User on Linux via Command Line
- Remove Permissions for a MySQL User on Linux via Command Line
- Grant Permissions to a MySQL User on Linux via Command Line

About the Author: dpepper
Our Sales and Support teams are available 24 hours by phone or e-mail to assist.
Latest Articles
How to Install Apache Tomcat on Linux (AlmaLinux)
Read ArticleWhat is CentOS? Everything You Need to Know
Read ArticleWhat is CentOS? Everything You Need to Know
Read ArticleRedis as Cache: How It Works and Why You Should Use It
Read ArticleRefer-a-Friend Program for Website Hosting: Get $100 for Each Friend!
Read Article