1. Download & Config awstats
[me@titik.org /usr/local/www/]# wget http://prdownloads.sourceforge.net/awstats/awstats-6.7.tar.gz
[me@titik.org /usr/local/www/]# tar zxvf awstats-6.7.tar.gz
[me@titik.org /usr/local/www/]# mv awstats-6.7/ awstats/
[me@titik.org /usr/local/www/]# cd awstats/tools/
[me@titik.org /usr/local/www/awstats/tools]# ./awstats_configure.pl
—– AWStats awstats_configure 1.0 (build 1.7) (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:
/usr/local/www/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] ? 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):
> /usr/local/etc/apache2/httpd.conf
—–> Check and complete web server config file ‘/usr/local/etc/apache2/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] ? y
—–> 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:
> www.titik.org
—–> 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.www.titik.org.conf’
Config file /etc/awstats/awstats.www.titik.org.conf created.
—–> 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/www/awstats/wwwroot/cgi-bin/awstats.pl -update -config=myvirtualserver
Or if you have several config files and prefer having only one command:
/usr/local/www/awstats/tools/awstats_updateall.pl now
Press ENTER to continue…
No config file was built. You can run this tool later to build as
much config/profile files as you want.
Once you have a config/profile file, for example ‘awstats.demo.conf’,
You can manually update your statistics for ‘demo’ with command:
> perl awstats.pl -update -config=demo
You can also read your statistics for ‘demo’ with URL:
> http://localhost/awstats/awstats.pl?config=demo
Press ENTER to finish…
[me@titik.org /usr/local/www/awstats/tools]#
2. Edit Apache conf and create .htaccess
[me@titik.org /usr/local/www/awstats/tools]# vi /usr/local/etc/apache2/httpd.conf
#
# Directives to add to your Apache conf file to allow use of AWStats as a CGI.
# Note that path “/usr/local/awstats/” must reflect your AWStats Installation path.
#
Alias /awstatsclasses “/usr/local/www/awstats/wwwroot/classes/”
Alias /awstatscss “/usr/local/www/awstats/wwwroot/css/”
Alias /awstatsicons “/usr/local/www/awstats/wwwroot/icon/”
ScriptAlias /awstats/ “/usr/local/www/awstats/wwwroot/cgi-bin/”
#
# This is to permit URL access to scripts/files in AWStats directory.
#
<Directory “/usr/local/www/awstats/wwwroot”>
Options None
AllowOverride authconfig
Order allow,deny
Allow from all
</Directory>
[me@titik.org /usr/local/www/awstats/tools]# vi /usr/local/www/awstats/wwwroot/.htaccess
AuthUserFile /usr/local/www/.htpasswd
AuthGroupFile /dev/null
AuthName “Awstats Login”
AuthType Basic
<Limit GET POST>
require valid-user
</Limit>
[me@titik.org /var/log/awstats]# htpasswd -b -c /usr/local/www/.htpasswd user password
3. Edit generated Awstats config file
[me@titik.org /var/log/awstats]# vi /etc/awstats/awstats.idwebhost.com.conf
Modify :
- LogFile=”/var/log/domain.com-access_log”
- DirData=”/var/log/awstats” (You need to create this directory)
- DirIcons=”/awstatsicons”
[me@titik.org /var/log/awstats]# mkdir /var/log/awstats/
[me@titik.org /var/log/awstats]# chown -R www:www /var/log/awstats/
[me@titik.org /var/log/awstats]# /usr/local/etc/rc.d/apache2 reload
4. Generate stats
[me@titik.org /usr/local/www/awstats]# /usr/local/etc/awstats/wwwroot/cgi-bin/awstats.pl -update -config=www.titik.org
Create/Update database for config “/etc/awstats/awstats.www.titik.org.conf” by AWStats version 6.7 (build 1.892)
From data in log file “/var/log/domain.com-access_log”…
Phase 1 : First bypass old records, searching new record…
Direct access after last parsed record (after line 1581102)
Jumped lines in file: 1581102
Found 1581102 already parsed records.
Parsed lines in file: 50417
Found 0 dropped records,
Found 0 corrupted records,
Found 0 old records,
Found 50417 new qualified records.
5. Test
Visit http://www.titik.org/awstats/awstats.pl?config=www.titik.org
Refferensi :
Thx to : Ipuh
















