- CentOS nginx package git: https://git.centos.org/rpms/nginx/
- ngx_http_geoip2_module: https://github.com/leev/ngx_http_geoip2_module
-
Install development tools
$ sudo dnf group install "Development Tools" "RPM Development Tools"
-
The libmaxminddb-devel package, which is required to build the ngx_http_geoip2_module, is missing from CentOS 8.0. We need to download its source rpm package and rebuild it.
$ rpmdev-setuptree $ dnf download --source libmaxminddb $ rpmbuild --rebuild libmaxminddb-1.2.0-6.el8.src.rpm $ sudo rpm -Uvh ~/rpmbuild/RPMS/x86_64/libmaxminddb-devel-1.2.0-6.el8.x86_64.rpm
-
CentOS get_sources.sh script
$ git clone https://git.centos.org/centos-git-common.git $ mkdir -p ~/bin && ln -sf `pwd`/centos-git-common/get_sources.sh ~/bin
$ sudo dnf builddep nginx
$ git clone -b c8-stream-1.16-geoip2 https://github.com/wenzhuoz/nginx-rpms.git
$ cd nginx-rpms
$ get_sources.sh -c -b c8-stream-1.16
$ rpmbuild --define "%_topdir `pwd`" -ba SPECS/nginx.spec --with geoip2