Awstats is an Open Source Log file analyzer for advanced statistics. The installation of Awstats is pretty easy in Linux. This 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
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
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,
Step 6: Make a host Entry in /etc/hosts
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,
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
*/20 * * * * root /usr/share/awstats/wwwroot/cgi-bin/awstats.pl -config=pankaj.com -update