Search code examples
phpserver

How to install freegeoip on my server


I want to install https://github.com/fiorix/freegeoip On my Linux server. But i have no idea how to do that. Documentation is not very clear and i don't know anything about servers (I always thought cpanel->publichtml has all the stuff that matters). I know php very well but that doesn't help it.

So can someone give me little guidance. I am trying this for hours now, But still don't know where i am going. Please little help would make my day.


Solution

  • Download the latest release (currently 3.2) and untar on your server, make sure the binary has executable permissions then run the binary.

    Run the following commands on your Linux server.

    cd ~
    wget https://github.com/fiorix/freegeoip/releases/download/v3.2/freegeoip-3.2-linux-amd64.tar.gz
    tar xvfz freegeoip-3.2-linux-amd64.tar.gz
    cd freegeoip-3.2-linux-amd64
    chmod +x freegeoip
    ./freegeoip
    

    Once you've done that, you should see the following:

    2017/06/23 14:26:21 freegeoip http server starting on :8080
    2017/06/23 14:26:21 database info: starting update
    2017/06/23 14:26:22 database info: finished update
    2017/06/23 14:26:23 database loaded: /tmp/freegeoip/db.gz

    At this point you should be able to visit http://your-server-ip:8080/json/ and the service should be up and running.

    Note: The above steps were tested on a Ubuntu 16.04 server. This doesn't install the binary on your server, it only a runs the binary.