Problem with CSF

Post Reply
WOWHOST
Junior Member
Posts: 2
Joined: 25 Jul 2019, 12:04

Problem with CSF

Post by WOWHOST »

Hello,

sorry if i disturb you.

I have a problem when I order: "csf -r" in SSH. This error appears at finnaly: "ERROR*: Country Code Lookups setting MM_LICENSE_KEY must be set in /etc/csf/csf.conf to continue using the MaxMind databases"

Why does this error occur? It has not appeared so far.

Picture: https://i.postimg.cc/zBdR1ryW/Error-CSF.png

How can I fix this error? Please?

Thank you very much. Sincerely, Marius-Catalin.
Metro2
Junior Member
Posts: 78
Joined: 10 Dec 2006, 10:10

Re: Problem with CSF

Post by Metro2 »

Disclaimer - I'm not affiliated with ConfigServer, just a very long-time happy customer, so I can't provide detailed support, and I can definitely not guarantee your results if you use any of the info in this post. Also, some of the steps involved, file locations, and files you choose to use will vary depending on your server's operating system. (In my case I'm basing some of the info in this post on a CentOS 6.x / CloudLinux 6.x / Apache 2.4 / WHM 84 release-tier environment).

With that said...

You'll want to start FIRST by reading the info in this blog post (and the linked pages in it) carefully - https://blog.configserver.com/?p=3564

The simplified version is that you'll need to register a MaxMind account if you haven't already, and then you'll get an Account/User ID and generate / obtain a License Key for input into the MM_LICENSE_KEY in your CSF Configuration.

In my case though, it was a bit more complicated because the version of geoipupdate on my servers was older than 3.1.1 , and me not wanting to use an outdated version of geoipupdate with this newer feature / technology / method, I decided it would be best to upgrade geoipupdate to the latest version (4.1.5) and the instructions for doing so at https://dev.maxmind.com/geoip/geoipupda ... pdate-4-x/ aren't exactly intuitive for some of us (like me). But I can give you some hints / clues as to what I did to upgrade the geoipupdate version running on my server environment, which may be much different from yours, but still might give you an idea of what to do...

Again - disclaimer - I'm not telling you to do this, I'm just sharing what I did and what seems to have worked for me and my particular server environment. If you do this blindly without really reading / researching your particular environment, you could break things, so I'd recommend you just take these as "hints" as to where to start looking into how you'd need to do it on your particular server. (I spent several hours from start to finish, between carefully researching / reading / getting my MaxMind key / upgrading geoipupdate / testing & checking versions, adding my key to CSF config, etc...).

Here's the short version of what *I* did, and WILL NOT BE THE SAME FOR SOME OTHER PEOPLE / SERVERS:

I registered an account at https://www.maxmind.com/en/geolite2/signup

After that and confirming my MaxMind account, logged-in to MaxMind I went to generate my license key via https://www.maxmind.com/en/accounts/current/license-key (that will automatically take you to the page to "Generate a license key" if you're logged-in, and will show you the option to select Yes this key will be used for GeoIP Update, and that's when I noticed it mattered what version of geaoipupdate I was running already).

I checked the version of geoipupdate running on my server in SSH with command:

Code: Select all

geoipupdate -V

(notice the V is UPPER CASE for this)

That told me I was running really old 2.x.x geoipupdate

Found the location of my geoiupdate Config file in SSH with command:

Code: Select all

geoipupdate -v

(notice the v is LOWER CASE for this)

That told me that on my particular servers, is located at /etc/GeoIP.conf

Found the latest releases of geoipupdate at https://github.com/maxmind/geoipupdate/releases and confirmed which release was right for my server (which in my case was geoipupdate_4.1.5_linux_amd64.rpm , but that might not be the right one for your server).

In SSH I ran the command:

Code: Select all

wget https://github.com/maxmind/geoipupdate/releases/download/v4.1.5/geoipupdate_4.1.5_linux_amd64.rpm
Then in SSH I ran command:

Code: Select all

rpm -Uvh geoipupdate_4.1.5_linux_amd64.rpm
Then in SSH I edited my /etc/GeoIP.conf file to remove the older methods and replace with the newer methods and saved it, so that the main portion of the required top part of that file looks like this:

Code: Select all

# Please see https://dev.maxmind.com/geoip/geoipupdate/ for instructions
# on setting up geoipupdate, including information on how to download a
# pre-filled GeoIP.conf file.

# Enter your account ID and license key below. These are available from
# https://www.maxmind.com/en/my_license_key. If you are only using free
# GeoLite databases, you may leave the 0 values.
AccountID ----------
LicenseKey ---------------------

# Enter the edition IDs of the databases you would like to update.
# Multiple edition IDs are separated by spaces.
EditionIDs GeoLite2-Country GeoLite2-City
And saved the /etc/GeoIP.conf (after first making a backup of the original)

The "AccountID" and "LicenseKey" lines are not actually dashes - where you see dashes in my example above, those are where I put the AccountID and LicenseKey that I obtained from my MaxMind account.

Then via WHM I went to Plugins > CSF > Firewall Configuration and found the MM_LICENSE_KEY field, entered my MaxMind license key, and Saved.

I hope this post helps some people. Obviously your server may have a different OS / architecture etc... so the method and versions that I used may not be suitable, so please don't just try my steps with your fingers crossed - I would hate for anyone to experience a problem based on something they read that I wrote on here. Consider everything above an EXAMPLE of one way of handling it, and definitely make sure you know which exact files you need (if any) and what architecture / OS / CPU you have before doing anything resembling the above.

Maybe the ForumAdmin or Chirpy can take a look at what I did above, and confirm whether or not there is any "bad info" and/or point-out anything I should have done differently. ;)
WOWHOST
Junior Member
Posts: 2
Joined: 25 Jul 2019, 12:04

Re: Problem with CSF

Post by WOWHOST »

I use the latest version of CloudLinux, cPanel and the latest versions of plugins. Each time, I am updated with the server.

I will read more carefully what you wrote above. I will also read on other websites and come back with details.

Thanks.
Post Reply