일단 geoDB를 다운로드 하고 저장해준다음

$ wget ftp://ftp.mrunix.net/pub/webalizer/geodb/geodb-latest.tgz

$ tar -xvf geodb-latest.tgz

$ sudo mkdir /usr/share/GeoDB

$ sudo mv GeoDB.dat /usr/share/GeoDB/

webalizer의 설정을 변경!

$ sudo vi /etc/webalizer/webalizer.conf

GeoDB           yes

GeoDBDatabase   /usr/share/GeoDB/GeoDB.dat 

그리고 실행하면 나온다.

$ sudo webalizer 



---

7a. Why does the country section show only 100% unresolved?

Most likely because your web server is not doing name lookups and simply logging IP addresses. In order to determine the top level domain of the remote site, the program needs a resolved hostname, not an IP address. The simple fix is to just turn on name lookups on your web server so it starts logging names. Otherwise, you can pre-process your logs with something like the logresolve program supplied with apache or similar utilities, or you can use the Webalizers built in DNS lookup code (see 7b below). Another alternative is to enable the geolocation services, which will lookup the geographic location of IP addresses. You can use either the Webalizers native geolocation support (GeoDB) which supports both IPv4 and IPv6 addresses, or optionally, GeoIP support from MaxMind Inc. While geolocation support will give you accurate country information, other aspects of the analysis may suffer, such as search string analysis (which depends on resolved hostnames to identify the various search engines).


7b. My Server doesn't do name lookups. Will The Webalizer?

Yes. The Webalizer fully supports both IPv4 and IPv6 reverse DNS lookup support. See the DNS.README file for additional information. If you don't enable hostname lookups on your web server, or use the geolocation services provided by The Webalizer, you will get '100% Unresolved/Unknown' country totals. This is because your log files only have IP addresses and not names. While it is recommended that you let your web server handle the DNS lookups, DNS support can be used for those sites where DNS resolution is not an option.


[링크 : http://www.webalizer.org/faq.html]


The webalizer has the ability to perform reverse DNS lookups,  and

fully supports both IPv4 and IPv6 addressing schemes.  This document

attempts to explain how it works, and some things that you should be

aware of when using the DNS lookup features.


Note: The Reverse DNS feature may be enabled or disabled at compile

      time.  DNS lookup code is enabled by default.  You can run The

      Webalizer using the '-vV' command line options to determine what

      options are enabled in the version you are using. 

[링크 : ftp://ftp.mrunix.net/pub/webalizer/DNS.README]

[링크 : http://www.webalizer.org/webalizer.1.html]

[링크 : ftp://ftp.mrunix.net/pub/webalizer/geodb/]


$ webalizer -vV

Webalizer V2.23-08 (Linux 4.4.38-v7+ armv7l) locale

Copyright 1997-2013 by Bradford L. Barrett

Mod date: 26-Aug-2013  Options: DNS/GeoDB GeoIP

Default GeoDB dir : /usr/share/GeoDB

Default config dir: /etc/webalizer



+

GeoIP 라는게 있어서 켜봤는데 차이가 없어서 다시 보니 GeoDB가 설정되면 GeoIP는 무시된다. 라네?

# The GeoIP option enables or disables the use of geolocation

# services provided by the GeoIP library (http://www.maxmind.com),

# if available.  Values may be 'yes' or 'no, with 'no' being the

# default.  Note: if GeoDB is enabled, then this option will have

# no effect (GeoDB will be used regardless of this setting).


#GeoIP no


# GeoIPDatabase specifies an alternate database filename to use by the

# GeoIP library.  If an absolute path is not given as part of the name

# (ie: starts with a leading '/'), then the name is relative to the

# default output directory. This option should not normally be needed.


#GeoIPDatabase /usr/share/GeoIP/GeoIP.dat 


GeoIP의 경우에는 패키지로 관리되니, 

수작업으로 GeoDB 업데이트 할바에는 GeoIP를 활성화 해주는게 나을지도 모르겠다.

$ apt-file search GeoIP

geoip-database: /usr/share/GeoIP/GeoIP.dat

geoip-database: /usr/share/GeoIP/GeoIPv6.dat

geoip-database-contrib: /usr/share/GeoIP/GeoIP.dat

geoip-database-contrib: /usr/share/GeoIP/GeoIPASNum.dat

geoip-database-contrib: /usr/share/GeoIP/GeoIPASNumv6.dat

geoip-database-contrib: /usr/share/GeoIP/GeoIPv6.dat

geoip-database-contrib: /usr/share/GeoIP/GeoLiteCity.dat

geoip-database-contrib: /usr/share/GeoIP/GeoLiteCityv6.dat

geoip-database-extra: /usr/share/GeoIP/GeoIPASNum.dat

geoip-database-extra: /usr/share/GeoIP/GeoIPCity.dat 


+

[링크 : https://www.siteground.com/tutorials/geoip/]

[링크 : https://www.maxmind.com/download/geoip/api/php-20120410/geoip.inc]

Posted by 구차니