Simplified AWStats Installation
It is not always possible to install AWStats according to the official AWStats installation guide. On most systems though, this simplified installation guide will work perfectly and you will have full control of all AWStats configuration parameters. Here is our AWStats installation guide for dummies like me.
These instructions are for use in an Apache and Linux hosting environment which supports Perl scripts.
1. Download AWStats
Go to the SourceForge page about AWStats, find the “Last stable” version in the “Download” area at the bottom of the page and click on the .zip link at the right to download the AWStats package.
2. Unzip the package
The unzipped package will include three directories and several subdirectories. We show the main ones here :
3. Upload to the server cgi-bin directory
Use an FTP client software (like FileZilla) to upload the complete content of the /wwwroot/cgi-bin directory of the package to the cgi-bin directory of your host.
Change the permissions of awstats.pl to 755.
To change the permissions with FileZilla, right-click on awstats.pl on the server, select File permission in the popup menu, then change the numeric value of the file attributes to 755 (is usually 644 before you change it).
4. Upload to the server public HTML directory
Depending on the host, this directory is usually called public_html or www. First create an icon subdirectory in this public HTML directory, then upload all contents of the /wwwroot/icon directory of the package to the icon directory of your host.
5. Create your own config file
The cgi-bin directory where you uploaded the files contains awstats.pl and awstats.model.conf. awstats.model.conf is an example of how your AWStats config file could look like. It also contains a lot of explanations on how to setup a config file.
Using a text editor like Notepad, create a text file that you call awstats.mysetup.conf. This will be your own config file. Here is an example of what this file must contain :
HostAliases="localhost 127.0.0.1 www.my_domain.com"
- /path_to_log/log_file.txt must be the path to the web server log file
- www.my_domain.com must be the domain name of your web site
- /the_path_to/data_dir must be the path to the directory you have chosen for the AWStats database
You should find the path to your log file in the online documentation of your host. If you don’t find it, ask their tech support.
Upload your awstats.mysetup.conf to the cgi-bin directory.
6. AWStats in the browser
From this point, you should see an empty report when calling awstats.pl in your browser with the the appropriate config file. The address bar should look like this:
and you should see this at the top of the report:
7. Updating the stats
Click on the “Update now” button to update the stats. If your get a lot of traffic, your log file is large and it will take some time before the report is updated.
8. Automatic updates
You probably don’t want to manually update the stats every day ! If cron is supported by your host, create a task that will perform the daily AWStats update. This is a typical cron command for the AWStats update:
perl /path_to/cgi-bin/awstats.pl -config=mysetup -update >/dev/null 2>&1
If your host does not support cron, you can use a free web cron service. Enter the words free web cron service in Google and you will have a broad choice of services.
The command to be used in a web cron service is :
9. Further testing
We explained here how to generate a basic but functional AWStats installation. This installation can be improved and fine tuned in several ways.
Look at the content of the awstats.model.conf file included in the AWStats package and you will discover many other options to setup AWStats according to some specific requirements.
When testing, always empty the DirData directory (AWStats database directory) before you perform an update.