Installation of Awstats For Analyzing Apache Logs On CentOS 7

Awstats is an Open Source Log file analyzer for advanced statistics. The installation of Awstats is pretty easy in LinuxThis can be used for web analytics reporting tools, suitable for data from web internet like web, streaming media, etc. so

It can also analyze the log file and provides you in an HTML format to view the report. Few Points About Awstats:

Sometimes it becomes difficult to analyze the Apache log file using command “awk“.

So I found this open-source tool to analyze the Apache log with GUI mode which saved a lot of time for me. so

Check Out: How To Force Quit Application Running on Windows 8/10

Installation of Awstats For Analysing Apache Logs:

Data is visualized in the bar and tables graph. There’s also the same tool like Goaccess which helps you to analyze the live web traffic in real-time. so

Note: You must have Virtual-Host configured and apache installed on the machine. so

Awstats is a very important tool when you’re not able to analyze the traffic on your website. So it’s a simple way to achieve that. It’s very easy to install and configured. so

You can also set the Crontab to reduce your manual work to update the database every day.

Let’s Begin Installation of Awstats 

Step 1: Install the Epel Repository

yum install epel-release -y
yum repolist

After Installing Epel Repository, You have to install the AWStats package which is available in Epel repo.

Check Out: Enable EPEL Release Repository

Step 2: Install the AWStats Package from Epel repository

yum install awstats -y

Installed: awstats.noarch 0:7.7-1.el7

Step 3: Make some changes in the Configuration file

cd /etc/awstats/

Check Out: Disable HTTP TRACE Or TRACK Request In httpd (Apache)

vim awstats.abc.com.conf

Now you need to change Domain, DirData, and HostAliases value in this file.

SiteDomain="pankaj.com"
HostAliases="www.pankaj.com"
DirData="/var/www/html/awstats"

Step 4: Create an AWStats directory

mkdir -p /var/www/html/awstats

Check Out: Create Apache Image Using Dockerfile

Change the folder permission,

chown -R apache:apache /var/www/html/awstats

Step 5: Here you have to configure the Awstats

Edit the Awstats file,

vim /etc/httpd/conf.d/awstats.conf

Step 6: Make a host Entry in /etc/hosts

Check Out: Install Varnish Cache To Speed Up Apache Performance

Step 7: You must have Selinux disabled

Once you have disabled it, to make it permanent diable you have to reboot the machine.

Step 8: Now you have to update the configuration file.

cd /usr/share/awstats/wwwroot/cgi-bin/
perl awstats.pl -config=pankaj.com -update

Step 9: Now try to access the AWStats with below URL,

http://pankaj.com/awstats/awstats.pl?config=pankaj.com

Change Pankaj.com with your Server_ip or Domain name.

Check Out: How To Hide Apache Server Name

Now you check all the traffic on your Apache server with the help of AWStats.

Set Up Crontab:

It’s recommended to create a crontab for Awstats to regularly update the database using newly created log entries. so

vim /etc/crontab
*/20 * * * * root /usr/share/awstats/wwwroot/cgi-bin/awstats.pl -config=pankaj.com -update

You’re done

Share on:

I'm the founder of Curious Viral. I hope this blog will provide you complete information about Linux Technology & I would like to share my technical knowledge with you which I have learned during this period.

Other Posts You May Like...

Leave a comment