AWStats extension is Advanced Web Statistics its free powerful and reporting tool. AWStats analyzing information about internet services such as who is accessing your webpages like, number of unique visitors, pages, Bandwidth usages, IP Address, Browsers and including operating system, Counties of region and its divided into Hourly, Daily, Monthly and Yearly averages.
AWStats Installation and Configuration:
Install apache server using yum command
#yum –y install httpd
Once, installation has been completed start the apache and also check whether is working on it
# /etc/init.d/httpd start
#netstat –anp | grep httpd
#netstat –anp | grep httpd
Find the httpd.conf file location for AWStats configure with this,
#whereis httpd.
httpd: /usr/sbin/httpd.worker /usr/sbin/httpd.event /usr/sbin/httpd /etc/httpd /usr/lib64/httpd /usr/include/httpd /usr/share/man/man8/httpd.8.gz
httpd: /usr/sbin/httpd.worker /usr/sbin/httpd.event /usr/sbin/httpd /etc/httpd /usr/lib64/httpd /usr/include/httpd /usr/share/man/man8/httpd.8.gz
Be ensure the httpd.conf file location is /etc/httpd/conf/httpd.conf
Download and Install AWStats,
wget http://sourceforge.net/projects/awstats/files/AWStats/7.3/awstats-7.3.tar.gz
extact the awstats usting tar command and move to under /usr/local/ path
# tar -zvxf awstats-7.3.tar.gz
# mv awstas-7.3 /usr/local/awstas
# cd /usr/local/awstats/tools
# mv awstas-7.3 /usr/local/awstas
# cd /usr/local/awstats/tools
run the below command
# perl awstats_configure.pl
----- AWStats awstats_configure 1.0 (build 20140126) (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
-----> 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):
> /etc/httpd/conf/httpd.conf
-----> Update model config file '/usr/local/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
-----> 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:
> mydomain.com
-----> 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):
> -----press enter button
-----> Create config file '/etc/awstats/awstats.mydomain.com.conf'
Config file /etc/awstats/awstats.mydomain.com.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/awstats/wwwroot/cgi-bin/awstats.pl -update -config=mydomain.com
Or if you have several config files and prefer having only one command:
/usr/local/awstats/tools/awstats_updateall.pl now
Press ENTER to continue...
A SIMPLE config file has been created: /etc/awstats/awstats.mydomain.com.conf
You should have a look inside to check and change manually main parameters.
You can then manually update your statistics for 'mydomain.com' with command:
> perl awstats.pl -update -config=mydomain.com
You can also read your statistics for 'mydomain.com' with URL:
> http://localhost/awstats/awstats.pl?config=mydomain.com
Press ENTER to finish...
the path was installed in /etc/awstats/awstats.www.mydomain.com.conf
and
/usr/local/awstats/wwwroot/cgi-bin/awstats-
----- AWStats awstats_configure 1.0 (build 20140126) (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
-----> 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):
> /etc/httpd/conf/httpd.conf
-----> Update model config file '/usr/local/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
-----> 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:
> mydomain.com
-----> 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):
> -----press enter button
-----> Create config file '/etc/awstats/awstats.mydomain.com.conf'
Config file /etc/awstats/awstats.mydomain.com.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/awstats/wwwroot/cgi-bin/awstats.pl -update -config=mydomain.com
Or if you have several config files and prefer having only one command:
/usr/local/awstats/tools/awstats_updateall.pl now
Press ENTER to continue...
A SIMPLE config file has been created: /etc/awstats/awstats.mydomain.com.conf
You should have a look inside to check and change manually main parameters.
You can then manually update your statistics for 'mydomain.com' with command:
> perl awstats.pl -update -config=mydomain.com
You can also read your statistics for 'mydomain.com' with URL:
> http://localhost/awstats/awstats.pl?config=mydomain.com
Press ENTER to finish...
the path was installed in /etc/awstats/awstats.www.mydomain.com.conf
and
/usr/local/awstats/wwwroot/cgi-bin/awstats-
The following directives added in httpd.conf file if not installed already to allow use of AWStats as a CGI.
Alias /awstatsclasses "/usr/local/awstats/wwwroot/classes/"
Alias /awstatscss "/usr/local/awstats/wwwroot/css/"
Alias /awstatsicons "/usr/local/awstats/wwwroot/icon/"
ScriptAlias /awstats/ "/usr/local/awstats/wwwroot/cgi-bin/"
Options None
AllowOverride None
Order allow,deny
Allow from all
I hope the AWStats installed successfully and location is /usr/local/awstats
Configuration:
# vi /usr/local/awstats/awstats.conf
Find the DirData :
DirData="/var/lib/awstats”
set to
DirData="/usr/local/awstats"
set to
DirData="/usr/local/awstats"
Site name :
SiteDomain="www.mydomain.com"
HostAliases="domain.com www.mydomain.com 127.0.0.1 localhost"
HostAliases="domain.com www.mydomain.com 127.0.0.1 localhost"
Next, Open the /etc/awstats/awstats.domain.com.conf update below lines,
LogFile : should give full path of your server log file (example : www.mydomain.com or access.log)
#vi /etc/awstats/awstats.domain.com.conf
Find the LogFile : LogFile=/var/log/httpd/mylog.log
to
Find the LogFile : LogFile="/etc/httpd/logs/access.log"
Finally !!!
run the awstats.pl script to update and check the status on browser,
# /usr/local/awstats/wwwroot/cgi-bin/awstats.pl -update -config=domain.com
Access AWStats in Browser:
URL : http://192.168.0.1/awstats/awstats.pl?config=mydomain.com
Schedule a cron job to update regularly,
# /var/spool/cron/root
0 12 * * * /usr/local/awstats/wwwroot/cgi-bin/awstats.pl -update -config=www.mydomain.com
Sample Output of AWStats:
# /usr/local/awstats/wwwroot/cgi-bin/awstats.pl -update -config=www.mydomain.com
Create/Update database for config "/etc/awstats/awstats.www.mydomain.com.conf" by AWStats version 7.2 (build 1.992)
From data in log file "/usr/local/nginx/logs/mydomain.com"...
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: 14354
Found 5 dropped records,
Found 0 comments,
Found 0 blank records,
Found 10 corrupted records,
Found 0 old records,
Found 14339 new qualified records.
update AWStats database
We can also configure the awstats to multiple domain name.
Comments (0)