analog 6.0 のインストールログ 1. 作成とインストール gtar zxvf analog-6.0.tar.gz cd analog-6.0 emacs src/anlghead.h (HOSTNAME, HOSTURL をサイトに合わせただけ) emacs src/Makefile (コメントに合わせて、 DEFS = -DNEED_STRCMP LIBS = -lnsl -lm としただけ) make 2. 必要なファイルのセットアップ mkdir -p /center/w3/home/analog-6.0 cp -R analog analog.cfg anlgform.pl ./lang ./images /center/w3/home/analog-6.0 3. analog.cfg の修正 設定ファイルである analog.cfg に必要事項の修正 LOGFILE /usr/local/apache2/logs/access_log* HOSTNAME "[F.U.E.]" HOSTURL "http://www.fukuoka-edu.ac.jp/" LANGUAGE JAPANESE-EUC LOCALCHARTDIR ./chart/ CHARTDIR ./chart/ チャート用に cfg に合わせて chart ディレクトリを作成しておく 標準では apache のログに IPアドレスでの記録しかないので、DNS を 引いいて統計した方が良いが、analog 標準の DNS 引きは非常に遅い (数十MB 程度のログでも平気で 1000分とかかかる) ので、DNSTran というヘルパーツールを使う。そのための設定も追加。 DNS READ DNSFILE dnscache 4. DNSTran の導入 http://www.summary.net/soft/dnstran.html にある sun 用の DNSTran、 dns-sun.tar.gz は解凍すると dnstran-1.5.2 という実行ファイルしか出てこないので、Linux 用のものを解凍して出てくる dnstran.cfg を流用して設定ファイルにする(sun で使う場合は変更不要) ./dnstran /usr/local/apache2/logs/access_log* として dnscache というファイルができるのを確認。 その後、analog のテスト。 ./analog +ganalog.cfg > ./index.html 5. cron による定期運用 定期運用用のシェルスクリプトを用意してcrontab に設定。 ./dnstarn.sh として、 #!/bin/sh cd /center/w3/home/analog-6.0 ./dnstran /usr/local/apache2/logs/access_log* ./analog_log.sh として、 #!/bin/sh cd /center/w3/home/analog-6.0 ./analog +ganalog.cfg > ./index.html crontab に登録 30 2 * * 1 /center/w3/home/analog-6.0/dnstran.sh 30 4 * * 1 /center/w3/home/analog-6.0/analog_log.sh