インストール |
[root@ns1 ~]# yum -y install awstats |
インストール: |
awstats.noarch 0:7.3-2.el7 |
依存性関連をインストールしました: |
GeoIP.x86_64 0:1.5.0-9.el7 |
perl-Business-ISBN.noarch 0:2.06-2.el7 |
perl-Business-ISBN-Data.noarch 0:20120719.001-2.el7 |
perl-CGI.noarch 0:3.63-4.el7 |
perl-Compress-Raw-Bzip2.x86_64 0:2.061-3.el7 |
perl-Compress-Raw-Zlib.x86_64 1:2.061-4.el7 |
perl-Digest.noarch 0:1.17-245.el7 |
perl-Digest-HMAC.noarch 0:1.03-5.el7 |
perl-Digest-MD5.x86_64 0:2.52-3.el7 |
perl-Digest-SHA.x86_64 1:5.85-3.el7 |
perl-Encode-Locale.noarch 0:1.03-5.el7 |
perl-FCGI.x86_64 1:0.74-8.el7 |
perl-File-Listing.noarch 0:6.04-7.el7 |
perl-Geo-IP.x86_64 0:1.43-3.el7 |
perl-HTML-Parser.x86_64 0:3.71-4.el7 |
perl-HTML-Tagset.noarch 0:3.20-15.el7 |
perl-HTTP-Cookies.noarch 0:6.01-5.el7 |
perl-HTTP-Daemon.noarch 0:6.01-5.el7 |
perl-HTTP-Date.noarch 0:6.02-8.el7 |
perl-HTTP-Message.noarch 0:6.06-6.el7 |
perl-HTTP-Negotiate.noarch 0:6.01-5.el7 |
perl-IO-Compress.noarch 0:2.061-2.el7 |
perl-IO-HTML.noarch 0:1.00-2.el7 |
perl-IO-Socket-IP.noarch 0:0.21-4.el7 |
perl-IO-Socket-SSL.noarch 0:1.94-3.el7 |
perl-LWP-MediaTypes.noarch 0:6.02-2.el7 |
perl-Net-DNS.x86_64 0:0.72-5.el7 |
perl-Net-HTTP.noarch 0:6.06-2.el7 |
perl-Net-IP.noarch 0:1.26-4.el7 |
perl-Net-LibIDN.x86_64 0:0.12-15.el7 |
perl-Net-SSLeay.x86_64 0:1.55-3.el7 |
perl-Switch.noarch 0:2.16-7.el7 |
perl-TimeDate.noarch 1:2.30-2.el7 |
perl-URI.noarch 0:1.60-9.el7 |
perl-WWW-RobotRules.noarch 0:6.02-5.el7 |
perl-libwww-perl.noarch 0:6.05-2.el7 |
完了しました! |
フォーマットの確認方法 |
[root@ns1 ~]# vi /etc/httpd/conf/httpd.conf |
198行目辺り |
LogFormat "%h %l %u %t \"%!414r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\ "" combined |
設定ファイルの編集 awstars.(ホスト名).conf |
[root@ns1 ~]# vi /etc/awstats/awstats.localhost.localdomain.conf |
# Example for IIS: |
# LogFormat = 2 |
# 122行目 Apacheのログフォーマットがcombinedの場合はそのまま[1], commonの場合は[4]一部解析ができません |
LogFormat=1 |
168行目 除外するドメイン名IPアドレスがあれば記述 |
# Example: "www.myserver.com localhost 127.0.0.1 REGEX[mydomain\.(net|org)$]" |
# |
HostAliases="localhost 127.0.0.1" |
↓ |
HostAliases="localhost 127.0.0.1 REGEX[^.*localhost$]" |
912行目変更します |
Lang="auto" |
↓ |
Lang="jp" |
設定ファイルの編集 |
[root@ns1 ~]# vi /etc/httpd/conf.d/awstats.conf |
# This is to permit URL access to scripts/files in AWStats directory. |
Alias /report "/usr/share/awstats/wwwroot/" #23行目に追記します |
<Directory "/usr/share/awstats/wwwroot"> |
Options None |
AllowOverride None |
<IfModule mod_authz_core.c> |
# Apache 2.4 |
Require local 192.168.1.0/24 |
↓ |
Require ip 192.168.1.0/24 |
</IfModule> |
<IfModule !mod_authz_core.c> |
# Apache 2.2 |
Order allow,deny |
Allow from 127.0.0.1 |
Allow from ::1 |
</IfModule> |
</Directory> |
# Additional Perl modules |
<IfModule mod_env.c> |
SetEnv PERL5LIB /usr/share/awstats/lib:/usr/share/awstats/plugins |
</IfModule> |
サービス再起動 |
[root@ns1 ~]# systemctl restart httpd |
レポートの出力をします |
[root@ns1 ~]# /usr/share/awstats/wwwroot/cgi-bin/awstats.pl -config=ns1 -update |
Create/Update database for config "/etc/awstats/awstats.ns1.conf" by AWStats version 7.3 (build 20140126) |
From data in log file "/var/log/httpd/access_log"... |
Phase 1 : First bypass old records, searching new record... |
Direct access after last parsed record (after line 123) |
Jumped lines in file: 123 |
Found 123 already parsed records. |
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. |
出力したレポートのHTML化実行をします。ns1=自ホスト名です。各自の環境に合わせてください。勿論ドメイン名もOKです。 |
[root@ns1 ~]# /usr/share/awstats/wwwroot/cgi-bin/awstats.pl -config=ns1 -output -staticlink > /usr/share/awstats/wwwroot/index.html |
自動作成済みcronの編集をします |
[root@ns1 ~]# vi /etc/cron.hourly/awstats |
2行目をコメント化します |
#!/bin/bash |
#exec /usr/share/awstats/tools/awstats_updateall.pl now -configdir="/etc/awstats" -awstatsprog="/usr/share/awstats/wwwroot/cgi-bin/awstats.pl" >/dev/null |
3、4行目に追記します |
/usr/share/awstats/wwwroot/cgi-bin/awstats.pl -config=ns1 -update > /dev/null |
/usr/share/awstats/wwwroot/cgi-bin/awstats.pl -config=ns1 -output -staticlink > /usr/share/awstats/wwwroot/index.html |
exit 0 |
テーマ:UNIX/Linux - ジャンル:コンピュータ
★CentOS7 まとめ
★Ubuntu14 まとめ
★Ubuntu12用無線アダプタ紹介
★Ubuntu12 まとめ
★Server 2008R2 まとめ
★SCCM2012R2 まとめ
★Windows10 アップグレード
★Windows7 まとめ
★Windows7 SSD まとめ
★Windows8 まとめ
★EaseUS Todo Backup Server
★Linux Destbision まとめ
★Linuxコマンド関連Index
★Zorin8.1まとめ
★Fedora17まとめ
★Fedora15まとめ
☆VB Script まとめ
★USB3.0で快適バックアップ
★リンク集・メール
・はじめての自宅サーバ構築 - Fedora/CentOS -
SCCM Backup 遠隔操作 VirtualBox FeliCaポート/パソリ ESXi
<%plugin_third_description>
<%plugin_third_content><%plugin_third_description2>