{"id":8866,"date":"2021-11-30T06:44:03","date_gmt":"2021-11-30T06:44:03","guid":{"rendered":"https:\/\/cpanelplesk.com\/wp62\/?p=8866"},"modified":"2021-11-30T07:32:30","modified_gmt":"2021-11-30T07:32:30","slug":"how-to-install-mod_geoip-on-whm-cpanel-server","status":"publish","type":"post","link":"https:\/\/cpanelplesk.com\/wp62\/how-to-install-mod_geoip-on-whm-cpanel-server\/","title":{"rendered":"How to install mod_geoip on WHM\/cPanel server"},"content":{"rendered":"<p>Mod_geoip Apache module helps to find the geolocation of IP addresses of visitors. This module allows you to get the visitor&#8217;s country, organization, and location.<\/p>\n<p>This post describes the procedure to install Mod_geoip in WHM\/cPanel server.<\/p>\n<p>Login to your server via SSH<\/p>\n<p>Then run the following commands, To download and install the GeoIP database provided by MaxMind<\/p>\n<pre>mkdir\u00a0\/usr\/share\/GeoIP &amp;&amp; cd \/usr\/share\/GeoIP \r\nwget http:\/\/geolite.maxmind.com\/download\/geoip\/database\/GeoLiteCountry\/GeoIP.dat.gz gzip -d GeoIP.dat.gz<\/pre>\n<p>Now run the following command to download and install Mod_GeoIP for cPanel servers:<\/p>\n<p>wget https:\/\/documentation.cpanel.net\/download\/attachments\/2326651\/custom_opt_mod-mod_geoip.tar.gz?version=29&amp;modificationDate=1460059677554&amp;api=v2<br \/>\ntar -C \/var\/cpanel\/easy\/apache\/custom_opt_mods -xzf custom_opt_mod-mod_geoip.tar.gz<\/p>\n<p>Now Recompile the Apache to activate mod_geoip, For this use cPanel&#8217;s easy apache script so the Geo_modip becomes an active apache module.<\/p>\n<p>Go to:<\/p>\n<p>WHM &gt; Software &gt; EasyApache &gt; Start customizing based on profile &gt; Activate \/ Check \u2018Mod GeoIP\u2019 &gt; then \u2018Save and Build\u2019.<\/p>\n<p>This will start the apache compilation process to add mod_geoip to CPanel\/WHM server.<\/p>\n<p>Now we have to enable mod_geoip for cPanel :<\/p>\n<p>WHM &gt; Service Configuration &gt; Apache Configuration &gt; Include Editor &gt; Pre Main Include &gt; Select your current Apache version<\/p>\n<p>And copy and paste the following details into your text area:<\/p>\n<pre>LoadModule geoip_module \/usr\/local\/apache\/modules\/mod_geoip.so\r\nGeoIPEnable On\r\nGeoIPDBFile \/usr\/share\/GeoIP\/GeoIP.dat MemoryCache\r\n<\/pre>\n<p>At this time mod_geoip should be installed and working as expected on cPanel\/WHM server.<br \/>\nHowever, now you need to install and add PHP GeoIP extension. Run the following command:<\/p>\n<pre>pecl install geoip<\/pre>\n<p>Then add the following code to your php.ini file, usually located at \/usr\/local\/lib\/php.ini<\/p>\n<pre>extension=geoip.so\r\n<\/pre>\n<p>Now restart the apache to apply changes:<\/p>\n<pre>service httpd restart\r\n<\/pre>\n<p>Now you can test your GeoIP module\u00a0 by running:<\/p>\n<pre>php -i |grep geo\r\n<\/pre>\n<p>Its output should be like:<\/p>\n<pre>php -i |grep geo\r\ngeoip\r\ngeoip support =&gt; enabled\r\ngeoip extension version = 1.0.7\r\ngeoip library version = 1004008\r\ngeoip.custom_directory = no value = no value\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Mod_geoip Apache module helps to find the geolocation of IP addresses of visitors. This module allows you to get the visitor&#8217;s country, organization, and location. This post describes the procedure to install Mod_geoip in WHM\/cPanel server. Login to your server via SSH Then run the following commands, To download and install the GeoIP database provided [&#8230;]<\/p>\n<p><a class=\"understrap-read-more-link\" href=\"https:\/\/cpanelplesk.com\/wp62\/how-to-install-mod_geoip-on-whm-cpanel-server\/\">Continue Reading&#8230;<\/a><\/p>\n","protected":false},"author":2,"featured_media":8870,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-8866","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-cpanel"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v24.1 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>How to install mod_geoip on WHM\/cPanel server - cPanel Plesk<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/cpanelplesk.com\/wp62\/how-to-install-mod_geoip-on-whm-cpanel-server\/\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:title\" content=\"How to install mod_geoip on WHM\/cPanel server - cPanel Plesk\" \/>\n<meta name=\"twitter:description\" content=\"Mod_geoip Apache module helps to find the geolocation of IP addresses of visitors. This module allows you to get the visitor&#8217;s country, organization, and location. This post describes the procedure to install Mod_geoip in WHM\/cPanel server. Login to your server via SSH Then run the following commands, To download and install the GeoIP database provided [...]Continue Reading...\" \/>\n<meta name=\"twitter:image\" content=\"https:\/\/cpanelplesk.com\/wp62\/wp-content\/uploads\/2021\/11\/Mod_GeoIP.png\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Seemab Saleem\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/cpanelplesk.com\/wp62\/how-to-install-mod_geoip-on-whm-cpanel-server\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/cpanelplesk.com\/wp62\/how-to-install-mod_geoip-on-whm-cpanel-server\/\"},\"author\":{\"name\":\"Seemab Saleem\",\"@id\":\"https:\/\/cpanelplesk.com\/wp62\/#\/schema\/person\/73d573cc7eaaf6625cf0dbd72191a648\"},\"headline\":\"How to install mod_geoip on WHM\/cPanel server\",\"datePublished\":\"2021-11-30T06:44:03+00:00\",\"dateModified\":\"2021-11-30T07:32:30+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/cpanelplesk.com\/wp62\/how-to-install-mod_geoip-on-whm-cpanel-server\/\"},\"wordCount\":292,\"publisher\":{\"@id\":\"https:\/\/cpanelplesk.com\/wp62\/#\/schema\/person\/c78ae1cf9451a09592fb9697d69c0c13\"},\"image\":{\"@id\":\"https:\/\/cpanelplesk.com\/wp62\/how-to-install-mod_geoip-on-whm-cpanel-server\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/cpanelplesk.com\/wp62\/wp-content\/uploads\/2021\/11\/Mod_GeoIP.png\",\"articleSection\":[\"Cpanel\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/cpanelplesk.com\/wp62\/how-to-install-mod_geoip-on-whm-cpanel-server\/\",\"url\":\"https:\/\/cpanelplesk.com\/wp62\/how-to-install-mod_geoip-on-whm-cpanel-server\/\",\"name\":\"How to install mod_geoip on WHM\/cPanel server - cPanel Plesk\",\"isPartOf\":{\"@id\":\"https:\/\/cpanelplesk.com\/wp62\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/cpanelplesk.com\/wp62\/how-to-install-mod_geoip-on-whm-cpanel-server\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/cpanelplesk.com\/wp62\/how-to-install-mod_geoip-on-whm-cpanel-server\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/cpanelplesk.com\/wp62\/wp-content\/uploads\/2021\/11\/Mod_GeoIP.png\",\"datePublished\":\"2021-11-30T06:44:03+00:00\",\"dateModified\":\"2021-11-30T07:32:30+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/cpanelplesk.com\/wp62\/how-to-install-mod_geoip-on-whm-cpanel-server\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/cpanelplesk.com\/wp62\/how-to-install-mod_geoip-on-whm-cpanel-server\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/cpanelplesk.com\/wp62\/how-to-install-mod_geoip-on-whm-cpanel-server\/#primaryimage\",\"url\":\"https:\/\/cpanelplesk.com\/wp62\/wp-content\/uploads\/2021\/11\/Mod_GeoIP.png\",\"contentUrl\":\"https:\/\/cpanelplesk.com\/wp62\/wp-content\/uploads\/2021\/11\/Mod_GeoIP.png\",\"width\":512,\"height\":512},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/cpanelplesk.com\/wp62\/how-to-install-mod_geoip-on-whm-cpanel-server\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/cpanelplesk.com\/wp62\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to install mod_geoip on WHM\/cPanel server\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/cpanelplesk.com\/wp62\/#website\",\"url\":\"https:\/\/cpanelplesk.com\/wp62\/\",\"name\":\"cPanel Plesk\",\"description\":\"Blog on famous hosting control panels\",\"publisher\":{\"@id\":\"https:\/\/cpanelplesk.com\/wp62\/#\/schema\/person\/c78ae1cf9451a09592fb9697d69c0c13\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/cpanelplesk.com\/wp62\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\/\/cpanelplesk.com\/wp62\/#\/schema\/person\/c78ae1cf9451a09592fb9697d69c0c13\",\"name\":\"Farooq Omer\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/cpanelplesk.com\/wp62\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/cpanelplesk.com\/wp62\/wp-content\/uploads\/2020\/11\/cpanelplesk.png\",\"contentUrl\":\"https:\/\/cpanelplesk.com\/wp62\/wp-content\/uploads\/2020\/11\/cpanelplesk.png\",\"width\":300,\"height\":44,\"caption\":\"Farooq Omer\"},\"logo\":{\"@id\":\"https:\/\/cpanelplesk.com\/wp62\/#\/schema\/person\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\/\/cpanelplesk.com\/wp62\/#\/schema\/person\/73d573cc7eaaf6625cf0dbd72191a648\",\"name\":\"Seemab Saleem\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/cpanelplesk.com\/wp62\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/6a87ff2e53b03e6839250e5278a6bd46?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/6a87ff2e53b03e6839250e5278a6bd46?s=96&d=mm&r=g\",\"caption\":\"Seemab Saleem\"},\"description\":\"Linux Server Administrator, Web Hosting engineer. I'm dealing with Linux servers since 2014. I started this blog to share the work i love with the world . let me know if you need any assistance. Thanks!!\",\"sameAs\":[\"https:\/\/cpanelplesk.com\/wp62\"],\"url\":\"https:\/\/cpanelplesk.com\/wp62\/author\/cmb\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to install mod_geoip on WHM\/cPanel server - cPanel Plesk","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/cpanelplesk.com\/wp62\/how-to-install-mod_geoip-on-whm-cpanel-server\/","twitter_card":"summary_large_image","twitter_title":"How to install mod_geoip on WHM\/cPanel server - cPanel Plesk","twitter_description":"Mod_geoip Apache module helps to find the geolocation of IP addresses of visitors. This module allows you to get the visitor&#8217;s country, organization, and location. This post describes the procedure to install Mod_geoip in WHM\/cPanel server. Login to your server via SSH Then run the following commands, To download and install the GeoIP database provided [...]Continue Reading...","twitter_image":"https:\/\/cpanelplesk.com\/wp62\/wp-content\/uploads\/2021\/11\/Mod_GeoIP.png","twitter_misc":{"Written by":"Seemab Saleem","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/cpanelplesk.com\/wp62\/how-to-install-mod_geoip-on-whm-cpanel-server\/#article","isPartOf":{"@id":"https:\/\/cpanelplesk.com\/wp62\/how-to-install-mod_geoip-on-whm-cpanel-server\/"},"author":{"name":"Seemab Saleem","@id":"https:\/\/cpanelplesk.com\/wp62\/#\/schema\/person\/73d573cc7eaaf6625cf0dbd72191a648"},"headline":"How to install mod_geoip on WHM\/cPanel server","datePublished":"2021-11-30T06:44:03+00:00","dateModified":"2021-11-30T07:32:30+00:00","mainEntityOfPage":{"@id":"https:\/\/cpanelplesk.com\/wp62\/how-to-install-mod_geoip-on-whm-cpanel-server\/"},"wordCount":292,"publisher":{"@id":"https:\/\/cpanelplesk.com\/wp62\/#\/schema\/person\/c78ae1cf9451a09592fb9697d69c0c13"},"image":{"@id":"https:\/\/cpanelplesk.com\/wp62\/how-to-install-mod_geoip-on-whm-cpanel-server\/#primaryimage"},"thumbnailUrl":"https:\/\/cpanelplesk.com\/wp62\/wp-content\/uploads\/2021\/11\/Mod_GeoIP.png","articleSection":["Cpanel"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/cpanelplesk.com\/wp62\/how-to-install-mod_geoip-on-whm-cpanel-server\/","url":"https:\/\/cpanelplesk.com\/wp62\/how-to-install-mod_geoip-on-whm-cpanel-server\/","name":"How to install mod_geoip on WHM\/cPanel server - cPanel Plesk","isPartOf":{"@id":"https:\/\/cpanelplesk.com\/wp62\/#website"},"primaryImageOfPage":{"@id":"https:\/\/cpanelplesk.com\/wp62\/how-to-install-mod_geoip-on-whm-cpanel-server\/#primaryimage"},"image":{"@id":"https:\/\/cpanelplesk.com\/wp62\/how-to-install-mod_geoip-on-whm-cpanel-server\/#primaryimage"},"thumbnailUrl":"https:\/\/cpanelplesk.com\/wp62\/wp-content\/uploads\/2021\/11\/Mod_GeoIP.png","datePublished":"2021-11-30T06:44:03+00:00","dateModified":"2021-11-30T07:32:30+00:00","breadcrumb":{"@id":"https:\/\/cpanelplesk.com\/wp62\/how-to-install-mod_geoip-on-whm-cpanel-server\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/cpanelplesk.com\/wp62\/how-to-install-mod_geoip-on-whm-cpanel-server\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/cpanelplesk.com\/wp62\/how-to-install-mod_geoip-on-whm-cpanel-server\/#primaryimage","url":"https:\/\/cpanelplesk.com\/wp62\/wp-content\/uploads\/2021\/11\/Mod_GeoIP.png","contentUrl":"https:\/\/cpanelplesk.com\/wp62\/wp-content\/uploads\/2021\/11\/Mod_GeoIP.png","width":512,"height":512},{"@type":"BreadcrumbList","@id":"https:\/\/cpanelplesk.com\/wp62\/how-to-install-mod_geoip-on-whm-cpanel-server\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/cpanelplesk.com\/wp62\/"},{"@type":"ListItem","position":2,"name":"How to install mod_geoip on WHM\/cPanel server"}]},{"@type":"WebSite","@id":"https:\/\/cpanelplesk.com\/wp62\/#website","url":"https:\/\/cpanelplesk.com\/wp62\/","name":"cPanel Plesk","description":"Blog on famous hosting control panels","publisher":{"@id":"https:\/\/cpanelplesk.com\/wp62\/#\/schema\/person\/c78ae1cf9451a09592fb9697d69c0c13"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/cpanelplesk.com\/wp62\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/cpanelplesk.com\/wp62\/#\/schema\/person\/c78ae1cf9451a09592fb9697d69c0c13","name":"Farooq Omer","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/cpanelplesk.com\/wp62\/#\/schema\/person\/image\/","url":"https:\/\/cpanelplesk.com\/wp62\/wp-content\/uploads\/2020\/11\/cpanelplesk.png","contentUrl":"https:\/\/cpanelplesk.com\/wp62\/wp-content\/uploads\/2020\/11\/cpanelplesk.png","width":300,"height":44,"caption":"Farooq Omer"},"logo":{"@id":"https:\/\/cpanelplesk.com\/wp62\/#\/schema\/person\/image\/"}},{"@type":"Person","@id":"https:\/\/cpanelplesk.com\/wp62\/#\/schema\/person\/73d573cc7eaaf6625cf0dbd72191a648","name":"Seemab Saleem","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/cpanelplesk.com\/wp62\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/6a87ff2e53b03e6839250e5278a6bd46?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/6a87ff2e53b03e6839250e5278a6bd46?s=96&d=mm&r=g","caption":"Seemab Saleem"},"description":"Linux Server Administrator, Web Hosting engineer. I'm dealing with Linux servers since 2014. I started this blog to share the work i love with the world . let me know if you need any assistance. Thanks!!","sameAs":["https:\/\/cpanelplesk.com\/wp62"],"url":"https:\/\/cpanelplesk.com\/wp62\/author\/cmb\/"}]}},"_links":{"self":[{"href":"https:\/\/cpanelplesk.com\/wp62\/wp-json\/wp\/v2\/posts\/8866","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/cpanelplesk.com\/wp62\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/cpanelplesk.com\/wp62\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/cpanelplesk.com\/wp62\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/cpanelplesk.com\/wp62\/wp-json\/wp\/v2\/comments?post=8866"}],"version-history":[{"count":0,"href":"https:\/\/cpanelplesk.com\/wp62\/wp-json\/wp\/v2\/posts\/8866\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/cpanelplesk.com\/wp62\/wp-json\/wp\/v2\/media\/8870"}],"wp:attachment":[{"href":"https:\/\/cpanelplesk.com\/wp62\/wp-json\/wp\/v2\/media?parent=8866"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cpanelplesk.com\/wp62\/wp-json\/wp\/v2\/categories?post=8866"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cpanelplesk.com\/wp62\/wp-json\/wp\/v2\/tags?post=8866"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}