I am going to explain you how to compile GeoIP as a dynamic module using the Nginx open source version, and how to add it to your actual Nginx stack, I have tested it and it works.
To compile a Nginx module we need to compile the entire Nginx with the path to the module. It will create a
.so file that is the dynamic module itself and also a new Nginx to be installed. We just need the
.so file so we will take it and add it to the Nginx that was installed with the Wordpress Pro stack.
First, you need to install on your system the
$ sudo apt-get install libmaxminddb-devel
After that, download the GeoIp source code from: https://github.com/leev/ngx_http_geoip2_module/releases you can run this command to download it:
$ wget https://github.com/leev/ngx_http_geoip2_module/archive/3.2.tar.gz
$ tar xzf 3.2.tar.gz
Download now the nginx open source version:
$ wget http://nginx.org/download/nginx-1.11.5.tar.gz
$ tar -xzvf nginx-1.11.5.tar.gz
$ cd nginx-1.11.5
Now, to compile the module as a dynamic module execute:
We don't need the
make install step because it is generated before. Don't forget to change the path to the directory where the module has been uncompressed. In my case, for example, is
objs/ngx_http_geoip2_module.so should be created.
Go to your Nginx installation directory (the directory of the Wordpress Pro installation of the stack) and create a
modules directory to save the modules there:
$ mkdir modules from
Now, edit the Nginx configuration file to load the module adding this line at the begining:
And execute from the stack directory the following command to restart your actual Nginx:
$ ./ctlscript restart nginx
After that you should be able to access your Wordpress page as normal and the module should be installed properly.