To install mod_geoip2 extension for Apache2 please follow below steps
Make sure you have gcc installed
Execute below command to install all development tools (which includes gcc as well)
yum groupinstall 'Development Tools'
Now let’s install GeoIP development package
yum install geoip-devel
If above package is not installed then you might get Error as below , when you are installing mod_geoip2