Webalizer는 요약 페이지에 2개월만 표시합니다(Ubuntu 14.04).

Webalizer는 요약 페이지에 2개월만 표시합니다(Ubuntu 14.04).

Webalizer는 시작 페이지 요약, 그래픽 개요, 이번 달 및 이전 11개월 각각에 대한 링크 목록에 12개월을 표시하는 데 사용되었습니다. 이것은 적어도 Ubuntu 10.04 및 12.04에서는 기본적으로 작동했으며 일일(월별 아님) 로그 파일을 처리하기 위해 증분 모드만 구성하면 되었습니다.

두 개의 웹사이트를 14.04로 옮긴 후 Webalizer가 요약을 망가뜨리는 것을 발견했습니다. 그래픽 개요에는 두 달만 표시되고 나머지 달에는 10개의 슬롯이 비어 있는 방식이었습니다. 링크 목록에는 동일한 두 달(이번 달과 지난 달)만 표시됩니다. 5월과 6월의 로그 데이터를 생략하면 3월과 4월을 얻게 됩니다. 다시 두 달만 얻게 됩니다.

증분 모드를 생략하고(기본 구성 파일 사용) webalizer에 30개월 분량의 로그가 포함된 단일 로그 파일을 전달했습니다. 이로 인해 webalizer는 5월 11회와 6월 1회의 요약 그래픽 및 링크 목록을 생성했습니다.

중요 사항: 월별 통계는 3개월 이상 전의 통계라도 정확해 보입니다. 2개월 이상 전 통계 항목의 URL을 직접 입력하면 됩니다.

"webalizer", "two Months", "only" 등을 조합하여 웹을 검색했는데 이와 같은 질문이 하나만 발견되었지만 답변은 없었습니다.

어떤 아이디어가 있습니까? 무엇이 잘못되었거나 내가 뭘 잘못하고 있습니까?

좋습니다. 물론 여러분은 제가 시도한 것을 더 정확하게 보고 싶으실 것이므로 제가 시도한 것에 대한 명령줄 예를 포함하겠습니다.

