flagflag  If you want to see English page, please click "English" Button at Left.
Page Top

インストール anchor.png

Page Top

Jcode.pm のインストール anchor.png

# zcat Jcode-*.tar.gz | tar xvf -
# cd Jcode-*
# perl Makefile.PL; make; make install
Page Top

 AWStatsのインストール anchor.png

  • 展開ディレクトリを /usr/local/awstats にする.
# chown -R www.www /usr/local/awstats
# cd /usr/local/awstats/wwwroot/cgi-bin
# ln -s awstats.model_jp.conf awstats.model.conf
# cd ../../tools
# perl awstats_configure.pl
-----> Define config file name to create
What is the name of your web site or profile analysis ?
Example: www.mysite.com
Example: demo
Your web site, virtual server or profile name:
> NSL

-----> Define config file path
In which directory do you plan to store your config file(s) ?
Default: /etc/awstats
Directory path to store config file(s) (Enter for default):
> /usr/local/etc/awstats
Page Top

設定 anchor.png

Page Top

Apacheの設定 anchor.png

  • httpd.conf の CustomLog を combined にする.HTTPS を動かしている場合は SSLのログ(ssl.conf)の CustomLog も combined で access_log に書き込むようにする.
#   Per-Server Logging:
#   The home of a custom SSL log file. Use this when you want a
#   compact non-error SSL logfile on a virtual host basis.
#CustomLog /usr/local/apache/logs/ssl_request_log \
#          "%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b"
CustomLog /usr/local/apache/logs/access_log combined
  • 以下の設定が自動的に apache の httpd.conf に追加される
#
# Directives to allow use of AWStats as a CGI
#
Alias /awstatsclasses "/usr/local/awstats/wwwroot/classes/"
Alias /awstatscss "/usr/local/awstats/wwwroot/css/"
Alias /awstatsicons "/usr/local/awstats/wwwroot/icon/"
ScriptAlias /awstats/ "/usr/local/awstats/wwwroot/cgi-bin/"

#
# This is to permit URL access to scripts/files in AWStats directory.
#
<Directory "/usr/local/awstats/wwwroot">
    Options None
    AllowOverride None
    Order allow,deny
    Allow from all
</Directory>
  •  apache の再起動
 
Page Top

AWStatsの設定 anchor.png

  • 設定ファイル
# vi /usr/local/etc/awstats/awstats.NSL.conf
      LogFile="/var/log/awstats_log.utf8"
      SiteDomain="www.nsl.tuis.ac.jp"
# chmod o+rx /usr/local/etc/awstats
# chmod o+r  /usr/local/etc/awstats/*
  • 結果を格納するディレクトリを作る
# mkdir /var/lib/awstats
# chown www.www /var/lib/awstats
# chmod o-rwx,g+s /var/lib/awstats
  • 最初の実行
# /usr/local/awstats/wwwroot/cgi-bin/utf8_decode.pl < /usr/local/apache/logs/access_log > /var/log/awstats_log.utf8
# /usr/local/awstats/wwwroot/cgi-bin/awstats.pl -config=NSL -update
 
Page Top

cron の設定 anchor.png

  • awstats.cron を編集して,/etc/cron.daily にコピー
  • サンプル
#! /usr/bin/perl
# 完全日本語版AWStats用サンプルcronファイル
#
# ファイルパス等は自分の環境に合わせて書き直して下さい。
# httpのログファイルをデコードした上で一時ディレクトリに格納します。
# access_log.utf8は一時的にデコードしたログを保存するファイルの名前です。  

system(" /usr/local/awstats/wwwroot/cgi-bin/utf8_decode.pl < /usr/local/apache/logs/access_log > /var/log/awstats_log.utf8");
#system(" /bin/cat < /dev/null > /usr/local/apache/logs/access_log"); 

# awstats.plが切り詰めないオリジナルのログを切り詰めます。 
open(LOG,"+</usr/local/apache/logs/access_log");
truncate(LOG,0);
close(LOG);
 
# Ver.5.0から、更新処理を別途走らせる必要ができたらしい....
system(" /usr/local/awstats/wwwroot/cgi-bin/awstats.pl -config=NSL -update > /dev/null");
#system(" /usr/local/awstats/wwwroot/cgi-bin/awstats.pl -config=NSL -update");

# awstats.plを走らせ、htmlファイルを出力します。
# 必須ではありませんが、awstats.plを直接参照させるよりも、htmlに出力して表示す
# る方が、良好なパフォーマンスが得られます。
system(" /usr/local/awstats/wwwroot/cgi-bin/awstats.pl -config=NSL -output >  /home/apache/htdocs/awstats_log/index.html");

# アクセス可能になるように出力したhtmlファイルの権限を変更
system("chown www.www /home/apache/htdocs/awstats_log/index.html");
# chmod a+rx /etc/cron.daily/awstats.cron
# mkdir /home/apache/htdocs/awstats_log
# chown www.www /home/apache/htdocs/awstats_log

トップ   凍結 差分 バックアップ 複製 名前変更 リロード   新規 ページ一覧 単語検索 最終更新   ヘルプ   最終更新のRSS 1.0 最終更新のRSS 2.0 最終更新のRSS Atom
Counter: 6005, today: 4, yesterday: 6
最終更新: 2009-09-06 (日) 12:53:14 (JST) (5345d) by iseki

サイト内 検索

ログイン

ユーザー名:

パスワード:


パスワード紛失
新規登録

サブ メニュー

ミニカレンダー

前月2024年 4月翌月
1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30
<今日>

オンライン状況

99 人のユーザが現在オンラインです。 (6 人のユーザが xpwiki を参照しています。)

登録ユーザ: 0
ゲスト: 99

もっと...

アクセスカウンタ

今日 : 4950495049504950
昨日 : 1406514065140651406514065
総計 : 2334597223345972233459722334597223345972233459722334597223345972
Powered by XOOPS Cube 2.1© 2001-2006 XOOPS Cube Project
Design by XoopsDesign.com