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

Apacheのログを解析する実験

Modified: 4 June 2005


ダウンロード

以下からダウンロードできます。

http://awstats.sourceforge.net/

2006年7月28日に、"awstats-6.5-1.noarch.rpm"がダウンロードできました。


インストール

# rpm -ivh awstats-6.5-1.noarch.rpm 
Preparing...                ########################################### [100%]
   1:awstats                ########################################### [100%]

----- AWStats 6.5 - Laurent Destailleur -----
AWStats files have been installed in /usr/local/awstats

If first install, follow instructions in documentation
(/usr/local/awstats/docs/index.html) to setup AWStats in 3 steps:
Step 1 : Install and Setup with awstats_configure.pl (or manually)
Step 2 : Build/Update Statistics with awstats.pl
Step 3 : Read Statistics

# 


初期設定

# 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

-----> 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):
> /etc/httpd/conf/httpd.conf

-----> Check and complete web server config file '/etc/httpd/conf/httpd.conf'
  Add 'Alias /awstatsclasses "/usr/local/awstats/wwwroot/classes/"'
  Add 'Alias /awstatscss "/usr/local/awstats/wwwroot/css/"'
  Add 'Alias /awstatsicons "/usr/local/awstats/wwwroot/icon/"'
  Add 'ScriptAlias /awstats/ "/usr/local/awstats/wwwroot/cgi-bin/"'
  Add '<Directory>' directive
  AWStats directives added to Apache config file.

-----> Update model config file '/etc/awstats/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:
> yi.tomo.ac

-----> 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):
> /etc/awstats

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

-----> Restart Web server with '/sbin/service httpd restart'
httpd を停止中:                                            [  OK  ]
httpd を起動中:                                            [  OK  ]

-----> 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/awstats/wwwroot/cgi-bin/awstats.pl -update -config=yi.co-recipe.com
Or if you have several config files and prefer having only one command:
/usr/local/awstats/tools/awstats_updateall.pl now
Press ENTER to continue... <Enter>


A SIMPLE config file has been created: /etc/awstats/awstats.yi.co-recipe.com.conf
You should have a look inside to check and change manually main parameters.
You can then manually update your statistics for 'yi.co-recipe.com' with command:
> perl awstats.pl -update -config=yi.co-recipe.com
You can also read your statistics for 'yi.co-recipe.com' with URL:
> http://localhost/awstats/awstats.pl?config=yi.co-recipe.com

Press ENTER to finish...<Enter>

#

 awstats6.4の実験

ダウンロード

以下からダウンロードできます。

http://awstats.sourceforge.net/

2005年6月4日に、"awstats-6.4-1.noarch.rpm"がダウンロードできました。


インストール

# rpm -ivh awstats-6.4-1.noarch.rpm 
Preparing...                ########################################### [100%]
   1:awstats                ########################################### [100%]

----- AWStats 6.4 - Laurent Destailleur -----
AWStats files have been installed in /usr/local/awstats

If first install, follow instructions in documentation
(/usr/local/awstats/docs/index.html) to setup AWStats in 3 steps:
Step 1 : Install and Setup with awstats_configure.pl (or manually)
Step 2 : Build/Update Statistics with awstats.pl
Step 3 : Read Statistics

#


設定

設定プログラムを実行します。

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

----- AWStats awstats_configure 1.0 (build 1.4) (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

-----> 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):
> /etc/httpd/conf/httpd.conf

-----> Check and complete web server config file '/etc/httpd/conf/httpd.conf'
  Add 'Alias /awstatsclasses "/usr/local/awstats/wwwroot/classes/"'
  Add 'Alias /awstatscss "/usr/local/awstats/wwwroot/css/"'
  Add 'Alias /awstatsicons "/usr/local/awstats/wwwroot/icon/"'
  Add 'ScriptAlias /awstats/ "/usr/local/awstats/wwwroot/cgi-bin/"'
  Add '<Directory>' directive
  AWStats directives added to Apache config file.

-----> Update model config file '/etc/awstats/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:
> 192.168.0.91

-----> 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.192.168.0.91.conf'
 Config file /etc/awstats/awstats.192.168.0.91.conf created.

-----> Restart Web server with '/sbin/service httpd restart'
httpdを停止中:                                             [失敗]
httpdを起動中:                                             [  OK  ]

-----> 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/awstats/wwwroot/cgi-bin/awstats.pl -update -config=192.168.0.91
Or if you have several config files and prefer having only one command:
/usr/local/awstats/tools/awstats_updateall.pl now
Press ENTER to continue... <Enter>

A SIMPLE config file has been created: /etc/awstats/awstats.192.168.0.91.conf
You should have a look inside to check and change manually main parameters.
You can then manually update your statistics for '192.168.0.91' with command:
> perl awstats.pl -update -config=192.168.0.91
You can also read your statistics for '192.168.0.91' with URL:
> http://localhost/awstats/awstats.pl?config=192.168.0.91

Press ENTER to finish... <Enter>

#

設定ファイルを変更します。

"/etc/awstats/awstats.192.168.0.91.conf"を以下のように変更します。

            :
LogFile="/var/log/httpd/access_log"
            :

"mkdir /var/lib/awstats"を作ります。

# mkdir /var/lib/awstats


実行してみる

ログ解析を実行してみます。

以下のように、エラーがなければOKです。

# cd /usr/local/awstats/wwwroot/cgi-bin

# ./awstats.pl -config=192.168.0.91
Update for config "/etc/awstats/awstats.192.168.0.91.conf"
With data in log file "/var/log/httpd/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: 5
 Found 0 dropped records,
 Found 0 corrupted records,
 Found 0 old records,
 Found 5 new qualified records.
# 


HTMLファイルの生成

"output"オプションを付加すると、HTMLが生成されます。

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

生成されたHTMLを開くと、以下のように表示されました。

以下の画面ではデータがほとんどないので、グラフっぽくないですが。


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



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