Home > HA & HPC, IT Architecture > awstats installation and configuration guide on linux centos

awstats installation and configuration guide on linux centos

May 21st, 2012

Here’s a howto/guide about awstats installation and configuration on linux:

yum -y install awstats

here’s main things installed:


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

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
#Alias /css/ /var/www/awstats/css/
#Alias /js/ /var/www/awstats/js/


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

  1. October 18th, 2013 at 08:19 | #1

    Good answer back in return of this query with real arguments and describing everything regarding that.

  1. May 21st, 2012 at 02:07 | #1