Wednesday, July 26, 2017

Using dynamic GeoIP module with nginx (CentOS)

by / Wednesday, 13 April 2016 / Published in Linux, BSD, Unix

nginx introduced dynamic module support in v. 1.9.11. This brief article provides step-by-step procedure to enable GeoIP support on your CentOS server.

  1. Make sure you have EPEL and nginx-mainline repositories are added and enabled in your system (*)
  2. Execute yum install nginx-module-geoip command
  3. put this line on the top of your /etc/nginx/nginx.conf:load_module "modules/ngx_http_geoip_module.so";
  4. test your configuration with nginx -t command
  5. If no errors happen, reload nginx with nginx -s reload

 That's it! You can immediately use the GeoIP module within nginx on your CentOS server.

(*) To use nginx-mainline repo, put the following to /etc/yum.repos.d/nginx.repo:

[nginx]name=nginx repo
baseurl=http://nginx.org/packages/mainline/centos/$releasever/$basearch/
gpgcheck=1
enabled=1

Note that we have gpgcheck=1 (official docs suggest we use gpgcheck=0, but that seems to be incorrect).

It is possible that you will have to update your packages to get the latest nginx release.

(*) If you don not have EPEL yet, you can enable it with yum install epel-release

Read 1804 times Last modified on Wednesday, 13 April 2016 13:58

Do you like this? Please share!

Simon Tushev

Simon is IT professional with interests in web design, electronics, photography and astronomy. He writes about PHP, Yii, Joomla!, Arduino and several other topics.

Welcome!

Here I publish articles related to my areas of interest, my brief notes that may save some time to others, as well as some of my works.

This site is a work in progress. I will add more sections in the future, such as

  • More photos to photogallery
  • More Joomla!-related articles
  • ...

 

themeforest

New Posts

Using dynamic GeoIP module with nginx (CentOS)

nginx introduced dynamic module support in v. 1.9.11. This brief article provides step-by-step procedure...

13-04-2016 in Linux, BSD, Unix

READ MORE

Visual difference between pseudo and true random data

This is is "random" image generated using PHP rand() function: And this is an image...

20-11-2015 in Blog

READ MORE

Best EEPROM practices

(this article is a work in progress). My own advice will be added later...   Having...

12-10-2015 in Arduino

READ MORE
Scroll to top

We use cookies, just to track visits to our website, we store no personal details Privacy policy