jump to navigation

Install Awstats on Open SUSE July 31, 2009

Posted by skleton in OpenSUSE.

Awstats adalah software pembantu analisis situs yang bisa anda gunakan untuk melihat jumlah pengunjung situs anda, aktivitasnya termasuk halaman yang dibuka, laporan atas kata kunci yang mereka gunakan pada mesin pencari hingga bisa masuk ke situs anda, dan banyak lagi laporan lainnya yang bisa anda gunakan untuk membantu anda memantau aktivitas keseluruhan situs anda. Untuk mempelajari lebih lanjut tentang Awstats silakan kunjungi situs resminya di http://awstats.sourceforge.net/.

Ok, langsung aj kita mulai installasi nya:
rudhy:~ # cd /usr/local/
rudhy:/usr/local #wget http://prdownloads.sourceforge.net/awstats/awstats-6.8.tar.gz
rudhy:/usr/local #tar -zxvf awstats-6.8.tar.gz
rudhy:/usr/local #mv awstats-6.8 awstats
rudhy:/usr/local #mv awstats /usr/local/apache2/htdocs/
rudhy:/usr/local #cd /usr/local/apache2/htdocs/tools
rudhy:/usr/local/apache2/htdocs/awstats/tools # ./awstats_configure.pl

—– AWStats awstats_configure 1.0 (build 1.8) (c) Laurent Destailleur —–
This tool will help you to configure AWStats to analyze statistics for
one web server. You can try to use it to let it do all that is possible
in AWStats setup, however following the step by step manual setup
documentation (docs/index.html) is often a better idea. Above all if:
– You are not an administrator user,
– You want to analyze downloaded log files without web server,
– You want to analyze mail or ftp log files instead of web log files,
– You need to analyze load balanced servers log files,
– You want to ‘understand’ all possible ways to use AWStats…
Read the AWStats documentation (docs/index.html).

—–> 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:
to standard directory:
And then, run configure.pl from this location.
Do you want to continue setup from this NON standard directory [yN] ? y –>ketik y

—–> Check for web server install
Found Web server Apache config file ‘/usr/local/apache2/conf/httpd.conf’

—–> Check and complete web server config file ‘/usr/local/apache2/conf/httpd.conf’
Warning: You Apache config file contains directives to write ‘common’ log files
This means that some features can’t work (os, browsers and keywords detection).
Do you want me to setup Apache to write ‘combined’ log files [y/N] ? y –>ketik y
Add ‘Alias /awstatsclasses “/usr/local/apache2/htdocs/awstats/wwwroot/classes/”‘
Add ‘Alias /awstatscss “/usr/local/apache2/htdocs/awstats/wwwroot/css/”‘
Add ‘Alias /awstatsicons “/usr/local/apache2/htdocs/awstats/wwwroot/icon/”‘
Add ‘ScriptAlias /awstats/ “/usr/local/apache2/htdocs/awstats/wwwroot/cgi-bin/”‘
Add ” directive
AWStats directives added to Apache config file.

—–> Update model config file ‘/usr/local/apache2/htdocs/awstats/wwwroot/cgi-bin/awstats.model.conf’
File awstats.model.conf updated.

—–> 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] ? y –>ketik y

—–> Define config file name to create
What is the name of your web site or profile analysis ?
Example: http://www.mysite.com
Example: demo
Your web site, virtual server or profile name:
> rudhy.swiftco.net ketik domain yg akan dimonitor traffic nya dengan awstats

—–> Define config file path
In which directory do you plan to store your config file(s) ?
Default: /etc/awstats
Directory path to store config file(s) (Enter for default):

—–> Create config file ‘/etc/awstats/awstats.rudhy.swiftco.net.conf’
Config file /etc/awstats/awstats.rudhy.swiftco.net.conf created.

—–> Restart Web server with ‘/sbin/service httpd restart’
service: no such service httpd

