Monitoring Web Server dengan AWSTATS

AWASTATS

AWStats adalah singkatan dari Advanced Web Statistics. AWStats sangat powerful untuk log analyzer yang bisa digunakan untuk memonitoring web, ftp, mail dan streaming server statistics. Laporan disajikan dalam bentuk grafis dan statistik sehinnga mudah untuk dibaca.

AWStats dapat dijalankan melalui browser web CGI (Common Gateway Interface) atau langsung dari command line. AWStats ini dapat dengan cepat menganalisa log file yang besar. AWStats dapat menganalisa file log dari Apache (NCSA gabungan / XLF / ELF atau umum / CLF log format), Microsoft IIS (log W3C format), dan sebagian besar WebStar web, proxy, wap dan streaming media server serta server ftp dan mail log.

anda dapat mengunduh file awstats di http://awstats.sourceforge.net/ , untuk fitur-fitu yang ada di awstats dilahkan baca saja diwebsitenya.

Instalasi.

Setelah anda mengunduh anda extrak filenya

#tar -xzvf awstats-6.9.zip

Direktori default awstats adalah /usr/local/awstats. Jika kita melakukan ekstrak tidak pada direktori tersebut tidak masalah. Kita bisa pindahkan saja direktori hasil extrak ke /usr/local/awstats,  atau ke defaullt direktori apache ( /var/www/html).

# mv awstat-6.9 /var/www/html

Kemudian anda masuk ke dalam direktori awstat untuk mengeksekusi aplikasinya.

# cd /var/www/html/awstats/tools/

#perl awstats_configure.pl atau ./awstats_configure.pl

-—-> Running OS detected: Linux, BSD or Unix
Warning: AWStats standard directory on Linux OS is ‘/usr/local/awstats’.
If you want to use standard directory, you should first move all content
of AWStats distribution from current directory:
/var/www/html/awstats
to standard directory:
/usr/local/awstats
And then, run configure.pl from this location.
Do you want to continue setup from this NON standard directory [yN] ?

( Anda jawab dengan  Y )

—–> Check for web server install
Enter full config file path of your Web server.
Example: /etc/httpd/httpd.conf
Example: /usr/local/apache2/conf/httpd.conf
Example: c:\Program files\apache group\apache\conf\httpd.conf
Config file path (’none’ to skip web server setup):

( masukan direktori sesuai dengan konfigurasi apache yang anda miliki)

> /etc/httpd/conf/httpd.conf

—–> Need to create a new config file ?
Do you want me to build a new AWStats config/profile
file (required if first install) [y/N] ?

( jawab dengan y untuk membuat file config awstats )

-—-> Define config file name to create
What is the name of your web site or profile analysis ?
Example: www.mysite.com
Example: demo
Your web site, virtual server or profile name:

( Masukan nama domain yang anda miliki)

> www.fery.ok

A SIMPLE config file has been created: /etc/awstats/awstats.www.fery.ok.ok.conf
You should have a look inside to check and change manually main parameters.
You can then manually update your statistics for ‘www.fery.ok’ with command:
> perl awstats.pl -update -config=www.fery.ok
You can also build static report pages for ‘www.fery.ok’ with command:
> perl awstats.pl -output=pagetype -config=www.fery.ok

Press ENTER to finish…

Selanjutnya edit file /etc/awstats/awstat.www.fery.ok.conf

cocokan logfile berdasarkan distro anda masing-masing.

LogFile=”/var/log/httpd/access_log”

ubah Sitedomain sesuai dengan nama domain anda

SiteDomain=”www.fery.ok”

ubah hostalias

HostAliases=”192.168.1.52 www.fery.ok 127.0.0.1 localhost”

Ubah Dirdata sesuai dengan direktori dimana anda meletakan awstats

DirData=”/var/www/html/awstats”


kemudian cek file konfigurasi apache ( /etc/httpd/conf/httpd.conf). Kemudian ubah direktori sesuai dengan tempat awstats yang kita install tadi. dan cek juga akses mengunakan scipts cgi-bin.

#vi /etc/httpd/conf/httpd.conf

#
# Directives to allow use of AWStats as a CGI
#
Alias /awstatsclasses “/var/www/html/awstats-6.9/wwwroot/classes/”
Alias /awstatscss “/var/www/html/awstats-6.9/wwwroot/css/”
Alias /awstatsicons “/var/www/html/awstats-6.9/wwwroot/icon/”
ScriptAlias /awstats/ “/var/www/html/awstats-6.9/wwwroot/cgi-bin/”

#
# This is to permit URL access to scripts/files in AWStats directory.
#
<Directory “/var/www/html/awstats/wwwroot”>
Options None
AllowOverride None
Order allow,deny
Allow from all
</Directory>

Kemudian restart Apache anda.

Kemudian coba akses melalui browser http://localhost/awstats/awstats.pl?config=www.fery.ok

nah, dibrowser anda akan di tampilkan laporan akses website anda fiturnya mulai laporan perbulan, perhari atau perjam. ada who, navigation, referrer dan others.

AWSTATS untuk monitoring MAIL Server

Jika anda ingin memonitoring mail server anda bisa merubah konfigurasi file awstats (awstat.conf). Awstats sudah terdapat converter maillog agar bisa dibaca dan ditampilkan statistiknya, terdapat di directory tools/maillogconvert.pl

Anda masuk ke direktori awstats kemudian kopi file awstats.model.conf

# cp awstats.model.conf  awstats.mail.conf

kemudian rubah file awstats.mail.conf menjadi:

LogFile=”perl /usr/bin/maillogconvert.pl standard < /var/log/maillog |”
LogType=M
LogFormat=”%time2 %email %email_r %host %host_r %method %url %code %bytesd”

SiteDomain=”www.fery.ok”  ( rubah bagian ini sesuai dengan domain anda masing2)
LevelForBrowsersDetection=0
LevelForOSDetection=0
LevelForRefererAnalyze=0
LevelForRobotsDetection=0
LevelForWormsDetection=0
LevelForSearchEnginesDetection=0
LevelForFileTypesDetection=0
ShowMenu=1
ShowSummary=HB
ShowMonthStats=HB
ShowDaysOfMonthStats=HB
ShowDaysOfWeekStats=HB
ShowHoursStats=HB
ShowDomainsStats=0
ShowHostsStats=HBL
ShowAuthenticatedUsers=0
ShowRobotsStats=0
ShowEMailSenders=HBML
ShowEMailReceivers=HBML
ShowSessionsStats=0
ShowPagesStats=0
ShowFileTypesStats=0
ShowFileSizesStats=0
ShowBrowsersStats=0
ShowOSStats=0
ShowOriginStats=0
ShowKeyphrasesStats=0
ShowKeywordsStats=0
ShowMiscStats=0
ShowHTTPErrorsStats=0
ShowSMTPErrorsStats=1

Kemudian buat cron agar database awstat bisa selalu diupdate.

00 */1 * * * /var/www/awstats/awstats.pl -update -config=mail
00 */2 * * * /var/www/awstats/awstats.pl -update -config=localhost.localdomain

kemudian lakukan perintah

#  awstats_updateall.pl now

This entry was posted on Thursday, August 6th, 2009 at 4:25 am and is filed under Uncategorized. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

Leave a Reply