Install awstats in Debian
#apt-get install awstats
This will complete the installation
Configuring Awstats
Now you need to Run the awstats configure script located at cd /usr/share/doc/awstats/examples/awstats_configure.pl to setup awstats for the domain you want to monitor. You need to repeat the configuration process for each domain you want to monitor.
perl /usr/share/doc/awstats/examples/awstats_configure.pl
when this script starts it will prompt for some configuration questions first one is setup from non standard directory type yes and press enter

Webserver install location type /etc/apache2/httpd.conf and press enter

Need to create new config file type y and press enter

Define config file path as default one and and press enter

This will complete the configuration script setup
Now you need to set up an alias for awstats-icons in httpd.conf. Inserted it in the Aliases section. The awstats_configure.pl script adds it in the end of httpd.conf you need to comment or remove it.
Your entry for /awstats-icon/ in the Aliases section should look like:
Alias /awstats-icon/ /usr/share/awstats/icon/
<Directory /usr/share/awstats/icon>
Options None
AllowOverride None
Order allow,deny
Allow from all
</Directory>
Now you can restart apache using the following command
#/etc/init.d/apache2 reload
Now you need to configure for domain configuration file located at /etc/awstats/awstats.full-domain-name.conf and change the following parameters save and exit the file
1)LogFile="/var/log/apache/access.log"
to
LogFile="/var/log/apache2/access.log"
2)LogFormat=4
to
LogFormat=1
3)SiteDomain=" "
to
SiteDomain="your domain name"
Generate stats the first time by using the following command
#/usr/lib/cgi-bin/awstats.pl -config=awstats.full-domain-name.conf
Update for config "/etc/awstats/awstats.full-domain-name.conf"
With data in log file "/var/log/apache2/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: 1585
Found 0 dropped records,
Found 0 corrupted records,
Found 0 old records,
Found 1585 new qualified records.
You can now check the stats in your browser by point it to http://serverip/cgi-bin/awstats.pl?config=full-domain-name.You should see similar to the following screen

Cron Job Setup
If you want to get your website stats update every 5min you can use the following command
*/5 * * * * www-data [ -x /usr/lib/cgi-bin/awstats.pl -a -f /etc/awstats/awstats.conf -a -r /var/log/apache2/access.log ] && /usr/lib/cgi-bin/awstats.pl -config=full-domain-name -update >/dev/null
Possible error and Solution
When run awstats config script at the end you might see similar to the following error
Error
-----> Create config file ‘/etc/awstats/awstats.Test.conf'
Error: Failed to open ‘/usr/share/doc/awstats/examples/wwwroot/cgi-bin/awstats.model.conf' for read.
Solution
make sure you unzipped the awstats.model.conf file:
gunzip /usr/share/doc/awstats/examples/awstats.model.conf.gz
Then, edit
/usr/share/doc/awstats/examples/awstats_configure.pl
where you will find some important parameters near head of file, which are meant to be edited by package maintainers. Unfortunately this seems not to have happened for Debian.
Note:- You also may have to modify these paths in the generated apache2.conf manually afterwards.
Incoming search terms:
- awstats debian (69)
- debian awstats (35)
- awstats debian squeeze (32)
- install awstats debian squeeze (29)
- failed to open wwwroot (25)
- awstats debian squeeze missing wwwroot (24)
- apache log analyzer (23)
- error: failed to open \/usr/share/doc/awstats/examples/wwwroot/cgi-bin/awstats model conf\ for read (17)
- debian squeeze awstats (16)
- debian apache log analyzer (12)
-
http://engagemedia.org Lachlan Musicman
-
Gabriel Filion
-
http://sgautomatizacion.dynalias.com Jaime Alberto Silva
-
Daniel
-
Vinny
-
Cord Theseeker
-
Michael
-
Ray Jenson
