Ubuntu + GeoIP2 (licensed)

Discussion in 'HOWTO-Related Questions' started by Tarm, Nov 28, 2013.

  1. Tarm

    Tarm New Member

    Hi,

    I'm reading the GeoIP tutorial at http://www.howtoforge.com/installing-mod_geoip-for-apache2-on-ubuntu-12.04 .
    First off using the lite version of GeoIP this works. After purchasing a lisence for GeoIP, I downloaded the new and updated database (.dat), and edited geoip.conf in apache2/mods-available.

    The result when running a test script is nothing. I only see a blank page.
    I'm using the following code from maxmind.com:
    Code:
    <?php
    
    // include functions
    include("geoip.inc");
    
    // read GeoIP database
    $handle = geoip_open("GeoIP.dat", GEOIP_STANDARD);
    
    // map IP to country
    echo "IP address 62.149.130.132 located in " . geoip_country_name_by_addr($handle, "62.149.130.132") . " (country code " . geoip_country_code_by_addr($handle, "62.149.130.132") . ")";
    
    // close database handler
    geoip_close($handle);
    
    // print compulsory license notice
    echo "<p> -- This product includes GeoIP data created by MaxMind, available from http://maxmind.com/ --";
    
    ?>
    
    Any ideas? Thanks.
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    Which error message do you get in the global apache or website error.log file?
     
  3. Tarm

    Tarm New Member

    This is embarrasing, I had forgotten to change the php code I attached with the location to the .inc script and the proper .dat file.
     

Share This Page