Categories: Core Linux

How to Install GeoIP on Linux Virtual Machine (VPS) !!!

Run the following command on Main Node  :

  vzctl set VEID –bindmount_add /tmp,noexec,nosuid,nodev –save –setmode restart —> to make it noexec
   vzctl set VEID –bindmount_add /tmp,nosuid,nodev –save –setmode restart —> to make it exec

 

To Install GeoIP on Linux Virtual Private Server (VPS) follow the following commands :

[root@vm1]# cd /usr/local/src
    [root@vm1]# wget http://geolite.maxmind.com/download/geoip/api/c/GeoIP-1.4.8.tar.gz
    [root@vm1]# tar -xzvf GeoIP-1.4.8.tar.gz
    [root@vm1]# cd GeoIP-1.4.8
    [root@vm1]# ./configure
    [root@vm1]# make
    [root@vm1]# make install
    [root@vm1]# echo ‘/usr/local/lib ‘ > /etc/ld.so.conf.d/geio.conf
    [root@vm1]# ldconfig
    [root@vm1]# cd ..

Now lets install module mod_geoip2

[root@vm1]# wget http://geolite.maxmind.com/download/geoip/api/mod_geoip2/mod_geoip2_1.2.7.tar.gz
    [root@vm1]# tar -zxvf mod_geoip2_1.2.7.tar.gz
    [root@vm1]# cd mod_geoip2_1.2.7/
    [root@vm1]# /usr/local/apache/bin/apxs -lGeoIP -cia mod_geoip.c

Now Verify the following configuration files to have proper configurations

[root@vm1]# vi /usr/local/apache/conf/includes/pre_main_global.conf
    [root@vm1]# vi /usr/local/apache/conf/geoip.conf

 

If the server is plesk and you are not able to run the command make and apxs then use

    [root@vm1]#yum install libtool ( If make  gives you error )

    [root@vm1]# updatedb; locate apxs | grep bin (To lcaote if you have the command apxs)

    [root@vm1]# yum install httpd-devel ( If apxs is not present )

 

Thanks,

Scott

 


Vishwajit Kale
Vishwajit Kale blazed onto the digital marketing scene back in 2015 and is the digital marketing strategist of Hostripples, a company that aims to provide affordable web hosting solutions. Vishwajit is experienced in digital and content marketing along with SEO. He's fond of writing technology blogs, traveling and reading.

Recent Posts

The Ultimate Guide to WordPress Maintenance: Tips and Tricks

When you’re running a business that relies on website traffic and sales to succeed. Then you need to keep it…

1 week ago

Migrate In 2024: Our Comprehensive Website Migration Manual to the Next Level

Migration! Yes, this word is very big in the web hosting industry and it has its importance. Especially for businesses…

1 week ago

Unveiling the Importance of Server Maintenance Plans: A Comprehensive Guide

The server is the backbone of the web hosting industry and it acts like a HERO in the web hosting…

2 weeks ago

IP Address is Blocked? A handpicked list of Solutions to Fix it?

Imagine you are on holiday having a cup of tea and browsing your website or blog.Then, what next?You will get…

3 weeks ago

Explained: Difference between Nameservers Vs. DNS

The web hosting industry is growing every minute, day, and year. It has many terminologies that are important to understand…

1 month ago