Support

Admin Tools

#19269 Geoip - central db file

Posted in ‘Admin Tools for Joomla! 4 & 5’
This is a public ticket

Everybody will be able to see its contents. Do not include usernames, passwords or any other sensitive information.

Environment Information

Joomla! version
n/a
PHP version
n/a
Admin Tools version
n/a

Latest post by nicholas on Tuesday, 25 February 2014 01:29 CST

[email protected]
Having several Joomla 2.x and 3.x sites, all on the one server, all individually updating their geoip databases, it struck me they can all use the one file if I could simply download one master copy somewhere like in /etc or /var where all the sites have permission to read it.

One way to achieve it would be for me to remove the file plugins/system/akgeoip/db/GeoLite2-Country.mmdb and replace it with a link that point to (for example) /var/GeoLite2-Country.mmdb but I would have to do that on each site.

Then I thought, well if the Geolite plugin gets updated, or if someone clicks the "Update the Geolite 2 country database" button, that link might well get replaced or overwritten (or give a permission error to the person pressing the button).

It might be nice for the Geolite2 plugin (and/or Akeeba) to have an option to look at a central database file such as /var/GeoLite2-Country.mmdb so we only need to do one update per month instead of update every site.

Just a thought. :-)

Brian

 Brian Craigie Wishaw, North Lanarkshire ML2 0PS

nicholas
Akeeba Staff
Manager
You were so close to figuring this out :)

You can, indeed, remove the individual plugins/system/akgeoip/db/GeoLite2-Country.mmdb files and replace them with symlinks to your centralised file. Just make that link and file read-only (0444 permissions) and you do not have to worry about it being overwritten.

Nicholas K. Dionysopoulos

Lead Developer and Director

🇬🇷Greek: native 🇬🇧English: excellent 🇫🇷French: basic • 🕐 My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

[email protected]
Yes, I had considered changing the permissions so it would not get deleted.

However, I tried creating a symlink pointing to /var/geolite2/GeoLite2-Country.mmdb but when I did that, I could no longer operate the backend on the site (well I could log in, but then just got a white screen).

I figured out it was because openbasedir restrictions were in effect and /var/geolite2 is not within the allowed paths.

However, I would have thought that the Geolite plugin should be a bit more robust and not crash the administrator site because I could not open the database. :-)

I shall try again, this time adding /var/geolite2 to the global allowed path and see if that works.

Incidentally, installing the Geolite plugin on a site that only has Admintools Core (and not the Pro version) also results in a white screen when trying to update the geolite database by pressing the button. I found this out when I accidentally installed the non-pro version on a site.

I shall report back how I get on with the openbasedir change.

Thanks

Brian

 Brian Craigie Wishaw, North Lanarkshire ML2 0PS

nicholas
Akeeba Staff
Manager
If you have open_basedir restrictions you can't have a centralised database.

PS: The code that crashed your site is not written by us, it's written by MaxMind. I can neither debug or modify it :(

Nicholas K. Dionysopoulos

Lead Developer and Director

🇬🇷Greek: native 🇬🇧English: excellent 🇫🇷French: basic • 🕐 My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

Support Information

Working hours: We are open Monday to Friday, 9am to 7pm Cyprus timezone (EET / EEST). Support is provided by the same developers writing the software, all of which live in Europe. You can still file tickets outside of our working hours, but we cannot respond to them until we're back at the office.

Support policy: We would like to kindly inform you that when using our support you have already agreed to the Support Policy which is part of our Terms of Service. Thank you for your understanding and for helping us help you!