Problem

Install manually the mod_maxminddb module into Apache2 in Ubuntu 20.04.

Analysis, Prereq & Prep

The module is not included by default.

1. Install the libmaxminddb library

As root or sudo:

# add-apt-repository ppa:maxmind/ppa
# aptitude update
# aptitude install libmaxminddb0 libmaxminddb-dev mmdb-bin

2. Install the apachee2-dev package

For your apache version:

# aptitude install apache2-dev

Solution

1. Get the latest mod_maxminddb

Get the latest version from: https://github.com/maxmind/mod_maxminddb/releases

# wget https://github.com/maxmind/mod_maxminddb/releases/download/1.2.0/mod_maxminddb-1.2.0.tar.gz

2. Unzip , configure and install:

# tar zxvf ./mod_maxminddb-1.2.0.tar.gz
# cd mod_maxminddb-1.2.0
# ./configure
# make install
# systemctl restart apache2

This will install the new module and enable. Check if installed:

# apachectl -M | grep maxminddb

3. Install the GeoIP Databases

You need to register to download the GeoIP databases from MaxMind.

4. Configure Apache2

References

  1. Install and Enable Mod_maxminddb for Geolocation
  2. Installing Apache Module mod_maxminddb, December 26, 2018 by Giorgio

Installing mod_maxminddb to Apache2 in Ubuntu 20.04