Skip to content
Marketing Factory Digital GmbH
Contact
Logo Marketing Factory Digital GmbH
  • Agency
    • About us
    • History
  • Services
    • Consulting, Analysis and Strategy
    • Programming and Development
      • Interface Development
      • PIM/ERP Links
      • Custom Development
      • Seamless CMS Integration
    • Hosting and Support
      • Cloud Strategies
      • Hosting Partners of Marketing Factory
    • Services with Third Parties
  • Technology
    • TYPO3
      • Current TYPO3 Versions
    • Shopware
    • IT Security
      • DDoS Protection
      • Continuous Upgrading
      • Privacy First
    • Tech Stack
      • Commitment to Open Source
      • Technology Selection
      • PHP Ecosystem
      • Containerisation & Clustering
      • Content Delivery Networks
      • Search Technologies
  • References
    • Projects
    • Clients
      • Client List
    • Screenshot of the homepage of the new Maxion Wheels websiteNEW: Relaunch of the corporate website of Maxion Wheels
  • Community
    • Community Initiatives
  • Blog
  • Contact
  • Deutsch
  • English

You are here:

  1. Blog
  2. Geolocation of IP addresses and MaxMind GeoIP2
[Translate to English:] Programming code
  • Development
18.02.2019

Geolocation of IP addresses and MaxMind GeoIP2


Due to the "Regulation against unjustified geo-blocking in the internal market" and the strong, legal restriction of this technology introduced with it, the topic of geo-blocking has become the focus of public attention.

What is geo-blocking?

Geoblocking works by allowing websites to change their behavior based on the country in which the website visitor is located. This is common practice in the film and music industry, for example. It uses geoblocking to be able to market content as many times as possible in different countries. Anyone who once tried to watch a YouTube video and only got the error message "Sorry, this video is not available in your country" knows this. Despite the "geoblocking ban", there is nothing wrong with country allocation. Many websites use it to preselect languages or display country-specific content. This remains permissible even after the change of the legislation.

 

Geoblocking or just geolocation?

The recognition of the country - also called geolocation - is based on the customer's IP address. The individual IP address belongs to a block of addresses that has been assigned to a provider by a registration authority. In Europe, RIPE (Réseaux IP Européens) is responsible for this. If you now know which provider "owns" the IP, you very likely also know the country in which the IP is used. The information about the IP provider assignment is basically public, but distributed over five different registries worldwide . There are various providers who collect the information and compile it into a usable database. Of course, you have to regularly update these databases, because IP addresses change hands frequently.

One representative of such databases is the MaxMind GeoIP2, which we have often used for such purposes so far. For this, there was the module mod_geoip2, which was integrated into the web server and enriched the incoming request with geo-information based on the requesting IP address. Applications and content management systems could then use this information for their purposes. mod_geoip2 also has the advantage that it can work together with mod_rpaf. We need the latter in setups where HTTP caches like Varnish or load balancers are used, so that Apache knows the correct original client IP addresses.

Effects in practice

In terms of performance, all three methods are quite equal. There are measurements from 2016 that compare the PHP implementation to the Apache module. No significant speed difference beyond the measurement inaccuracy was proven there. Since PHP 7.0 and 7.2 have again increased the execution speed considerably, we do not expect performance losses.

Christian Spoo

"Mr. Fix-It" likes to impose his will on software and hardware. Speaks fluent meme and picdump. Responsible for development and technical design at Marketing Factory.

More posts by this author

Get blog posts as RSS feed

Related blog posts

  • Relaunch of the website of our client Maxion Wheels based on TYPO3 12.4 LTS
  • What is the right alt text for which images?
  • Efficient review environments: Why we replaced Kubernetes with Virtual Machines
  • User-friendly customization of the TYPO3 backend

Please feel free to share this article.


Comments

No comments yet.

Write a comment.

I have been informed that the processing of my data is on a voluntary basis and that I can refuse my consent without detrimental consequences for me or withdraw my consent at any time to Marketing Factory Digital GmbH by mail (Marienstraße 14, D-40212 Düsseldorf) or e-mail (info@marketing-factory.de).

I understand that the above data will be stored for as long as I wish to be contacted by Marketing Factory. After my revocation my data will be deleted. Further storage may take place in individual cases if this is required by law.

  • Data privacy policy
  • Legal notice

© Marketing Factory Digital GmbH

Picture Credits
  1. "Programming code": lmonk72 / License: Pixabay License (CC0 1.0)