<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>system reboot! &#187; geoip</title>
	<atom:link href="http://ibnuyahya.com/tag/geoip/feed/" rel="self" type="application/rss+xml" />
	<link>http://ibnuyahya.com</link>
	<description>echo help::answer($question)</description>
	<lastBuildDate>Wed, 25 Apr 2012 09:31:34 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>installing nginx geoip ubuntu server</title>
		<link>http://ibnuyahya.com/installing-nginx-geoip-ubuntu-server/</link>
		<comments>http://ibnuyahya.com/installing-nginx-geoip-ubuntu-server/#comments</comments>
		<pubDate>Wed, 01 Feb 2012 13:54:32 +0000</pubDate>
		<dc:creator>ibnuyahya</dc:creator>
				<category><![CDATA[nginx]]></category>
		<category><![CDATA[geoip]]></category>

		<guid isPermaLink="false">http://ibnuyahya.com/?p=701</guid>
		<description><![CDATA[installing geoip is pretty easy but sometime its a bit tricky. To ensure I&#8217;m not going to the same mistake, I do the following notes. Perhaps can help those facing same tricky mistake. 1. Install libgeoip-dev aptitude install libgeoip-dev 2. Compile your nginx and include &#8211;with-http_geoip_module ./configure --with-http_geoip_module Verify your nginx installation by typing nginx -V [...]]]></description>
			<content:encoded><![CDATA[<div style="height:33px;" class="really_simple_share robots-nocontent snap_nopreview"><div class="really_simple_share_facebook_like" style="width:100px;"><iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fibnuyahya.com%2Finstalling-nginx-geoip-ubuntu-server%2F&amp;layout=button_count&amp;show_faces=false&amp;width=&amp;action=like&amp;colorscheme=light&amp;send=false&amp;height=27" 
						scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:px; height:27px;" allowTransparency="true"></iframe></div>
					<div style="float:left; width:50px; padding-left:10px;" class="really_simple_share_facebook_like_send">
					<fb:send href="http://ibnuyahya.com/installing-nginx-geoip-ubuntu-server/" font=""></fb:send></div><div class="really_simple_share_google1" style="width:80px;"><div class="g-plusone" data-size="medium" data-href="http://ibnuyahya.com/installing-nginx-geoip-ubuntu-server/" ></div></div><div class="really_simple_share_twitter" style="width:100px;"><a href="http://twitter.com/share" class="twitter-share-button" data-count="horizontal" 
						data-text="installing nginx geoip ubuntu server" data-url="http://ibnuyahya.com/installing-nginx-geoip-ubuntu-server/" 
						data-via=""  ></a></div><div class="really_simple_share_linkedin" style="width:100px;"><script type="IN/Share" data-counter="right" data-url="http://ibnuyahya.com/installing-nginx-geoip-ubuntu-server/"></script></div><div class="really_simple_share_digg" style="width:100px;"><script type="text/javascript" src="http://widgets.digg.com/buttons.js"></script>
					<a class="DiggThisButton DiggCompact" href="http://digg.com/submit?url=http://ibnuyahya.com/installing-nginx-geoip-ubuntu-server/&amp;title=installing nginx geoip ubuntu server"></a></div></div>
		<div style="clear:both;"></div><p>installing geoip is pretty easy but sometime its a bit tricky. To ensure I&#8217;m not going to the same mistake, I do the following notes. Perhaps can help those facing same tricky mistake.</p>
<p>1. Install <strong>libgeoip-dev</strong></p>
<pre class="brush:bash">aptitude install libgeoip-dev</pre>
<p>2. Compile your nginx and include <strong>&#8211;with-http_geoip_module</strong></p>
<pre class="brush:bash">./configure --with-http_geoip_module</pre>
<p>Verify your nginx installation by typing</p>
<pre class="brush:bash">nginx -V</pre>
<p>Watch <strong>&#8211;with-http_geoip_module</strong> . If you can see <strong>&#8211;with-http_geoip_module</strong> in your<strong> nginx -V</strong> result, thats mean geoip module successfully installed.<br />
<span id="more-701"></span><br />
3. Create geoip directory in your nginx directory, <strong>/etc/nginx/geoip</strong></p>
<pre class="brush:bash">cd /etc/nginx
sudo mkdir geoip
cd geoip</pre>
<p>4. Download geoip data and extract</p>
<pre class="brush:bash">sudo wget http:// geolite.maxmind.com/download/geoip/database/GeoLiteCountry/GeoIP.dat.gz
sudo wget http:// geolite.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz
sudo gunzip GeoIP.dat.gz
sudo gunzip GeoLiteCity.dat.gz</pre>
<p>5. Edit you <strong>nginx.conf</strong></p>
<pre class="brush:bash">sudo nano /etc/nginx/nginx.conf</pre>
<p>and add the following code</p>
<pre class="brush:bash">http{
...
geoip_country /etc/nginx/geoip/GeoIP.dat;
geoip_city /etc/nginx/geoip/GeoLiteCity.dat;
...</pre>
<p>6. Edit fastcgi_params</p>
<pre class="brush:bash">sudo nano /etc/nginx/fastcgi_params</pre>
<p>and add the following code</p>
<pre class="brush:bash">  fastcgi_param GEOIP_CITY_COUNTRY_CODE $geoip_city_country_code;
  fastcgi_param GEOIP_CITY_COUNTRY_CODE3 $geoip_city_country_code3;
  fastcgi_param GEOIP_CITY_COUNTRY_NAME $geoip_city_country_name;
  fastcgi_param GEOIP_REGION $geoip_region;
  fastcgi_param GEOIP_CITY $geoip_city;
  fastcgi_param GEOIP_POSTAL_CODE $geoip_postal_code;
  fastcgi_param GEOIP_CITY_CONTINENT_CODE $geoip_city_continent_code;
  fastcgi_param GEOIP_LATITUDE $geoip_latitude;
  fastcgi_param GEOIP_LONGITUDE $geoip_longitude;</pre>
<p>7. Make sure you have this line of code include <strong>/etc/nginx/fastcgi_params;</strong> in your <strong>location ~ \.php$ {}</strong></p>
<pre class="brush:bash">sudo nano /etc/nginx/sites-available/default</pre>
<pre class="brush:bash">...
location ~ \.php$ {
...
include /etc/nginx/fastcgi_params;
..
}</pre>
<p>8. Restart nginx</p>
<pre class="brush:bash">sudo /etc/init.d/nginx restart</pre>
]]></content:encoded>
			<wfw:commentRss>http://ibnuyahya.com/installing-nginx-geoip-ubuntu-server/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using apc (Feed is rejected)
Page Caching using apc
Database Caching 12/14 queries in 0.001 seconds using apc
Object Caching 385/385 objects using apc

Served from: _ @ 2012-05-20 04:43:23 -->
