AWStats is a free powerful and featureful tool that generates advanced web, streaming, ftp or mail server statistics, graphically. This log analyzer works as a CGI or from command line and shows you all possible information your log contains, in few graphical web pages. It uses a partial information file to be able to process large log files, often and quickly. It can analyze log files from all major server tools like Apache log files (NCSA combined/XLF/ELF log format or common/CLF log format), WebStar, IIS (W3C log format) and a lot of other web, proxy, wap, streaming servers, mail servers and some ftp servers.

Once AWstats installed, it is time to configure it. Fortunately, it comes with nice configuration Perl script called awstats_configure.pl. This script creates default configuration file for your domain. The script takes following actions:

* Get Apache config file from registry (ask if not found)
* Change common log to combined (ask to confirm)
* Add AWStats directives
* Restart web server
* Create AWStats config file

(1) Change current working directory to /usr/local/awstats/tools, where awstats configuration tools installed by default:
# cd /usr/local/awstats/tools

(2) Make sure you know the domain’s access log file. Check apache configuration file /etc/httpd/conf/httpd.conf and look for accesslog parameter. A quick grep will help you to find out your access log file:
# grep “CustomLog” /etc/httpd/conf/httpd.conf

(3) Run awstats_configure.pl script to configure awstats for your domain

# ./awstats_configure.pl

Check and complete web server config file
/etc/httpd/conf/httpd.conf
Add ‘Alias /awstatsclasses “/usr/local/awstats/wwwroot/classes/”‘
Add ‘Alias /awstatscss “/usr/local/awstats/wwwroot/css/”‘
Add ‘Alias /awstatsicons “/usr/local/awstats/wwwroot/icon/”‘
Add ‘ScriptAlias /awstats/ “/usr/local/awstats/wwwroot/cgi-bin/”‘
Add ” directive

AWStats directives added to Apache config file.

Update model config file ‘/etc/awstats/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:
www.cyberciti.biz

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.cyberciti.biz.conf’
Config file /etc/awstats/awstats.www.cyberciti.biz.conf created.
Restart Web server with ‘/sbin/service httpd restart’
Stopping httpd: [ OK ] Starting httpd: [ OK ]

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=www.cyberciti.biz
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.www.cyberciti.biz.conf
You should have a look inside to check and change manually main parameters.
You can then manually update your statistics for ‘www.cyberciti.biz’ with command:
Press ENTER to finish…

Post By Editor (2,827 Posts)

Website: →

Connect