The usable log file's information is extracted and put in the AWStats database.
The awstats database, which is really a collection of text files, needs to be created/updated before any statistics can be viewed. We have made the AWStats database in the statdata directory. When a database is updated AWStats creates a backup with the .bak extension. The database directory is specified in the config file's DirData entry.
Regardless of where invoked, the update process reads the log file (specified in config's LogFile entry), parses it, and creates/updates a text file in DirData. These files, awstatsXX.myname.txt are AWStats' database.
Once a monthly database file has been updated, it does not have to be updated again; it can be viewed in the main AWStats screen by selecting the corresponding Reported period month and year.
The mytools batch files use awstats_buildstaticpages.pl to create traffic reports. One of the options is -update which will update the database before creating the reports. In our case a txt file in the statdata directory is updated or created.
Enter the URL to your awstats.pl program and the name of the config you want to use.
A generic AWStats screen should show up. Set the reported
period to the month and year. Click OK. This sets the month and
year in the 'update now' link.
Click the 'update now' button at the top. If there is no update now link then check AllowToUpdateStatsFromBrowser in your config file. It should be set to 1.
Once the update occurs you will be able to see the information in the AWStats screen. It may take a while to update.
This works only if you have SSH access or you do it locally.
# perl /home/jsmith/awstats/wwwroot/cgi-bin/awstats.pl -config=mysite -update -showcorrupted
Only works if you have access to cron.
In order automatically update AWStats, you will need to create a cron job. As discussed before, I suggest updating on a daily basis:
$ crontab -e
VIM opens up. Hit "i" and enter the following line:
15 4 * * * perl $HOME/awstats/cgi-bin/awstats.pl -config=yourself -update
This cron job will update AWStats at 4.15am on a daily basis. "-config="yourself"" refers to your config file (for your dog add another cronjob).
Make sure there is a trailing empty line at the end of your crontab file (after your last command-line). Then hit "[Escape]" to leave the editing mode and type ":x" to save the file and close VIM.
If you have many config files, adding lots of cron jobs may not be very comfortable. In that case you might want to make use of "awstats_updateall.pl", a tool that comes with AWStats, by choosing this alternative cron job (without linebreaks):
15 4 * * * perl $HOME/awstats/tools/awstats_updateall.pl now -awstatsprog=$HOME/awstats/cgi-bin/awstats.pl -configdir=$HOME/awstats/cgi-bin/
Using "awstats_updateall.pl" will call "awstats.pl" and run an update for all config-files to be found in the specified directory (awstats/cgi-bin). Since in this case "awstats.pl" is being executed you need to make sure that permissions are set accordingly:
$ chmod 504 awstats/cgi-bin/awstats.pl
This will allow yourself and thus your cronjob to execute "awstats.pl".
Next: Create Traffic Report
Build Static Pages - doc on awstats_buildstaticpages.pl