How to setup awstats in centOS


Installing awstats is little complex in centOS whereas i’ve installed awstats easily in my FC9 following this instruction

But failed to do the same in centOS. So here is the whole process to follow and setup awstats in centOS .

Step 1: Download the awstats rpm (awstats-6.6-1.el5.rf.noarch.rpm) from here and place it in your server

Step 2: Login to the server with SSH and run awstats from command prompt. To run awstats, go to that directory where you have placed the awstats rpm and type

rpm -ivh awstats-6.6-1.el5.rf.noarch.rpm

Step 3: Now go to the /etc/awstats/ directory and copy the file named awstats.localhost.localdomain.conf and paste it in the same directory with different name. The file name should be awstats.your_domain_name.conf. (let’s consider mine one is awstats.abc.conf). In order to do this, go to that specific directory and type

cp awstats.localhost.localdomain.conf /etc/awstats/awstats.Your_domain_name.conf

Step 4: Now Open that file and find the word “SiteDomain=”Localhost.Localdomain” in that file and replace the domain name with your domain name. suppose it was abc

SiteDomain = "abc"

Save that file when you are done and go back to command prompt.

Step 5: Now go to /var/www/awstats/ directory and create 2 file named

awstats062008.abc.txt (I.e: modify with current date) &

awstats062008.abc.bak (I.e: modify with current date)

Step 6: After that, run the following command which will create a html file.

perl awstats.pl -config=Your_domain_name -output -staticlinks > awstats.Your_domain_name.html

and finally run the following command in the command prompt.

perl awstats.pl -config=your_domain_name -update

Step 7: Now open a browser and in the URL and type

http://your_server_ip/awstats/awstats.pl?config=your_domain_name

Step 8: If page is not populating with proper records which indicates that your access_log is not populating properly. So open vhosts.conf file which is located in the /etc/httpd/conf.d/ direcotry and comment out 2 lines about access_log and error_log of that specific domain. Save and close that file and follow step6 again. Hope, everything will work properly now.

That’s all.

,

  1. #1 by How I Lost T h i r t y P o u n d s in Under a Month - May 6th, 2009 at 22:51

    Hi, interesting post. I have been thinking about this issue,so thanks for posting. I’ll definitely be subscribing to your blog. Keep up great writing

(will not be published)
  1. No trackbacks yet.