Questions tagged [geoip]

GeoIP is the process of analyzing an IP address and determining the geographical location of that end point.

GeoIP assigns a location to an IP address, generally by doing a lookup in a specifically created database. Popular providers are MaxMind, Google, InfoSniper, and IP2Location. These, in turn, are based on Regional Internet Registries (RIR).

Common uses for this location information include:

  • Selecting the closest mirror for a download
  • Providing region specific billing information (currency, shipping cost)
  • Regionalizing the content of a page (local deals or specials)
694 questions
2
votes
2 answers

geoip_country_name returns "-" in nginx

I am trying to install geoip module for nginx though dockerfile by adding to my dockerfile the following: RUN apk add --no-cache libmaxminddb nginx-mod-http-geoip RUN cd /var/lib; \ mkdir -p nginx; \ wget -q -O-…
Kosmylo
  • 436
  • 1
  • 6
  • 20
2
votes
1 answer

Cart Message for specific shipping class, minimum amount and geolocated country in WooCommerce

I tried to make the code from Cart Message for a specific shipping class and a minimal cart total in Woocommerce coexist with my recent code Free shipping cart message for a specific shipping class, a minimal amount and a specific Country in…
fabiocs81
  • 63
  • 1
  • 5
2
votes
2 answers

Maxmind Geoip2 API vs downloadable database

I was wondering the differences between the usage of maxmind downloadable database vs their direct web API. Any particular benefits if I download the maxmind database locally to my server instead of using their direct web API? Is there any accuracy…
2
votes
2 answers

How to choose closest/fastest mirror in Python?

I've been thinking about how to implement mirror picking in Python. When I call on service API I get response with IP address. Now I want to take that address and check if it's close to me or not. If not, retry. I thought about pinging, as I have…
Gargauth
  • 2,495
  • 6
  • 27
  • 30
2
votes
1 answer

too few arguments to function ‘NF_HOOK’

I am installing xtables-addon to CentOS 7. configure command completes, Errors comes while making (./make) /root/xtables-addons-2.13/extensions/xt_TARPIT.c:295:3: warning: passing argument 3 of ‘NF_HOOK’ from incompatible pointer type [enabled by…
2
votes
0 answers

geoip_record_by_name always returns null

I keep getting null when trying to use geoip_record_by_name() function. I found GeoIP.dat files in /usr/share/ dir and replaced them with extended dat files. Here is my geoip extension phpinfo. This code I use to test…
Horuth
  • 143
  • 8
2
votes
0 answers

How can I retrieve user IP Address, City, Country upon sign up with Django?

I am wondering how I can get a user's location upon sign up using django. May I have an example in code doing this in a form? GeoIP likely does what I need but I am confused as to how to implement it. Here is my current forms.py: from django import…
Alex
  • 486
  • 1
  • 7
  • 19
2
votes
0 answers

Trying to store IP to database to limit external requests... why so many DB entries?

I'm using a third party API service to get a country code from IP address, and to limit the number of requests I'm storing the country code in a local database table, and doing a lookup to that first. If the record doesn't exist, it goes to get the…
Lee
  • 4,187
  • 6
  • 25
  • 71
2
votes
0 answers

Using longitude and latitude in GeoIP to get geographical information

I have been using GeoLite2 from the GeoIP package in Python to geolocate IP-adresses. It is quite easy. Using this code i.e. i can obtain a lot of information about the IP-address: reader = geolite2.reader() reader.get('131.165.115.153') Which…
2
votes
1 answer

Elasticsearch Field limit more than 1000

Can someone assist please. I need to fix the error so CloudTrail log in S3 can be shipped to Logstash the ES and viewed in Kibana. Can't figure out how to increase the field limit to something higher. My configuration looks like input { s3 { …
tripleb
  • 67
  • 2
  • 2
  • 10
2
votes
1 answer

Get the geo located Country and State in Woocommerce 3

I am making a plugin to display estimate shipping/delivery time depend on visitor IP address. To do this I am using WC_Geolocation but using this I can get only visitor country code like US CA etc how can I get visitor state name if county is US . …
Firefog
  • 3,094
  • 7
  • 48
  • 86
2
votes
1 answer

Turn Woocommerce shop into catalog for geolocated countries?

I'm trying to turn my woocommerce shop into catalog mode depends on country.I only want to show products' price and add to cart function in United States. I'm trying to achieve this by using a plugin called "GeoIP Detection" with the following code…
2
votes
1 answer

Fetch country based on the IP Address using python django

Is there any snippet or an example that can help me fetching country from the IP address? First I need to fetch the user's IP and then based on that I need to fetch the country. Below is the snippet that I am trying and have started with. from geoip…
2
votes
0 answers

How to mocktest GeoIP location?

We're looking at using the MaxMind GeoIP library for geolocating IP addresses, but I'm wondering how to even test if it is working? For example, if our datacenter has an IP address in WA, but I want to mock as if I were in Montana, how would I test…
Dan Gayle
  • 2,277
  • 1
  • 24
  • 38
2
votes
1 answer

Nginx custom error page and geoip block.

I am trying to display custom error page if error found (e.g. 404, 403..etc) in nginx. The 404 error pages shown when I access /test with following configuration. error_page 403 /403.html; error_page 404 /404.html; location = /403.html { root…
Rex
  • 59
  • 1
  • 1
  • 6