Scientific Linux 6
Sponsored Link

Apache Log Analyzer - AWstats2011/03/20

  Install Apache log analizer, AWstats.

[1] Install AWstats
[root@www ~]#
yum --enablerepo=rpmforge -y install awstats
# install from RPMforge

[root@www ~]#
cp /etc/awstats/awstats.model.conf /etc/awstats/

[root@www ~]#
vi /etc/awstats/

# line 122: change

# if your config for log format in httpd.conf is 'combined' Set here '1'

# If log-config is 'common' set here '4', but in this case, some informations can't be get (browser info and so on)


# line 153, set your hostname


# line 168: set IP address you'd like to exclude

localhost REGEX[server\.world$] REGEX[^10\.0\.0\.]

[root@www ~]#
vi /etc/httpd/conf.d/awstats.conf

Alias /awstats/icon/ /var/www/awstats/icon/
# add Alias

Alias /report /var/www/awstats/

ScriptAlias /awstats/ /var/www/awstats/
<Directory "/var/www/awstats">
    Options ExecCGI
    order deny,allow
    deny from all
    allow from
# IP address you allow


[root@www ~]#
/etc/rc.d/init.d/httpd restart

Stopping httpd:
[  OK  ]

Starting httpd:
[  OK  ]

# generate reports

[root@www ~]#
/var/www/awstats/ -update

Create/Update database for config "/etc/awstats/" 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...
Phase 2 : Now process new records (Flush history on disk after 20000 hosts)...
Jumped lines in file: 0
Parsed lines in file: 11
Found 0 dropped records,
Found 0 comments,
Found 0 blank records,
Found 0 corrupted records,
Found 0 old records,
Found 11 new qualified records.
# generate HTML from reports

[root@www ~]#
/var/www/awstats/ -output -staticlink > /var/www/awstats/index.html

# change cron's setting

[root@www ~]#
vi /etc/cron.hourly/00awstats


if [ -f /var/log/httpd/access_log ] ; then
# make it comment

exec /usr/bin/ now -configdir="/etc/awstats" -awstatsprog="/var/www/awstats/" > /dev/null
# add

/var/www/awstats/ -update > /dev/null
/var/www/awstats/ -output -staticlink > /var/www/awstats/index.html

exit 0
[2] Access to 'http://(your server's name or IP address/)/report/index.html', then follwing sacreen is shown and it's possible to see httpd's log.
Matched Content