$ logdir=/path-to-logdir
$ ls $logdir
...
2015.0617-access.log.gz
2015.0618-access.log.gz
2015.0619-access.log.gz
$ outputdir=/path-to-webroot/statistics
$ rm $outputdir/*
$ for logfile in $logdir/*-access.log.gz;  do webalizer -r http://$hostname -n $hostname -o $outputdir $logfile;  done
... lots of verbose output about webalizer's activity
... last of it being:
Webalizer V2.23-08 (Linux 3.13.0-55-generic x86_64) locale: htm*
Using logfile /path-to-logdir/2015.0619-access.log.gz (gzip-clf)
Creating output in /path-to-webroot/statistics
Hostname for reports is 'myhostname'
Reading history file... webalizer.hist
Reading previous run data.. webalizer.current
Saving current run data... [06/19/2015 23:27:09]
Generating report for June 2015
Saving history information...
Generating summary report
20 records in 1 seconds, 20/sec
$ 

결과적으로 총 요약은 2개월에 불과했지만 월별 요약(2개월 이상인 경우에도)이 생성되었으며 수동으로 입력한 URL을 통해 액세스할 수 있습니다.

또 다른 시도(모든 데이터를 한 번에 - 비증분)는 다음과 같습니다.

$ zcat $logdir/*-access.log.gz >/tmp/access.log
$ rm $outputdir/*
$ webalizer -r http://$hostname -n $hostname -o $outputdir /tmp/access.log
... lots of verbose output just as before
$ 

비슷한 결과이지만 전체 요약에는 5월 항목이 11개, 6월 항목이 1개 있었습니다.

정확한 요약을 얻는 데 누가 도움을 줄 수 있나요?

TomTomTom님, 감사합니다.

================================================= = 편집: 일부 오타를 수정했으며 더 많은 테스트를 수행했습니다.

24시간이 넘도록 단 한 번의 답변이나 댓글도 없었습니다. 이 webalzer 관련 내용은 그다지 눈에 띄지 않는 것 같습니다. 글쎄, 이것이 내가 한 일입니다:

  • 14.04를 새로 설치하여 로그 파일을 노트북에 복사했습니다. 결과는 동일합니다.
  • 14.04의 Apache에서 생성된 로그 파일을 삭제했습니다. 결과는 동일합니다.
  • 나는 webalizer의 소스를 잡고 두 개의 서로 다른 14.04 시스템에서 컴파일했습니다. 이것은 마침내 작동합니다.

이는 Ubuntu-14.04의 webalizer 패키지가 손상되었음을 의미합니까? 이제 1년 넘게? 믿기 ​​어렵습니다.

아무도 무엇이 잘못되었는지 설명할 수 없다면 적어도 Webalizer 요약 문제를 찾는 사람들에게는 그것이 당신만의 문제가 아니라는 것을 알게 될 것입니다.

유사한 webalizer 문제를 갖고 있는 다른 사람들의 이야기를 들으면 기쁠 것입니다. 물론 누군가가 webalizer 소스 컴파일이 필요하지 않은 솔루션을 나에게 알려줄 수 있다면 더욱 기쁠 것입니다.

감사합니다!

톰톰톰

답변1

이는 알려진 버그이며 패치가 있습니다.https://bugs.launchpad.net/ubuntu/+source/webalizer/+bug/1471387

답변2

글쎄요, 저도 같은 문제가 있습니다. Fedora 상자입니다. 그리고 해결책도 없습니다. 나는 다음에서 찾은 스크립트를 기반으로 "해결 방법"을 사용합니다.http://stevehavelka.com/rebuilding-broken-webalizer-history-tcl/, 기록 파일을 다시 생성합니다. 지저분하고 복사하여 붙여넣는 스타일이지만 작동합니다. 최소 한 달 동안(즉, webalizer가 인덱스 페이지를 다시 생성하고 기록 파일을 덮어쓸 때까지):

#!/bin/sh
#Using this script is straightforward:
#
# 1. Run it within the folder that has your old webalizer files, and it produces as much historical data as it can.
# 2. Copy/paste that historical data into your webalizer.hist file, and rerun Webalizer.
# 3. That’s it!  You should have all your stats back.
#
# the next line restarts using tclsh \
exec tclsh "$0" "$@"

# first, find the right files
foreach file [lsort -decreasing [glob usage_*.html]] {

    # and get the date from the files
    regexp {usage_(\d{4})(\d\d).html} $file -> year month

    # open the file to get some data from it
    set fh [open $file r]
    set text [list]
    while { ![eof $fh] } {
        lappend text [gets $fh]
    }
    close $fh

    # now start pulling out data with Total Hits
    set idx [lsearch -glob $text {*Total Hits*}]
    regexp {<B>(\d+)</B>} [lindex $text $idx+1] -> totalHits

    # Total Files
    set idx [lsearch -glob $text {*Total Files*}]
    regexp {<B>(\d+)</B>} [lindex $text $idx+1] -> totalFiles

    # Total Unique Sites
    set idx [lsearch -glob $text {*Total Unique Sites*}]
    regexp {<B>(\d+)</B>} [lindex $text $idx+1] -> totalUniques

    # Total kB Files
    set idx [lsearch -glob $text {*Total kB Files*}]
    if { $idx == -1 } {
        set idx [lsearch -glob $text {*Total KBytes*}]
    }
    regexp {<B>(\d+)</B>} [lindex $text $idx+1] -> totalKb

    # Process days
    set first [lsearch -glob $text {*Daily Statistics for*}]
    set last [lsearch -glob $text {*Hourly Statistics for*}]
    set subtext [lrange $text $first $last]
    set dates [lsearch -glob -all -inline $subtext {<TR*><TD ALIGN=center><FONT SIZE="-1"><B>*</B></FONT></TD>}]

    # First day processed
    regexp {<B>(\d+)</B>} [lindex $dates 0] -> firstDay

    # Last day processed
    regexp {<B>(\d+)</B>} [lindex $dates end] -> lastDay

    # Total Pages
    set idx [lsearch -glob $text {*Total Pages*}]
    regexp {<B>(\d+)</B>} [lindex $text $idx+1] -> totalPages

    # Total Visits
    set idx [lsearch -glob $text {*Total Visits*}]
    regexp {<B>(\d+)</B>} [lindex $text $idx+1] -> totalVisits

    # and that's it!
    puts "[string trimleft $month 0] $year $totalHits $totalFiles $totalUniques $totalKb $firstDay $lastDay $totalPages $totalVisits"

}

명시된 대로 이 스크립트를 통계 요약이 포함된 디렉토리에 넣고 실행한 후 결과를 webalizer.hist 파일에 복사하여 붙여넣습니다. 됐어요.

이는 기록을 기록 파일에 다시 쓰는 것이 예상대로 작동하지 않음을 의미할 수 있습니다. 소스에서 어디를 봐야할지 전혀 모르기 때문에 다른 누군가가 해당 문제에 대해 더 많은 정보를 제공할 수 있기를 바랍니다. 어떤 제안이라도 환영합니다.

관련 정보