CentOS Stream 8
Sponsored Link

Apache httpd : ログレポート : AWStats2021/03/15

 
アクセスログレポート AWStats をインストールします。
[1] AWstats のインストールと設定です。
# EPEL, PowerTools からインストール

[root@www ~]#
dnf --enablerepo=epel,powertools -y install awstats
# [awstats.(ホスト名).conf] が自動作成されている

[root@www ~]#
vi /etc/awstats/awstats.www.srv.world.conf
# 126行目 : httpd のログフォーマットが [combined] の場合は [1]

# [common] の場合は [4]

LogFormat=1
# 157行目 : ホスト名確認 (システムのホスト名が自動設定されている)

SiteDomain="www.srv.world"
# 172行目 : レポートから除外したいドメイン名や IP アドレスを設定

HostAliases="REGEX[^.*www\.srv\.world$]"
[root@www ~]#
vi /etc/httpd/conf.d/awstats.conf
# 30行目 : 必要に応じてアクセス許可 IP 追記

# デフォルトはローカルホストのみ

Require ip 10.0.0.0/24
[root@www ~]#
systemctl restart httpd
# レポート手動出力 ( Cron により一時間毎に自動更新される )

[root@www ~]#
/usr/share/awstats/wwwroot/cgi-bin/awstats.pl -config=www.srv.world -update

Create/Update database for config "/etc/awstats/awstats.www.srv.world.conf" by AWStats version 7.8 (build 20200416)
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...
Phase 2 : Now process new records (Flush history on disk after 20000 hosts)...
Jumped lines in file: 0
Parsed lines in file: 22
 Found 0 dropped records,
 Found 0 comments,
 Found 0 blank records,
 Found 1 corrupted records,
 Found 0 old records,
 Found 21 new qualified records.
[2] アクセス許可した範囲内の任意のクライアント PC で Web ブラウザを起動し、[(サーバーのホスト名 または IP アドレス/)/awstats/awstats.pl] にアクセスすると、Apache httpd のログレポートが閲覧できます。
関連コンテンツ