DirectAdmin Knowledge Base and Support

DirectAdmin is a web panel for a simple administration of both virtual and dedicated servers. DirectAdmin is faster, safe and more powerful than any other CP. And we know how to customize and support it.

GeoIP for Apache on Directadmin server

| 14:09:14 30.12.2018

Here you can find instructions on how to install GeoIP module for Apache on a Directadmin server.

Based on https://github.com/maxmind/geoip-api-mod_geoip2/blob/master/INSTALL.md

Compile module

Here in the example we download and compile the latest available module, at the moment of writing this post it is 1.2.10. The latest version can be found here: https://github.com/maxmind/geoip-api-mod_geoip2/releases

cd /usr/local/src
wget https://github.com/maxmind/geoip-api-mod_geoip2/archive/1.2.10.tar.gz -O GeoIP.1.2.10.tar.gz
tar -zxvf GeoIP.1.2.10.tar.gz
cd geoip-api-mod_geoip2-1.2.10/
apxs -i -a -L/usr/local/lib -I/usr/local/include -lGeoIP -c mod_geoip.c
/usr/local/directadmin/custombuild/build rewrite_confs

In the end of it you can find the file /usr/lib/apache/mod_geoip.so, if it's missing, then a compilation failed. And you should check every command for possible errors.

Activate module in Apache

echo "LoadModule geoip_module       /usr/lib/apache/mod_geoip.so" >> /etc/httpd/conf/extra/httpd-includes.conf

Restart Apache and test

apachectl -M 2>&1 | grep geoip

you should see:

geoip_module (shared)

That's it.

About Us
We are a team of professionals, and specialize in installation, configuring and managing of remote virtual and dedicated servers powered by Linux/Unix-like OS with DirectAdmin. We support various sets of software, including web-servers Apache, Nginx; internet domain name servers Bind, PowerDNS; mail-servers with POP3, IMAP and SMTP, FTP-servers, etc. After years of working through the most complex server challenges our team has gathered valuable expirience and universal solutions suitable for everyday tasks. We are here to lend you a helping hand and take care of your servers in order to let you have enough time to do more of what you love.




All of the information and data on this site is for informational purposes only and is provided for the convenience of the user.
Powered by: Amiro.CMS - Free edition