sudo apt-get install awstats
Copy the config file for new site (should name as wstats.yourdomain.ext.conf)
cp /etc/awstats/awstats.conf /etc/awstats/awstats.yourdomain.ext.conf
Open the config file, and modify these lines
#Path to access.log for your domain LogFile="/var/log/apache2/access.log" #I recommend '1' for more detailed information LogFormat=1 SiteDomain="yourdomain.ext" HostAliases="localhost 127.0.0.1 yourdomain.ext"
For running the first time use
/usr/lib/cgi-bin/awstats.pl -config=yourdomain.ext
For update
/usr/lib/cgi-bin/awstats.pl -config=yourdomain.ext -update
apache setting
<VirtualHost *:80> ServerName ***.***.***.*** DocumentRoot /var/www/ <Directory "/var/www/"> Options FollowSymLinks AllowOverride ALL Order allow,deny Allow from all </Directory> Alias /awstatsclasses/ "/usr/share/awstats/lib/" Alias /awstats-icon/ "/usr/share/awstats/icon/" Alias /awstatscss "/usr/share/doc/awstats/examples/css" ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/ ScriptAlias /awstats/ /usr/lib/cgi-bin/ Options ExecCGI -MultiViews +SymLinksIfOwnerMatch </VirtualHost>
/etc/init.d/apache2 reload
0 */3 * * * root /usr/lib/cgi-bin/awstats.pl -config=yourdomain.ext -update >/dev/null
Comment feed