flagflag  
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

Front page   Freeze Diff Backup Copy Rename Reload   New List of Pages Search Recent changes   Help   RSS of recent changes (RSS 1.0) RSS of recent changes (RSS 2.0) RSS of recent changes (RSS Atom)
Counter: 6043, today: 1, yesterday: 24
Last-modified: 2009-09-06 (Sun) 12:53:14 (JST) (5349d) by iseki

Site Search

Login

Username:

Password:


Lost Password?
Register now!!

Sub Menu

mini Calendar

Last MonthApr 2024Next Month
Su Mo Tu We Th Fr Sa
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
Today

Who's Online

55 user(s) are online (12 user(s) are browsing xpwiki)

Members: 0
Guests: 55

more...

Access Counter

Today : 5345534553455345
Yesterday : 1889718897188971889718897
Total : 2341894223418942234189422341894223418942234189422341894223418942
Powered by XOOPS Cube 2.1© 2001-2006 XOOPS Cube Project
Design by XoopsDesign.com