Skip to content

rekmus/ip2loc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

IP2Loc

This is the demo web application for IP2Location Contest.

It shows visits history with location, based on IP2Location™ LITE IP-COUNTRY free database and Silgy as a web application framework.

Live instance

It's live here: silgy.org:2020

Installation (UNIX/Linux)

The demo is running on AWS EC2 Linux t2.micro instance (Amazon Linux AMI release 2018.03).

1. Install C++ compiler and MySQL:

sudo yum install -y gcc-c++
sudo yum install -y mysql-server mysql

Optionally:

sudo yum install -y mysql-devel

2. Download or clone this repository

3. Create a database ip2loc and create two tables:

create table visits
(
    id int auto_increment primary key,
    ip char(60),
    country_code CHAR(2),
    region_name VARCHAR(128),
    city_name VARCHAR(128),
    method char(15),
    uri varchar(250),
    referer varchar(250),
    uagent varchar(250),
    lang char(5),
    ua_type char(1),
    bot char(1),
    ad char(1),
    session_id int,
    status smallint,
    processing float,
    created datetime
);

The database name and credentials (along with the listening port number) are in bin/silgy.conf.

4. Make src/m executable:

cd src
chmod u+x m

5. Compile

cd src
./m

(You may need to verify MySQL include and library paths in m, depending on your configuration)

6. Prepare bin/silgystart and bin/silgystop

  • Verify $SILGYDIR is correct (the existing code assumes it's /home/ec2-user/ip2loc)
  • Make them executable:
chmod u+x silgystart
chmod u+x silgystop

7. Run

cd bin
./silgystart

Don't forget to add an inbound security rule to allow traffic to your port.

Troubleshooting

logs directory should contain something useful. Anyway I'll be happy to help at silgy.help@gmail.com.

About

IP2Location Demo

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages