bash$ ln -s awstats-ver.sion awstats
Go into the tools directory inside of awstats and run the command below to do several setup actions.
bash$ sudo perl awstats_configure.pl
Go to /etc/awstats and check configuration file (awstats.www.nuthawin.com.conf) the particular attention should be given to these parameters:
Configure the apache2:
Copy the httpd_conf from the awstats tools into apache2 conf.d:
bash$ cp /usr/local/awstats/tools/httpd_conf /etc/apache2/conf.d/awstats.conf
Make sure the user www-data has access to /usr/local/awstats/wwwroot directory
bash$ sudo chown -R www-data /usr/local/awstats/wwwroot
The first log analysis should be done manually from the command line since the process may be long and it's easier to solve problems when you can see the command output (if you don't have Command Line access, skip to Step 2). The AWStats create (and update) statistics database command is:
bash$ sudo perl /usr/local/awstats/wwwroot/cgi-bin/awstats.pl --config=mysite --update
where mysite must be substituted with the domain/virtual host name you selected earlier during AWStats configuration. AWStats will read the configuration file awstats.mysite.conf (or if not found, awstats.conf) and create/update its database with all summary information issued from analyzed log file.
AWStats statistics database files are saved in directory defined by the DirData parameter in configuration file. When the create/update is finished, you should see a similar result on your screen:
Create/Update database for config "/etc/awstats/awstats.www.nuthawin.com.conf" by AWStats version 6.9 (build 1.925)
From data in log file "/var/log/access.log"...
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: 850
Found 0 dropped records,
Found 1 corrupted records,
Found 0 old records,
Found 849 new qualified records.
To view the statistics from a browser, use the URL: http://www.myserver.mydomain/awstats/awstats.pl?config=mysite
For more detail installation and configuration, please follow this link: http://awstats.sourceforge.net/docs/awstats_setup.html