wget http://geolite.maxmind.com/download/geoip/api/c/GeoIP.tar.gznginx
wget http://geolite.maxmind.com/download/geoip/database/GeoLiteCity.dat.gzapi
wget http://geolite.maxmind.com/download/geoip/database/GeoLiteCountry/GeoIP.dat.gzbash
# tar xzvf GeoIP.tar.gzide
# cd GeoIP-1.4.8ip
# ./configureget
# make && make installit
# nginx -t
nginx: error while loading shared libraries: libGeoIP.so.1: cannot open shared object file: No such file or directoryio
# locate libGeoIP.so.1
-bash: locate: command not foundclass
yum -y install mlocate
-------------------------------test
# locate libGeoIP.so.1
locate: can not stat () `/var/lib/mlocate/mlocate.db': No such file or directory
updatedb
-------------------------------
# locate libGeoIP.so.1
/root/GeoIP-1.4.8/libGeoIP/.libs/libGeoIP.so.1
/root/GeoIP-1.4.8/libGeoIP/.libs/libGeoIP.so.1.4.8
/usr/local/lib/libGeoIP.so.1
/usr/local/lib/libGeoIP.so.1.4.8
# echo"/usr/local/lib" >> /etc/ld.so.conf
# ldconfig
# nginx -tnginx: the configuration file /usr/local/nginx/conf/nginx.conf syntax is oknginx: configuration file /usr/local/nginx/conf/nginx.conf test is successful