アクセス解析 AWStats インストール

この章を始める前に下記の設定が必要です
「RPMforge EPEL Remiリポジトリインストール」 「Apache2 インストール」
AWStatsインストール
[root@centos ~]# yum -y install awstats
confファイル編集
[root@centos ~]# rm -f /etc/awstats/awstats.localhost.localdomain.conf
[root@centos ~]# rm -f /etc/awstats/awstats.www.server-manual.com.conf
[root@centos ~]# cp /etc/awstats/awstats.model.conf /etc/awstats/awstats.www.server-manual.com.conf
[root@centos ~]# vi /etc/awstats/awstats.www.server-manual.com.conf
SiteDomain="localhost.localdomain"
↓
SiteDomain="www.server-manual.com" ←変更(サーバー名を記入)

DNSLookup=2
↓
DNSLookup=1 ←変更(DNS逆引きでホスト名を表示させる)

SkipHosts="127.0.0.1
↓
SkipHosts="127.0.0.1 REGEX[^192\.168\.1\.]" ←変更(内部ホストはスキップさせる)

Lang="auto"
↓
Lang="jp" ←変更(jaに変更)
awstats.conf編集
[root@centos ~]# vi /etc/httpd/conf.d/awstats.conf
<Directory /var/www/awstats/>
    DirectoryIndex awstats.pl
    Options ExecCGI
    AllowOverride All ←追加(.htaccessを許可)
    order deny,allow
    deny from all
    allow from 127.0.0.1
    ↓
    allow from all ←変更(アクセスを許可)
</Directory>
Basic認証設置
[root@centos ~]# /usr/bin/htpasswd -c /var/www/awstats/.htpasswd user_name
New password: user_pass ←パスワード入力
Re-type new password: user_pass ←パスワード再入力
Adding password for user user_name
[root@centos ~]# vi /var/www/awstats/.htaccess
↓下記を記入
AuthType Basic
AuthName "Please Enter Your Password"
AuthUserFile /var/www/awstats/.htpasswd
Require valid-user
Apache再起動
[root@centos ~]# /etc/rc.d/init.d/httpd reload
データファイル作成
[root@centos ~]# /usr/bin/awstats_updateall.pl now -awstatsprog=/var/www/awstats/awstats.pl
Running '"/var/www/awstats/awstats.pl" -update -config=www.server-manual.com -configdir="/etc/awstats"' to update config www.server-manual.com
Create/Update database for config "/etc/awstats/awstats.www.server-manual.com.conf" by AWStats version 7.0 (build 1.971)
From 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...
Jumped lines in file: 0
Parsed lines in file: 0
 Found 0 dropped records,
 Found 0 comments,
 Found 0 blank records,
 Found 0 corrupted records,
 Found 0 old records,
 Found 0 new qualified records.
ブラウザで確認 (http://www.ドメイン名/awstats/awstats.pl にアクセス)

Home PageTop