---
title: "Fedora 14: Install Apache log analizer, AWstats."
author: "MafiaDada"
date: "2012-01-13T16:44:19Z"
tags: []
categories: ["操作系统"]
slug: "fedora-14-install-apache-log-analizer-awstats"
draft: false
lastmod: "2012-01-13T16:44:19Z"
id: 1344889
url: "https://mafiadada.iteye.com/blog/1344889"
---

** 	Install AWstats**
<span style="color:blue">
#yum -y install awstats</span>

<span style="color:blue">#vi /etc/awstats/awstats.www03.server.world.conf  # this file is already locate (replace your server's name)
</span>
# 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)
LogFormat=1

# line 153, set your hostname
SiteDomain="www03.server.world"

# line 168: set IP address you'd like to exclude
HostAliases="localhost 127.0.0.1 REGEX REGEX"
<span style="color:blue">
#vi /etc/httpd/conf.d/awstats.conf</span>

# add Alias
Alias /report "/usr/share/awstats/wwwroot/"
<Directory "/usr/share/awstats/wwwroot">
    Options None
    AllowOverride None
    Order allow,deny
    Allow from 127.0.0.1 10.0.0.0/24 # IP address you allow
</Directory>
<span style="color:blue">
#/etc/rc.d/init.d/httpd restart</span>
Stopping httpd:
Starting httpd:

# generate reports
<span style="color:blue"># /usr/share/awstats/wwwroot/cgi-bin/awstats.pl -config=www03.server.world -update</span>
Create/Update database for config "/etc/awstats/awstats.www03.server.world.conf" by AWStats version 7.0 (build 1.964)
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: 29
Found 0 dropped records,
Found 0 comments,
Found 0 blank records,
Found 0 corrupted records,
Found 0 old records,
Found 29 new qualified records.

# generate HTML from reports
<span style="color:blue">#/usr/share/awstats/wwwroot/cgi-bin/awstats.pl -config=www03.server.world -output -staticlink > /usr/share/awstats/wwwroot/index.html</span>

# change cron's setting
<span style="color:blue">#vi /etc/cron.hourly/awstats</span>

#!/bin/bash
# make it comment
# exec /usr/share/awstats/tools/awstats_updateall.pl now -configdir="/etc/awstats" -awstatsprog="/usr/share/awstats/wwwroot/cgi-bin/awstats.pl" > /dev/null
# add
/usr/share/awstats/wwwroot/cgi-bin/awstats.pl -config=www03.server.world -update > /dev/null
/usr/share/awstats/wwwroot/cgi-bin/awstats.pl -config=www03.server.world -output -staticlink > /usr/share/awstats/wwwroot/index.html

exit 0

** 	Access to 'http://(your server's name or IP address/)/report/', then follwing sacreen is shown and it's possible to see httpd's log. **


Reference: <http://www.server-world.info/en/note?os=Fedora_14&p=httpd&f=11>