awstats installation and configuration guide on linux centos
Here’s a howto/guide about awstats installation and configuration on linux:
yum -y install awstats
here’s main things installed:
/var/www/awstats
/etc/awstats
/etc/cron.hourly/00awstats
/etc/httpd/conf.d/awstats.conf
/usr/bin/awstats_buildstaticpages.pl
/usr/bin/awstats_exportlib.pl
/usr/bin/awstats_updateall.pl
/usr/bin/logresolvemerge.pl
/usr/bin/maillogconvert.pl
/usr/bin/urlaliasbuilder.pl
mv /etc/awstats/awstats.localhost.localdomain.conf /etc/awstats/awstats.mysite.conf
vi /etc/awstats/awstats.mysite.conf
LogFile=”/usr/bin/logresolvemerge.pl /var/log/httpd/*-access.log|”
#there’s a way to add gzipped log file for analyzing
#LogFile=”gzip -d </var/log/apache/access.log.gz|”
LogType=W #W is for analyzing web log files
LogFormat=1 #or use a custom log format if you don’t use the combined log format
SiteDomain=”www.yoursite.com”
AllowToUpdateStatsFromBrowser=1
cd /var/www/awstats/
chmod -R 755 /var/log/httpd #If you do not add x permission to these log files, you’ll encounter error message below when you click “Update now” in browser:
awstats Couldn’t open server log file xxxx: Permission denied
perl ./awstats.pl -config=mysite -update #or update from browser. or through logrotate(http://awstats.sourceforge.net/docs/awstats_faq.html#ROTATE) or through crontab(http://awstats.sourceforge.net/docs/awstats_faq.html#CRONTAB)
perl ./awstats.pl -config=mysite -output -staticlinks > awstats.mysite.html
Now visit http://www.yoursite.com/awstats-html/awstats.mysite.html#or through http://www.yoursite.com/awstats/awstats.pl?config=mysite(like http://www.yoursite.com/awstats/awstats.pl?month=MM&year=YYYY&output=unknownos). Reports are generated in real time from the statistics data base. If this is slow, or putting too much load on your server, consider generating static reports instead.
Here’s the httpd configuration file for awstats:
[root@doxer awstats]# cat /etc/httpd/conf.d/awstats.conf
Alias /awstats/icon/ /var/www/awstats/icon/
Alias /awstats-html/ /var/www/awstats/
ScriptAlias /awstats/ /var/www/awstats/
<Directory /var/www/awstats/>
AllowOverride All
DirectoryIndex awstats.pl
Options ExecCGI
Order allow,deny
Allow from all
</Directory>
#Alias /css/ /var/www/awstats/css/
#Alias /js/ /var/www/awstats/js/
NB:
1.If you encounter 500 internal server error, this article may be useful for you to troubleshoot http://www.doxer.org/learn-linux/resolved-awstats-500-internal-server-error-after-installation-on-centos-linux/
2.For more info, you can refer to official site here http://awstats.sourceforge.net/docs/index.html
