You are not logged in.

#1 2014-06-18 09:32:56

Lockheed
Member
Registered: 2010-03-16
Posts: 1,542

nginx - can't get geoip to work

I followed this guide: http://www.nginxtips.com/how-to-install … ip-module/

I am using geoip-enabled NGINX compilation, I have the libraries installed

# ldconfig -v | grep GeoIP
	libGeoIPUpdate.so.0 -> libGeoIPUpdate.so.0.0.0
	libGeoIP.so.1 -> libGeoIP.so.1.5.1

and yet when I create a test.php file

<html>
<body>
<?php

$geoip_country_code = getenv(GEOIP_COUNTRY_CODE);
/*
$geoip_country_code = $_SERVER['GEOIP_COUNTRY_CODE']; // works as well
*/
$geoip_country_code3 = getenv(GEOIP_COUNTRY_CODE3);
$geoip_country_name = getenv(GEOIP_COUNTRY_NAME);

$geoip_city_country_code = getenv(GEOIP_CITY_COUNTRY_CODE);
$geoip_city_country_code3 = getenv(GEOIP_CITY_COUNTRY_CODE3);
$geoip_city_country_name = getenv(GEOIP_CITY_COUNTRY_NAME);
$geoip_region = getenv(GEOIP_REGION);
$geoip_city = getenv(GEOIP_CITY);
$geoip_postal_code = getenv(GEOIP_POSTAL_CODE);
$geoip_city_continent_code = getenv(GEOIP_CITY_CONTINENT_CODE);
$geoip_latitude = getenv(GEOIP_LATITUDE);
$geoip_longitude = getenv(GEOIP_LONGITUDE);

echo 'country_code: '.$geoip_country_code.'<br>';
echo 'country_code3: '.$geoip_country_code3.'<br>';
echo 'country_name: '.$geoip_country_name.'<br>';

echo 'city_country_code: '.$geoip_city_country_code.'<br>';
echo 'city_country_code3: '.$geoip_city_country_code3.'<br>';
echo 'city_country_name: '.$geoip_city_country_name.'<br>';
echo 'region: '.$geoip_region.'<br>';
echo 'city: '.$geoip_city.'<br>';
echo 'postal_code: '.$geoip_postal_code.'<br>';
echo 'city_continent_code: '.$geoip_city_continent_code.'<br>';
echo 'latitude: '.$geoip_latitude.'<br>';
echo 'longitude: '.$geoip_longitude.'<br>';

?>
</body>
</html>

to check if geoip works, all I get in return is this:

 country_code:
country_code3:
country_name:
city_country_code:
city_country_code3:
city_country_name:
region:
city:
postal_code:
city_continent_code:
latitude:
longitude: 

I can't figure out what's wrong. Every other php site/function I have installed, works just fine.

Offline

#2 2015-09-08 19:53:29

rusty2
Member
Registered: 2015-09-08
Posts: 1

Re: nginx - can't get geoip to work

I am having trouble with the official nginx package (currently 1.8.0-1) and the GeoIP module as well. I can see in the PKGBUILD that the GeoIP module is included in the configuration, however when I run "nginx -V" the geoip module is missing. Could this be a problem with the nginx package itself?

Offline

#3 2015-09-08 22:19:26

WorMzy
Administrator
From: Scotland
Registered: 2010-06-16
Posts: 12,609
Website

Re: nginx - can't get geoip to work

Hi rusty2, welcome to the Arch Linux forums.

This is an old thread, and we discourage necrobumping. Please try to avoid doing so in the future.

To answer your question: it's not a problem, per se. The package simply hasn't been rebuilt since that dependency was added to the PKGBUILD. I suspect that the maintainer is awaiting the next upstream release to make that extra dependency a part of the official package. However, you would need to email the maintainer and ask them directly to be sure.

As this is a necrobump, I'm going to close it now. If you have further questions regarding nginx, please open a new topic.

Closing.


Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD

Making lemonade from lemons since 2015.

Offline

Board footer

Powered by FluxBB