一:安装geoip2扩展依赖
yum install libmaxminddb-devel -y
#这个库是安装ngx_http_geoip2_module模块必须有的
yum -y install epel-release jemalloc pcre* openssl* unzip wget zip
【注:搜了一堆教程,发现加了这一步就安装成功了】
二:下载ngx_http_geoip2_module模块
cd /usr/local/src
git clone https://github.com/leev/ngx_http_geoip2_module.git
或
wget http://mirror.cnop.net/web/module/ngx_http_geoip2_module-master.zip && unzip ngx_http_geoip2_module-master.zip
ls ngx_http_geoip2_module-master
|