Fedora 14: Install Apache log analizer, AWstats.

80497312 2012-01-13

[1]InstallAWstats

[root@www03~]#yum-yinstallawstats

[root@www03~]#vi/etc/awstats/awstats.www03.server.world.conf#thisfileisalreadylocate(replaceyourserver'sname)

#line122:change

#ifyourconfigforlogformatinhttpd.confis'combined'Sethere'1'

#Iflog-configis'common'sethere'4',butinthiscase,someinformationscan'tbeget(browserinfoandsoon)

LogFormat=1

#line153,setyourhostname

SiteDomain="www03.server.world"

#line168:setIPaddressyou'dliketoexclude

HostAliases="localhost127.0.0.1REGEX[server\.world$]REGEX[^10\.0\.0\.]"

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

#addAlias

Alias/report"/usr/share/awstats/wwwroot/"

<Directory"/usr/share/awstats/wwwroot">

OptionsNone

AllowOverrideNone

Orderallow,deny

Allowfrom127.0.0.110.0.0.0/24#IPaddressyouallow

</Directory>

[root@www03~]#/etc/rc.d/init.d/httpdrestart

Stoppinghttpd:[OK]

Startinghttpd:[OK]

#generatereports

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

Create/Updatedatabaseforconfig"/etc/awstats/awstats.www03.server.world.conf"byAWStatsversion7.0(build1.964)

Fromdatainlogfile"/var/log/httpd/access_log"...

Phase1:Firstbypassoldrecords,searchingnewrecord...

Searchingnewrecordsfrombeginningoflogfile...

Phase2:Nowprocessnewrecords(Flushhistoryondiskafter20000hosts)...

Jumpedlinesinfile:0

Parsedlinesinfile:29

Found0droppedrecords,

Found0comments,

Found0blankrecords,

Found0corruptedrecords,

Found0oldrecords,

Found29newqualifiedrecords.

#generateHTMLfromreports

[root@www03~]#/usr/share/awstats/wwwroot/cgi-bin/awstats.pl-config=www03.server.world-output-staticlink>/usr/share/awstats/wwwroot/index.html

#changecron'ssetting

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

#!/bin/bash

#makeitcomment

#exec/usr/share/awstats/tools/awstats_updateall.plnow-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

exit0

[2]Accessto'http://(yourserver'snameorIPaddress/)/report/',thenfollwingsacreenisshownandit'spossibletoseehttpd'slog.

Reference:http://www.server-world.info/en/note?os=Fedora_14&p=httpd&f=11

相关推荐