• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
NameHero Blog

NameHero Blog

Web Hosting Tips & Resources From NameHero

  • Hosting
    • Web Hosting
    • VPS Hosting
    • WordPress Hosting
    • WooCommerce Hosting
  • Reseller
  • Enterprise
  • Domains
  • Account
  • Blog Home
  • Categories

How To Remove The Country Code Filters Error In CSF

Bhagwad Park

Published on: November 15, 2021

Categories: VPS Hosting 0

By default, all NameHero VPS servers come installed with the ConfigServer Security & Firewall (csf) plugin. But if you don’t have it on your server, I strongly suggest that you install it. It’s invaluable. After setting up the CSF firewall on your VPS server, you might see a message in the CSF logs talking about country code filters like this:

Country Code Filters Error in CSF
Country Code Filters Error in CSF

The full error reads:

"CC Error: Country Code Filters setting MM_LICENSE_KEY must be set in /etc/csf/csf.conf to continue using the MaxMind database"

This error isn’t particularly serious, but it does tend to clog up the csf logs unnecessarily. In this tutorial, I’ll show you how to get rid of this annoying error, so you can more clearly see what’s going on with other things.

The MaxMind Database Needs a License Key to Download

MaxMind is a company that provides IP analytics, and CSF used to regularly use it to download publicly available databases that let them filter traffic based on which country the IP addresses were coming from. Previously, this database used to be publicly available for everyone to download, but because of some changes to the California Consumer Privacy Act (CCPA), they now require users to sign up for free and generate a license key for database access.

Personally, I can easily filter country-based traffic thanks to Cloudflare’s firewall, but CSF also filters out traffic when attackers access your server directly through your IP instead of just through Cloudflare. So you might still find a use for country-level blocking at the server level.

1. Signing up For a New MaxMind Account

The process is relatively simple. First, disable any VPN you might be using and access MaxMind’s sign up page here: https://www.maxmind.com/en/geolite2/signup

2. Generate the MaxMind License Key

After sign-up, confirm your e-mail ID, and then log into your dashboard. Click the “Generate New License Key” button. Now when it asks you if the key will be used for GeoIP Update, select “No” as shown here:

No GeoIP Update
No GeoIP Update

Click “Confirm”, and the system will display your MaxMind license key as shown here:

Copy the MM License Key
Copy the MM License Key

YOU CANNOT GET THIS KEY BACK! So make sure that you copy it somewhere else. MaxMind will only store the hashed key and they won’t be able to tell you what it was even if they wanted to. It’s the same way that passwords are stored in databases.

3. Enter the License Key into CSF

Log into your server dashboard and go to the CSF plugin. Scroll down till you find the button for the firewall configuration:

CSF Firewall Configuration
CSF Firewall Configuration

Click this. On the next page, search for the following key:

MM_LICENSE_KEY

And paste in the value you got from Step 2 like this:

Insert the MM License Key
Insert the MM License Key

And you’re done!

Step 4: Save your Changes and Restart CSF

Once you’ve pasted the above value, scroll down to the bottom and click the “Change” button. And on the next screen, you’ll see an option to restart. Click that, and you won’t see any more country code error messages in the CSF logs!

Bhagwad Park Profile Picture
Bhagwad Park

I’m a NameHero team member, and an expert on WordPress and web hosting. I’ve been in this industry since 2008. I’ve also developed apps on Android and have written extensive tutorials on managing Linux servers. You can contact me on my website WP-Tweaks.com!

Reader Interactions

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Primary Sidebar

Follow & Subscribe

Exclusive promos, content and more!

Most Popular Posts

Speed up your site: solving the WordPress slowdown

NameHero’s Recommended WordPress Plugin and Theme Setup (2023)

How To Increase The InnoDB Buffer Pool Size

How To Fix A Stuck All-in-One WP Migration Import

How To Add A Subdomain In Cloudflare

Top Categories

  • WordPress
  • Website Performance
  • Web Hosting
  • Resellers
  • Website Development
  • Website Security
  • VPS Hosting
  • SEO Tips
  • Announcements
  • Domain Registration
NameHero

NameHero proudly provides web hosting to over 40,000 customers with 99.9% uptime to over 750,000 websites.

  • Master Card
  • Visa
  • American Express
  • Discover
  • Paypal
Products
  • Web Hosting
  • VPS Hosting
  • WordPress Hosting
  • WooCommerce Hosting
  • Reseller Hosting
  • Enterprise Hosting
  • Domains
Help & Support
  • NameHero Blog
  • Knowledgebase
  • Announcements
  • Affiliates
Company
  • About Us
  • Contact Sales
  • Reviews
  • Uptime
  • We're Hiring

Copyright © 2023 NameHero, LLC. All rights reserved.

  • Privacy Policy
  • Terms of Use
  • Acceptable Use Policy
  • Payment Policy
  • DMCA