logo

Webalizerで過去ログも集計する

cd /var/lib/webalizer/

mv webalizer.current webalizer.bak

vi webalizer.hist

9 2013 17241 8375 2527 112295 9 30 4797 2927 8 2013 0 0 0 0 0 0 0 0 7 2013 0 0 0 0 0 0 0 0 ↓ 9の削除(9月分) 8 2013 0 0 0 0 0 0 0 0 7 2013 0 0 0 0 0 0 0 0 # cd /var/log/httpd

ls -l access_log*

access_log access_log.1 access_log.2 access_log.3 access_log.4 access_log.5

webalizer access_log.2 <–読み込ませたいログで一番古いログから順番に読み込ませる。

webalizer access_log.1

webalizer <–/etc/webalizer.confのファイルのLogFileパラメータの値を読み込む。

以上で過去ログの集計も可能です。

One minute to read

Webalizerのインストール

  28 #LogFile        /var/log/httpd/access_log
  29 LogFile        /var/log/httpd/inamuu.com-access.log  &lt;---追記
  43 OutputDir      /var/www/usage &lt;---必要に応じて変更

# vi /etc/httpd.conf <Directory "/var/www/usage/"> AllowOverride All

     Order deny,allow
     deny from all
     allow from IPアドレス
 &lt;/Directory&gt;

vi /var/www/usage/.htaccess

AuthUserFile /var/www/pw/.htpasswd AuthGroupFile /dev/null AuthName "Secret Area" AuthType Basic require valid-user

<Files
"^.(htpasswd|htaccess)$"> deny from all </Files> # htpasswd -c /var/www/pw/.htpasswd ユーザー名 パスワード入力 # crontab -e */3 * * * * /usr/bin/webalizer

One minute to read

Webmin

One minute to read

while文まとめ

※無限ループスクリプトになるので注意。

One minute to read