CloudInsidr

Cyber security, infotech

  • Subscribe!
  • Privacy Policy
  • Legal
  • Contact Us

Join us on Twitter: @CloudInsidr

  • news & alerts
    • events
    • industry analysis
    • industry gossip
    • people
  • cloud, edge & co.
    • AWS
    • administration & orchestration
      • web servers in the cloud
      • mail servers
      • databases
  • cybersec & warfare
    • encryption
  • blockchain
Home Uncategorized How to Set up ip2nation: Geotargeting Made Easy for the Amazon Link Affiliate Plug-in and Your Server-Side Scripts
How to Set up ip2nation: Geotargeting Made Easy for the Amazon Link Affiliate Plug-in and Your Server-Side Scripts

Anna E Kobylinska 2016-02-05 Leave a Comment

How to Set up ip2nation: Geotargeting Made Easy for the Amazon Link Affiliate Plug-in and Your Server-Side Scripts

The Amazon Link plug-in for WordPress implements geotargeting based on ip2nation, a free geotargeting library from Per Gustafsson Consulting (available here). If you are wondering what you need to do in order to integrate the Amazon Link affiliate plug-in for WordPress (seing how a separate installation plugin for WordPress is two years old as of this writing, and counting), here is a quick howto for those who can access their websites’ MySQL or MariaDB database servers.

dgt_header

Step 1. Download the mysql file

Ssh to the server which is running your database (if this is not possible, see below for an alternative).

Download the database table into some temporary directory:

wget http://www.ip2nation.com/ip2nation.zip

and unzip it:

unzip ip2nation.zip

(If you cannot ssh to the server for lack of shell access, download the file to your local computer, unzip it locally, edit it as described in Step 5, then upload it to the server using the alternative method and you should be good.)

Step 2. Backup your databases (’cause you never know!)

Backup your databases:

mysqldump -u root -p --opt --alldatabases > dumpfile.mysql;

Should you later need to load the dump file (the backup file) in order to restore your databases, here is the command you would want to use at that time (not now!):

mysql < dumpfile.sql;
Step 3. Connect to your database server

Connect to your database server:

mysql -u root -p
enteryourpassword
Step 4. Figure out which database holds your WordPress data

List available databases:

show databases;

and make a note of their names. If looking at this output does not provide sufficient clues as to which database is storing what, check the config file of your CMS system that holds database access information (wp-config.php for WordPress).

Step 5. Make sure MySQL/MariaDB gets to know which database to write to

Open the file ip2nation in a text editor of your choice. On the first line, enter the command you would normally use to tell the database server which database (dbname) to write to (or which database to read from):

USE dbname;

Replace dbname with the actual name of yoru database, save the file and exit the editor.

Step 6. Import the file into the database

Import the contents of the file into the database:

mysql -u root -p --verbose < ip2nation-website1.sql;
enteryourpassword
Step 7. Verify that the integration was successful

On the Settings page of the plugin, you will see:
“Your ip2nation database is up to date”. Activate the option next to it and save. Your configuration should be ready to go.

Filed Under: Uncategorized, web servers in the cloud Tagged With: Affiliate, Amazon, dumpfile, geotargeting, MariaDB, MySQL, SQL, WordPress

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Subscribe

SSL/TLS Certificate Square (250 x 250)

Pearson Education (InformIT)

SSL/TLS Certificate Medium Rectangle (300 x 250)

©2022 CybrAnalytiqa OÜ

  • Content purchasing and syndication