Bitnami stacks Magento 2.4.2 - GeoIP module

Keywords: Magento - Other - Technical issue - Other
Description:
Hi,

on Bitnami cloud hosting I created a new version of Bitnami stacks Magento 2.4.2, where modsecurity 3 is installed.

Modsecurity 3 uses GeoLite2 (.mmdb files). If I download and update the GeoLite2-Country.mmdb database from the MaxMind database, I will get this error after reboot:
This version of ModSecurity was not compiled with GeoIP or MaxMind support.

Can you advise me how to fix this bug or how to add support for the MaxMind database GeoLite2-Country.mmdb to the modsecurity 3 installation?

At the same time, according to these instructions, it is possible to install geoip2:
https://docs.bitnami.com/installer/apps/magento/configuration/install-modules-php/#geoip2

but the Geoip.dat database is no longer supported and updated. Do you have a solution how to install supported module GeoIP with MaxMind database GeoLite2-Country.mmdb?

Or do you have another solution for Geoip Bitnami stacks Magento 2.4.2?

Regards

Eduard

Hi @eduard,

I just launched a fresh Bitnami Magento deployment and could install the mod_geoip module without problems.

sudo apt-get update
sudo apt-get install build-essential libtool autoconf unzip wget
sudo apt-get install libgeoip-dev
cd ~/
wget "https://github.com/maxmind/geoip-api-mod_geoip2/archive/refs/tags/1.2.10.tar.gz"
tar -xf 1.2.10.tar.gz
cd geoip-api-mod_geoip2-1.2.10/
sudo apxs -i -a -lGeoIP -c mod_geoip.c

I also added the GeoIPEnable On line in the httpd.conf file and installed the geoip-database package

sudo apt-get install geoip-database

and restarted Apache

sudo /opt/bitnami/ctlscript.sh restart apache

Apache didn’t return any error so I assume there is not any problem when enabling the library in Apache. If you have any problem with the library, I suggest you contact the developers of the library so they can provide more information about how to use it.

Hi,
Thank you for your response. I tried this option, but the problem is that it no longer has an updated GeoIP.dat database (the last one from 2018).

According to MaxMind:

"MaxMind will be retiring the GeoIP Legacy databases at the end of May 2022. Until then, this library will only receive critical security and bug fixes. Support for this library will end completely with the last release of the legacy GeoIP databases.

We recommend that you upgrade to our GeoIP2 databases ".

In future releases of Magento stacks, mod_maxminddb should be installed so that the current Geoip database can be used and updated.

In any case, thank you for your support and you can close the ticket.

Regards

Eduard

Hi @eduard,

I just installed libmaxminddb and mod_maxminddb by running these commands

cd /tmp
wget "https://github.com/maxmind/libmaxminddb/releases/download/1.6.0/libmaxminddb-1.6.0.tar.gz"
tar -xf libmaxminddb-1.6.0.tar.gz
cd libmaxminddb-1.6.0
./configure
make
make check
sudo make install
sudo ldconfig
cd /tmp
wget "https://github.com/maxmind/mod_maxminddb/releases/download/1.2.0/mod_maxminddb-1.2.0.tar.gz"
tar -xf mod_maxminddb-1.2.0.tar.gz
cd mod_maxminddb-1.2.0
./configure --with-apxs=/opt/bitnami/apache/bin/apxs
make install
sudo make install
sudo /opt/bitnami/ctlscript.sh restart apache

I checked the error_log file of Apache and didn’t find any error there.

Happy to help!


Was my answer helpful? Click on :heart:

Hi,

thanks for the help, this solution is working properly and there are no bugs. With the update from maxmind, the database is updated once a week. I’ll put it in production mode.

Thanks again for the help.

Regards

Eduard

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.