カスタム検索
このエントリーをはてなブックマークに追加
tomo.gif (1144 ツバツイツト)line.gif (927 ツバツイツト)line.gif (927 ツバツイツト)line.gif (927 ツバツイツト)To previous pageTo home pageMailing to me

Apacheのログを解析する(日本語版) - awstats6.6

Created: 3 January 2008


ダウンロード

日本語版は以下からダウンロードします。

http://www.bflets.dyndns.org/Tools/AWStats.html

2008年1月3日に、"AWStats66_Jpn.tar.gz"(6.6)がダウンロードできました。


インストール

ダウンロードしたファイルを解凍し、"/usr/local"に移動します。

# tar zxvf AWStats66_Jpn.tar.gz

                 :

# mv AWStats66_Jpn /usr/local
# ln -s AWStats66_Jpn awstats
#

データを蓄積するフォルダを作成します。

# mkdir /var/lib/awstats


日本語の環境を準備する

Jcodeのモジュールを確認します。

# find `perl -e 'print "@INC"'` -name '*.pm' -print | grep Jcode
/usr/lib/perl5/site_perl/5.8.5/Jcode.pm
/usr/lib/perl5/site_perl/5.8.5/Jcode.pm
#

デフォルトの設定ファイルにリネームします。

# cp awstats.model_jp.conf awstats.model.conf


コンフィギュレーションする

以下の手順で、設定を行います。

# cd /usr/local/awstats/tools
# ./awstats_configure.pl

----- AWStats awstats_configure 1.0 (build 1.6) (c) Laurent Destailleur -----
This tool will help you to configure AWStats to analyze statistics for
one web server. You can try to use it to let it do all that is possible
in AWStats setup, however following the step by step manual setup
documentation (docs/index.html) is often a better idea. Above all if:
- You are not an administrator user,
- You want to analyze downloaded log files without web server,
- You want to analyze mail or ftp log files instead of web log files,
- You need to analyze load balanced servers log files,
- You want to 'understand' all possible ways to use AWStats...
Read the AWStats documentation (docs/index.html).

-----> Running OS detected: Linux, BSD or Unix
Warning: AWStats standard directory on Linux OS is '/usr/local/awstats'.
If you want to use standard directory, you should first move all content
of AWStats distribution from current directory:
/usr/local/AWStats66_Jpn
to standard directory:
/usr/local/awstats
And then, run configure.pl from this location.
Do you want to continue setup from this NON standard directory [yN] ? y

-----> Check for web server install

Enter full config file path of your Web server.
Example: /etc/httpd/httpd.conf
Example: /usr/local/apache2/conf/httpd.conf
Example: c:\Program files\apache group\apache\conf\httpd.conf
Config file path ('none' to skip web server setup):
> none

Your web server config file(s) could not be found.
You will need to setup your web server manually to declare AWStats
script as a CGI, if you want to build reports dynamically.
See AWStats setup documentation (file docs/index.html)

-----> Update model config file '/usr/local/AWStats66_Jpn/wwwroot/cgi-bin/awstats.model.conf'
File awstats.model.conf updated.

-----> Need to create a new config file ?
Do you want me to build a new AWStats config/profile
file (required if first install) [y/N] ? y

-----> 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:
> tomo

-----> 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):
> <Enter>

-----> Create config file '/etc/awstats/awstats.tomo.conf'
Config file /etc/awstats/awstats.tomo.conf created.

-----> Add update process inside a scheduler
Sorry, configure.pl does not support automatic add to cron yet.
You can do it manually by adding the following command to your cron:
/usr/local/AWStats66_Jpn/wwwroot/cgi-bin/awstats.pl -update -config=tomo
Or if you have several config files and prefer having only one command:
/usr/local/AWStats66_Jpn/tools/awstats_updateall.pl now
Press ENTER to continue... <Enter>

A SIMPLE config file has been created: /etc/awstats/awstats.tomo.conf
You should have a look inside to check and change manually main parameters.
You can then manually update your statistics for 'tomo' with command:
> perl awstats.pl -update -config=tomo
You can also build static report pages for 'tomo' with command:
> perl awstats.pl -output=pagetype -config=tomo

Press ENTER to finish...<Enter>

#


"awstats.conf"の設定を行う

コンフィグレーションで作られるファイルに、ログファイルを指定します。また、cgiやiconsの仮想ディレクトリを設定します。

        :

LogFile="(cd /var/log/httpd;cat tomo.access_log.2 tomo.access_log.1 tomo.access_log) |"

        :

DirCgi="/awstats"

        :

DirIcons="/awstatsicons"


SiteDomain="tomo.ac"

        :


Apacheの設定を行う

以下のファイルが、"/usr/loca/awstats/tools/http_conf"を確認し、コピーします。

#
# Content of this file, with correct values, can be automatically added to
# your Apache server by using the AWStats configure.pl tool.
#

#
# Directives to add to your Apache conf file to allow use of AWStats as a CGI.
# Note that path "/usr/local/awstats/" must reflect your AWStats install path.
#
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>

コピーは、以下のコマンドで行います。

# /usr/loca/awstats/tools/http_conf /etc/httpd/conf.d/awstats.conf

Apacheを再起動します。

# service httpd reload


実行してみる

エラーが出ずに、以下のように正常終了すれば成功です。

# /usr/local/awstats/wwwroot/cgi-bin/awstats.pl -config=tomo
Create/Update database for config "/etc/awstats/awstats.tomo.conf" by AWStats version 6.6 (build 1.887)
From data in log file "cat /var/log/httpd/tomo-access_log* |"...
Phase 1 : First bypass old records, searching new record...
Searching new records from beginning of log file...
Phase 2 : Now process new records (Flush history on disk after 20000 hosts)...
Jumped lines in file: 0
Parsed lines in file: 9820
Found 0 dropped records,
Found 8759 corrupted records,
Found 0 old records,
Found 1061 new qualified records.
#


Apacheで開いてみる

"output"オプションをつけて実行し、HTMLファイルを生成します。

# /usr/local/awstats/wwwroot/cgi-bin/awstats.pl -config=tomo -output > /var/www/html/awstats.tomo.html


ブラウザで確認する

以下のとおり、無事、日本語で表示できました。


To previous pageTo home pageMailing to meJump to Top of pageline.gif (927 ツバツイツト)line.gif (927 ツバツイツト)tomo.gif (1144 ツバツイツト)
カスタム検索



このエントリーをはてなブックマークに追加