Incremental 옵션이 영향을 주는것 같아서 해보는데 일단 귀찮아서...

Incremental no 옵션을 설정한 다음 전체 로그를 붙여서(과거 - 현재 순서로)

붙이니 일단 되는 듯.. -p 옵션을 통해서 여러개로 나누어진 녀석을 처리가능하다는데

해보진 않아서 모르겠네.. 해볼까? (멀 잘못했나.. -p 로그파일 해도 안되네..)

 

6. My logs are HUGE! Can I run The Webalizer on partial logs?Yes!
        . The Webalizer fully supports incremental processing. This allows you to rotate your logs as often as needed without the loss of statistical detail between runs. Use the "Incremental" keyword in your configuration file, or the "-p" command line switch to enable incremental processing. See the
 README file for additional information and precautions on using incremental processing.

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

 

The Webalizer is a command line application and is launched from the operating system shell prompt. A typical command is shown below.webalizer -p -F clf -n en.wikipedia.org -o reports logfiles/access_log

This command instructs The Webalizer to analyze the log file access_log, run in the incremental mode (-p), interpret the log as a CLF log file (-F), use the domain name en.wikipedia.org for report links (-n) and produce the output subdirectory of the current directory. Use the -h option to see the complete list of command line options.

[링크 : https://en.wikipedia.org/wiki/Webalizer#Command_line]

 

for obj in $(ls access*); do webalizer -p -F apache -n example.hostname.com -o /path/to/webalizer/ $obj; done

[링크 : https://coderwall.com/p/0eh7iw/run-old-access-logs-through-webalizer]

Posted by 구차니

댓글을 달아 주세요

webalizer가 솔찍히 보기 편한 통계는 아니지만

그거에 거부감을 느끼는 인간 때문에 다른 통계 프로그램 찾는중

근데 webalizer에다가 일별로 접속 통계 이런식으로는 커스터마이징이 안되려나?


[링크 : https://goaccess.io]

[링크 : https://awstats.sourceforge.io/]

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


[링크 : https://www.weblogexpert.com/]

Posted by 구차니

댓글을 달아 주세요

reverse proxy 돌리면..

공유기 안에서도 정상적으로 로그를 받을 수 있을려나?


[링크 : https://serverfault.com/questions/326837/iptables-nat-port-fowarding-and-apache-log-ips]

Posted by 구차니

댓글을 달아 주세요

/etc/webalizer/webalizer.conf 에 보면 아래 세가지가 보이는데

생각을 해보니.. 이 기능을 이용하면 logrotate를 비활성화 하지 않아도 문제가 될거 없는 느낌?

logrotate를 잠시 꺼둔 이유가 모이지 않아서였는데


history 파일은 이전달들이니까.. 복수형인거 같고

즉, logrotate 당해도 이전 데이터 들은 남아 있다 정도일거 같은데


incremental은 파싱할 내용의 범위를 줄여주는 기능이려나?


 45 # HistoryName allows you to specify the name of the history file produced

 46 # by the Webalizer.  The history file keeps the data for previous months,

 47 # and is used for generating the main HTML page (index.html). The default

 48 # is a file named "webalizer.hist", stored in the output directory being

 49 # used.  The name can include a path, which will be relative to the output

 50 # directory unless absolute (starts with a leading '/')


 54 # Incremental processing allows multiple partial log files to be used

 55 # instead of one huge one.  Useful for large sites that have to rotate

 56 # their log files more than once a month.  The Webalizer will save its

 57 # internal state before exiting, and restore it the next time run, in

 58 # order to continue processing where it left off.  This mode also causes

 59 # The Webalizer to scan for and ignore duplicate records (records already

 60 # processed by a previous run).  See the README file for additional

 61 # information.  The value may be 'yes' or 'no', with a default of 'no'.

 62 # The file 'webalizer.current' is used to store the current state data,

 63 # and is located in the output directory of the program (unless changed

 64 # with the IncrementalName option below).  Please read at least the section

 65 # on Incremental processing in the README file before you enable this option

 

 69 # IncrementalName allows you to specify the filename for saving the

 70 # incremental data in.  It is similar to the HistoryName option where the

 71 # name is relative to the specified output directory, unless an absolute

 72 # filename is specified.  The default is a file named "webalizer.current"

 73 # kept in the normal output directory.  If you don't specify "Incremental"

 74 # as 'yes' then this option has no meaning. 



[링크 : http://se.uzoogom.com/17]

[링크 : http://blog.naver.com/fogwhite/20050962196]



+

그나저나.. 이게 원래 보던건데..


테스트 한다고 access.log 를 비워버리고 webalizer 실행하니까 이렇게 kB In/Out 이라는 못보던 항목이 생겨났다

무슨 옵션으로 인해 생겨난거지?


Posted by 구차니

댓글을 달아 주세요

간단하게 요약하면..

이번 로그 파일을 합치고

/etc/webalizer/webalizer.conf를 복사해서

새로운 설정파일을 만든 후

아래와 같이 설정파일을 지정해서(-c) 돌리는 방법이라고 해야하나?

$ sudo webalizer -c /etc/webalizer/webalizer.conf.old 


[링크 : http://www.pc-freak.net/blog/linux-generating-web-statistics-apache-logs-webalizer/]



실험을 해보니.. incremental이나 history 적용하니

옛날 버전이 되지 않아서, 두개 설정 데이터를 지우거나 구버전 설정파일에서는 해당 기능을 꺼야

이전 버전들이 새로 생성된다.

Posted by 구차니

댓글을 달아 주세요

일단 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 구차니

댓글을 달아 주세요

라즈베리 파이에서 매일매일 logrotate 하도록 하고

webalizer는 access.log.1 을 보도록 되어 있어서

logrotate를 안돌리면 webalizer 쪽이 갱신되지 않는 문제가 있다.


아무튼 몇일되는 바람에 .3 까지 생겨서

이렇게 하나로 묶어주고 실행해서 업데이트!

$ sudo su -

# cd /var/log/apache2

# cat access.log.3 access.log.2 access.log.1 access.log > access.log.all 

# rm access.log

# mv access.log.all access.log

# vi /etc/webalizer/webalizer.conf

LogFile /var/log/apache2/access.log

# webalizer


Posted by 구차니

댓글을 달아 주세요

간략하게 정리하면 아래의 박스 하나로 정리끝!

 $ sudo apt-get install webalizer
 $ sudo vi /etc/apache2/apache2.conf
    HostnameLookups On
 $ sudo vi /etc/webalizer/webalizer.conf
    LogFile         /var/log/apache2/access.log

 $ cd /usr/share/locale/ko/LC_MESSAGES/
 $ sudo rm webalizer.mo
 $ sudo wget "http://web.suapapa.net:8080/wordpress/wp-content/uploads/2008/01/webalizer.zip"
 $ sudo unzip webalizer.zip
 $ rm webalizer.zip

 $ sudo webalizer
 $ sudo crontab -e
    0 * * * * webalizer

기본적으로 설치되는 웹어라이저는 한글이 제대로 나오지 않는다.
그러한 패치와 함께 매시간 마다 웹어라이저를 실행하여 /var/www/webalizer 에 결과 페이지를 생성하도록 설정한다.

[링크 : http://www.webalizer.org/]
    [링크 : http://pchero21.com/79]
    [링크 : http://bobbyallen.wordpress.com/2007/01/16/install-and-configure-webalizer-on-ubuntu/]

Posted by 구차니
TAG webalizer

댓글을 달아 주세요

  1. 좋은 정보 감사합니다.

    2011.12.31 11:32 [ ADDR : EDIT/ DEL : REPLY ]