Install and configure AWStats on Centos

Assume that you have Apache installed and it is working, you want to apply AWStats to your Centos server.

1. Install AWStats with yum.
yum install awstats
2. Edit the file named /etc/httpd/conf.d/awstats.conf with line below,

Alias /awstats/icon/ /var/www/awstats/icon/

ScriptAlias /awstats/ /var/www/awstats/

        DirectoryIndex awstats.pl
        Options ExecCGI
        order deny,allow
        allow from all

Alias /awstatsclasses "/var/www/awstats/lib/"
Alias /awstats-icon/ "/var/www/awstats/icon/"
Alias /awstatscss "/var/www/awstats/examples/css"

3. Edit the following line from /etc/awstats/awstats.localhost.localdomain.conf.

SiteDomain="domain.com"
HostAliases="www.domain.com"

4.Rename the configuration file to the correct one,
mv /etc/awstats/awstats.localhost.localdomain.conf /etc/awstats/awstats.domain.com.conf
5. Update the statistic,
/usr/bin/awstats_updateall.pl now -confdir=”/etc” -awstatsprog=”/var/www/awstats/awstats.pl”

How to access AwStats outside from cPanel

Many of the user will ask how could them access the AwStats outside cPanel since cPanel restricted them must log into the cPanel to get their information.

To get the AwStats for every of your webmaster to view and you do not need to let them access to the cPanel account, you may follow with the full step as below.

Note:
1. Assume that you are creating a subdomain name awstats.domain.com where I will use awstats.mickgenie.com

1. Download the latest stable version of AwStats as URL below. (I’ll guide you for Unix tar.gz file)
http://awstats.sourceforge.net/#DOWNLOAD
2. Extract the tar file. (according to your downloaded version)
$ tar zxf awstats-6.95.tar.gz
3. Move the all folder from the extracted file wwwroot folder to awstats.mickgenie.com subdomain folder.
4. Go to the cgi-bin folder, copy the file named awstats.model.conf to awstats.mickgenie.com.conf.
5. Open and edit the file awstats.mickgenie.com.conf.
– Edit the LogFile, change it to/usr/local/apache/domlogs/mickgenie.com.
– Edit the SiteDomain, change it to mickgenie.com.
– Edit the HostAliases, delete the REGEX[myserver\.com$] and change it mickgenie.com www.mickgenie.com. (domain.com and www.domain.com)
– Edit the DirData, from . to /home/mickgenie/tmp/awstats/ where this MUST same like your cPanel setting.
6. You have done for all.

You may now access to your awstats as URL below.
http://awstats.mickgenie.com/cgi-bin/awstats.pl?config=mickgenie.com