—–> Add update process inside a scheduler
Sorry, configure.pl does not support automatic add to cron yet.
You can do it manually by adding the following command to your cron:
/usr/local/apache2/htdocs/awstats/wwwroot/cgi-bin/awstats.pl -update -config=rudhy.swiftco.net
Or if you have several config files and prefer having only one command:
/usr/local/apache2/htdocs/awstats/tools/awstats_updateall.pl now
Press ENTER to continue…

A SIMPLE config file has been created: /etc/awstats/awstats.rudhy.swiftco.net.conf
You should have a look inside to check and change manually main parameters.
You can then manually update your statistics for ‘rudhy.swiftco.net’ with command:
> perl awstats.pl -update -config=rudhy.swiftco.net
You can also read your statistics for ‘rudhy.swiftco.net’ with URL:
> http://localhost/awstats/awstats.pl?config=rudhy.swiftco.net

Press ENTER to finish…

Script awstats_configure.pl tadi secara otomatis akan menambahkan pada file konefigurasi httpd.conf
rudhy:~ # nano /usr/local/apache2/conf/httpd.conf
# Directives to allow use of AWStats as a CGI
Alias /awstatsclasses "/var/www/html/awstats/wwwroot/classes/"
Alias /awstatscss "/var/www/html/awstats/wwwroot/css/"
Alias /awstatsicons "/var/www/html/awstats/wwwroot/icon/"
ScriptAlias /awstats/ "/var/www/html/awstats/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

Edit file konfigurasi awstats yang telah kita install pada domain kita tadi:
rudhy:~ # nano /etc/awstats/awstats.rudhy.swiftco.net.conf
LogFile="/var/log/httpd/mylog.log" menjadi LogFile="/usr/local/apache2/logs/%YYYY/%MM/%DD/rudhy.swiftco.net.access_log"
DirData="/var/lib/awstats" menjadi DirData="/home/blackbox/rudhy.swiftco.net/htdocs/awstats"
SiteDomain="rudhy.swiftco.net" -->pastikan juga domain ini telah ada d konfigurasi awstats kita

Jalankan command dibawah ini untuk update database awstats:
rudhy:~ # /usr/local/apache2/htdocs/awstats/wwwroot/cgi-bin/awstats.pl -config=rudhy.swiftco.net -update
Create/Update database for config "/etc/awstats/awstats.rudhy.swiftco.net.conf" by AWStats version 6.8 (build 1.910)
From data in log file "/usr/local/apache2"...
Phase 1 : First bypass old records, searching new record...
Searching new records from beginning of log file...
Jumped lines in file: 0
Parsed lines in file: 0
Found 0 dropped records,
Found 0 corrupted records,
Found 0 old records,
Found 0 new qualified records.

Untuk keamanan ada baik nya kita memberikan password saat akan mengakses awstats:
rudhy:~ #vi /home/blackbox/rudhy.swiftco.net/htdocs/awstats/.htaccess
pada file .htaccess isi kan baris2 dibawah ini:
AuthUserFile /home/blackbox/rudhy.swiftco.net/htdocs/awstats/.htpasswd
AuthGroupFile /dev/null
AuthName "Null"
AuthType Basic

<Limit GET>
order deny,allow
require valid-user

rudhy:~ #htpasswd -c /home/blackbox/rudhy.swiftco.net/htdocs/awstats/.htpasswd admin
New password:
Re-type new password:
Adding password for user admin

Lalu edit file httpd.conf pada bag "This is to permit URL access to scripts/files in AWStats directory"
rudhy:~ # nano /usr/local/apache2/conf/httpd.conf
<Directory "/home/blackbox/rudhy.swiftco.net/htdocs/awstats/wwwroot">
Options All
AllowOverride All
Order allow,deny
Allow from all
AuthType Basic
AuthName stats
AuthUserFile /home/blackbox/rudhy.swiftco.net/htdocs/awstats/.htpasswd
require valid-user

Lalu akses di browser anda...



No comments yet — be the first.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s