AWStatsでアクセス解析をしようと思ってインストールしたのですが
#/home/httpd/cgi-bin/awstats/awstats.pl-config=awstats.conf -update
と入力すると以下の内容が記述されてうまくいってないようなんです。
******************************************************************
Update for config "/home/httpd/cgi-bin/awstats/awstats.conf"
With data in log file "/var/log/httpd/access_log.utf8"...
Phase 1 : First bypass old records, searching new record...
Searching new records from beginning of log file...
AWStats did not find any valid log lines that match your LogFormat parameter, in the 50th first non commented lines read of your log.
Your log file /var/log/httpd/access_log.utf8 must have a bad format or LogFormat parameter setup does not match this format.
Your AWStats LogFormat parameter is:
1
This means each line in your web server log file need to have "combined log format" like this:
111.22.33.44 - - [10/Jan/2001:02:14:14 +0200] "GET / HTTP/1.1" 200 1234 "http://www.fromserver.com/from.htm" "Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)"
And this is a sample of records AWStats found in your log file (the record number 50 in your log):
220.48.240.168 - - [19/Mar/2006:06:22:20 +0900] \-" 304 - "http://uforce.ddo.jp/cgi-bin/gms/memberlist.cgi" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322)"
Setup ('/home/httpd/cgi-bin/awstats/awstats.conf' file, web server or permissions) may be wrong.
See AWStats documentation in 'docs' directory for informations on how to setup awstats.
******************************************************************
ディレクトリ構成はこのようになってます。
httpd ----- html --- index.html
|
|--- cgi-bin --- awstats --- awstats.pl
|-- awstats.conf
|-- awredir.pl
|-- awstats.model.conf
|-- awstats.mode.conf.original
|-- utf8_decode.pl
|-- icon(以下ディレクトリ)
|-- lang
|-- lib
|-- plugins
Jcodeもインストール済みです。
Jcode-2.03.tar.gzをダウンロードして解凍後インストールしました。
nkf -ed awstats.model.conf > awstats.conf で変換もしてあります。
awstats.confの編集内容はこちらに掲載されているように書き換えました。
何か良い解決策がありましたらご教授下さい。
まずエラーの内容を見て行きましょう。
考えられるのは
Your log file /var/log/httpd/access_log.utf8 must have a bad format or LogFormat parameter setup does not match this format
まずこの部分
LogFormatパラメータセットアップはこのフォーマットとマッチしていないといっています。
/var/log/httpd/にちゃんとaccess_log.utf8ができているか確認。
次にこの部分
Setup ('/home/httpd/cgi-bin/awstats/awstats.conf' file, web server or permissions) may be wrong.
See AWStats documentation in 'docs' directory for informations on how to setup awstats.
awstats.conf' file, web server or permissionsということはパーミッションが間違っている可能性があります。
アクセス権を変更を行っていないとか…
タイプミスかもしれませんが
#/home/httpd/cgi-bin/awstats/awstats.pl-config=awstats.conf -update
awstats.plの後はスペースが入ります。
この辺を確認してみればどうでしょうか?
>awstats.confの編集内容はこちらに掲載されているように書き換えました。
との事ですが、間違いもあるかもしれないので、記載した方が良いかと思いますよ。
レスありがとうございます。
遅くなりましたが、指定して頂いた部分を確認してきました。
> /var/log/httpd/にちゃんとaccess_log.utf8ができているか確認。
/var/log/httpd/にaccess_log.utf8はできていました。
> アクセス権を変更を行っていないとか…
アクセス権はrootのままではダメなのでしょうか?
他の適当なユーザーに変更すればいいのですか?
> #/home/httpd/cgi-bin/awstats/awstats.pl-config=awstats.conf -update
> awstats.plの後はスペースが入ります。
これは私のミスタイプです。
申し訳ありません。
awstats.confで修正したのは以下のところです。
-------------
LogFile="/var/log/httpd/access_log.utf8"
LogFormat=1
SiteDomain="uforce.ddo.jp"
DirCgi="/cgi-bin/awstats"
DirIcons="/cgi-bin/awstats/icon"
Lang="jp"
-------------
> Searching new records from beginning of log file...
> AWStats did not find any valid log lines that match your LogFormat parameter, in the 50th first non commented lines read of your log.
> Your log file /var/log/httpd/access_log.utf8 must have a bad format or LogFormat parameter setup does not match this format.
> Your AWStats LogFormat parameter is:
> 1
> This means each line in your web server log file need to have "combined log format" like this:
やはりログが怪しいような気がします。
翻訳ソフトで上記内容を訳すとこんな感じです。
↓
ログファイルの開始から新しいレコードを検索します…
AWStatsは、あなたのログで読まれた50番目に最初のnonコメントラインにおいてあなたのLogFormatパラメータとマッチしている少しの有効な測程線も見つけませんでした。
あなたのログファイル/バール/ログ/httpd/access_log.utf8は、悪いフォーマットを持っていなければならないか、または、LogFormatパラメータセットアップはこのフォーマットとマッチしていません。
あなたのAWStats LogFormatパラメータは下記です:
1
これは、これのような「結合されたログフォーマット」を持っているあなたのウェブサーバーログファイル必要において、1本のラインごとに意味しています:
httpd.confのログの形式は
CustomLog /var/log/httpd/access_log combined←combinedになっていますかね?
当サイトの設定では
CustomLog /var/log/httpd/access_log combined env=!nolog
返事遅くなりまして申し訳ありません
自分でいろいろ試して見たんですがうまくいきませんでした・・・
指摘していただいたhttpd.confですが
こちらのサイトを見て設定させて頂いていたので
CustomLog /var/log/httpd/access_log combined env=!nolog
という記述にしてあります