<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.yobi.be/index.php?action=history&amp;feed=atom&amp;title=GeoIP</id>
	<title>GeoIP - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.yobi.be/index.php?action=history&amp;feed=atom&amp;title=GeoIP"/>
	<link rel="alternate" type="text/html" href="https://wiki.yobi.be/index.php?title=GeoIP&amp;action=history"/>
	<updated>2026-05-22T19:25:19Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.8</generator>
	<entry>
		<id>https://wiki.yobi.be/index.php?title=GeoIP&amp;diff=1678&amp;oldid=prev</id>
		<title>PhilippeTeuwen: /* GeoIP install */</title>
		<link rel="alternate" type="text/html" href="https://wiki.yobi.be/index.php?title=GeoIP&amp;diff=1678&amp;oldid=prev"/>
		<updated>2006-12-15T15:49:34Z</updated>

		<summary type="html">&lt;p&gt;&lt;span class=&quot;autocomment&quot;&gt;GeoIP install&lt;/span&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 15:49, 15 December 2006&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;
  &lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 13:&lt;/td&gt;
  &lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 13:&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt; GeoIP City Edition, Rev 1: BE, 02, Ixelles, (null), 50.833302, 4.366700, 0, 0&lt;/div&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt; GeoIP City Edition, Rev 1: BE, 02, Ixelles, (null), 50.833302, 4.366700, 0, 0&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt; GeoIP City Edition, Rev 0: BE, 02, Ixelles, (null), 50.833302, 4.366700&lt;/div&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt; GeoIP City Edition, Rev 0: BE, 02, Ixelles, (null), 50.833302, 4.366700&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td colspan=&quot;2&quot; class=&quot;diff-empty diff-side-deleted&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;
  &lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;For more precise localisation, you can try [http://www.maxmind.com/app/locate_ip the online demo]&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td colspan=&quot;2&quot; class=&quot;diff-empty diff-side-deleted&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;
  &lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==Usage with AWFFull==&lt;/div&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==Usage with AWFFull==&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;cf [[AWFFull]] page&lt;/div&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;cf [[AWFFull]] page&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;

&lt;!-- diff cache key mediawiki-mw_:diff:1.41:old-1677:rev-1678:wikidiff2=table:1.14.1:bc2a06be --&gt;
&lt;/table&gt;</summary>
		<author><name>PhilippeTeuwen</name></author>
	</entry>
	<entry>
		<id>https://wiki.yobi.be/index.php?title=GeoIP&amp;diff=1677&amp;oldid=prev</id>
		<title>PhilippeTeuwen: /* Usage with Zope */</title>
		<link rel="alternate" type="text/html" href="https://wiki.yobi.be/index.php?title=GeoIP&amp;diff=1677&amp;oldid=prev"/>
		<updated>2006-12-15T15:48:57Z</updated>

		<summary type="html">&lt;p&gt;&lt;span class=&quot;autocomment&quot;&gt;Usage with Zope&lt;/span&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 15:48, 15 December 2006&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;
  &lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 37:&lt;/td&gt;
  &lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 37:&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br /&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==Usage with Zope==&lt;/div&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==Usage with Zope==&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;
  &lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;cf [[Zope]]&lt;/div&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;
  &lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;cf [[Zope]]&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt; page&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br /&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;First import the database on your MySQL db as &amp;lt;db_name&amp;gt;.csv [http://www.delau.net/php/geoip.html as descibed here]&lt;/div&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;First import the database on your MySQL db as &amp;lt;db_name&amp;gt;.csv [http://www.delau.net/php/geoip.html as descibed here]&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;
  &lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Add a Python Script in zope (e.g. geoip):&lt;/div&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;
  &lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;br&amp;gt;&lt;/ins&gt;Add a Python Script in zope (e.g. geoip):&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt; from Products.PythonScripts.standard import html_quote&lt;/div&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt; from Products.PythonScripts.standard import html_quote&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt; request = container.REQUEST&lt;/div&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt; request = container.REQUEST&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;

&lt;!-- diff cache key mediawiki-mw_:diff:1.41:old-1675:rev-1677:wikidiff2=table:1.14.1:bc2a06be --&gt;
&lt;/table&gt;</summary>
		<author><name>PhilippeTeuwen</name></author>
	</entry>
	<entry>
		<id>https://wiki.yobi.be/index.php?title=GeoIP&amp;diff=1675&amp;oldid=prev</id>
		<title>PhilippeTeuwen at 15:45, 15 December 2006</title>
		<link rel="alternate" type="text/html" href="https://wiki.yobi.be/index.php?title=GeoIP&amp;diff=1675&amp;oldid=prev"/>
		<updated>2006-12-15T15:45:48Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;==GeoIP install==&lt;br /&gt;
[http://www.maxmind.com/app/c GeoIP Country detection]&lt;br /&gt;
 apt-get install geoip-bin&lt;br /&gt;
To get city level geolocalisation we can get the free city db:&lt;br /&gt;
 mkdir /usr/local/share/GeoIP&lt;br /&gt;
 cd /usr/local/share/GeoIP&lt;br /&gt;
 wget http://www.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz&lt;br /&gt;
 gunzip GeoLiteCity.dat.gz&lt;br /&gt;
 ln -s /usr/local/share/GeoIP/GeoLiteCity.dat /usr/share/GeoIP/GeoIPCity.dat&lt;br /&gt;
&lt;br /&gt;
 geoiplookup 85.234.207.107 &lt;br /&gt;
 GeoIP Country Edition: BE, Belgium&lt;br /&gt;
 GeoIP City Edition, Rev 1: BE, 02, Ixelles, (null), 50.833302, 4.366700, 0, 0&lt;br /&gt;
 GeoIP City Edition, Rev 0: BE, 02, Ixelles, (null), 50.833302, 4.366700&lt;br /&gt;
==Usage with AWFFull==&lt;br /&gt;
cf [[AWFFull]] page&lt;br /&gt;
&lt;br /&gt;
in /etc/awffull/awffull.conf:&lt;br /&gt;
 GeoIP          yes&lt;br /&gt;
&lt;br /&gt;
Actually awffull is not compiled with GeoIP support but we can rebuild the package&lt;br /&gt;
 awffull -v (interrupt it, it&amp;#039;s at the beginning)&lt;br /&gt;
 =&amp;gt; GeoIP is not available in this binary. Ignoring request to use.&lt;br /&gt;
ok, don&amp;#039;t be impressed ;-)&lt;br /&gt;
&amp;lt;br&amp;gt;the building process of awffull is pretty well done, if it detects the headers of GeoIP it uses it, as simply as that.&lt;br /&gt;
 apt-get build-dep awffull&lt;br /&gt;
 apt-get source awffull&lt;br /&gt;
 cd awffull-3.7.1/&lt;br /&gt;
 apt-get install libgeoip1 libgeoip-dev&lt;br /&gt;
 dpkg-buildpackage -uc -b &lt;br /&gt;
Et voilà! You can install the new .deb freshly created.&lt;br /&gt;
&amp;lt;br&amp;gt;Now you can run it, it will give e.g.&lt;br /&gt;
 awffull -v&lt;br /&gt;
 =&amp;gt; awffull 3.7.1 (Linux 2.6.17-2-vserver-amd64) English&lt;br /&gt;
 =&amp;gt; Using GeoIP for IP Address Lookups: /usr/share/GeoIP/GeoIP.dat&lt;br /&gt;
One bad point: we didn&amp;#039;t fix the dependancies of our new package, for a local use this is ok but for larger use we should have added the libgeoip1 package in the list of dependencies of awffull.&lt;br /&gt;
&lt;br /&gt;
==Usage with Zope==&lt;br /&gt;
cf [[Zope]]&lt;br /&gt;
&lt;br /&gt;
First import the database on your MySQL db as &amp;lt;db_name&amp;gt;.csv [http://www.delau.net/php/geoip.html as descibed here]&lt;br /&gt;
Add a Python Script in zope (e.g. geoip):&lt;br /&gt;
 from Products.PythonScripts.standard import html_quote&lt;br /&gt;
 request = container.REQUEST&lt;br /&gt;
 RESPONSE =  request.RESPONSE&lt;br /&gt;
 ip = context.REQUEST.REMOTE_ADDR&lt;br /&gt;
 line = string.split(ip,&amp;#039;.&amp;#039;)&lt;br /&gt;
 ip0 = line[0]&lt;br /&gt;
 ip1 = line[1]&lt;br /&gt;
 ip2 = line[2]&lt;br /&gt;
 ip3 = line[3]&lt;br /&gt;
 ipnum = int(ip0) * 16777216 + int(ip1) * 65536 + int(ip2) * 256 + int(ip3) * 1&lt;br /&gt;
 print ipnum&lt;br /&gt;
 return printed&lt;br /&gt;
Add a Z Mysql Method (e.g. select_GeoIP) with as Arguments  &amp;#039;&amp;#039;&amp;#039;ipnum&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
 SELECT cn &lt;br /&gt;
 from &amp;lt;db_name&amp;gt;.csv &lt;br /&gt;
 where start &amp;lt; &amp;lt;dtml-sqlvar ipnum type=&amp;quot;string&amp;quot;&amp;gt; and end &amp;gt; &amp;lt;dtml-sqlvar ipnum type=&amp;quot;string&amp;quot;&amp;gt;&lt;br /&gt;
In a DTML Method, test :&lt;br /&gt;
 &amp;lt;dtml-in expr=&amp;quot;select_GeoIPs(ipnum=geoip())&amp;quot;&amp;gt;Hoo, you are from &amp;lt;dtml-var cn&amp;gt;, Welcome !&amp;lt;/dtml-in&amp;gt;&lt;br /&gt;
Same for latitude and longitude of the country [http://www.maxmind.com/app/country_latlon Country Geolocalization]&lt;/div&gt;</summary>
		<author><name>PhilippeTeuwen</name></author>
	</entry>
</feed>