Posted in WWW

Apache + Webalizer

Apache + Webalizer Posted on 2006 年 11 月 11 日Leave a comment

[1.] apt-get install webalizer zlib libpng gd
 
[2.] 編輯 config,如果有多個 virtual host的 http log 要區分設定檔及內容設定,必存取到同個資料庫

      複製新檔
      cp webalizer.conf webalizer.conf-ssorc.tw

      vi webalizer.conf-ssorc.tw

# Apache 登錄檔完整路徑與檔名
LogFile   /var/log/httpd/ssorc.tw-access_log

# 選擇 log file 的格式
LogType   clf

# 當資料處理完畢之後,輸出的目錄
OutputDir  /var/www/usage/ssorc.tw

# 當你的 logrotate 不是一個月一次時,必需設定
Incremental     yes    

# 輸出檔案的時候,顯示在最上方的主機名稱  
HostName       ssorc.tw

# 因為執行一個webalizer,如果想再執行第二個webalizer程式時,會因lock而無法執行,所以需分開檔案設定
HistoryName           /var/lib/webalizer/webalizer.hist-ssorc.tw
IncrementalName    /var/lib/webalizer/webalizer.current-ssorc.tw
DNSCache              /var/lib/webalizer/dns_cache.db-ssorc.tw

# 啟動 DNS lookup查詢,10個子程序來處理
DNSChildren     10

# webalizer時不輸出訊息
Quiet           yes

[3.] 執行
      webalizer -c /etc/webalizer.conf-ssorc.tw
 
[4.] 排程

      rpm安裝時,config放在/etc/底下,並有crontab在cron.daily的00webalizer(可以把這排程註解掉)
      另外在/etc/httpd/conf.d/webalizer.conf這設定裡是只允許127.0.0.1,記得更改
      rpm安裝已排程在每天了,但是可另作安排,
      因為access.log的輪替是每天的4點初,所以排程可排在這時間點之前

      vi /etc/crontab

50 3 * * * root /usr/bin/webalizer -c /etc/webalizer.conf-ssorc.tw > /dev/null 2>&1

[Q1:] Error: Skipping oversized log record
[A1:] 引用:

Just a typical (normal)webalizer error message, if it finds in the
access_log entries which are caused by attackers who use overlong
pattern access to try out vulnerabilities. Often those are just methods
to attack vulnerable IIS hosts and not Apache(2). See the access_log.1
for that entries.

Alexander

I don't think it is anything to worry about. I think it is spyware or
hackers trying to find an old exploit in a MS IIS web server. Since you
are running Apache, you have nothing to worry about in regards to the
exploit. But, you get these errors when trying to analyze the log file.

Jeff

發佈留言

發佈留言必須填寫的電子郵件地址不會公開。 必填欄位標示為 *