Atlantic.Net Blog

How to Install AWStats on CentOS 7

AWStats, also known as “Advanced Web Statistics,” is an open-source web analytics software written in Perl. It uses log files to analyze log files from Apache, Nginx, IIS, and other web servers. AWStats is a very useful tool that helps you to monitor your website traffic, the number of visits, unique visitors, visit duration, and other data. It also displays information about visitors OS, IP, Browser, Search engine, Screen size, and keywords used to find your website.7

In this post, we will show you how to install AWStats on CentOS 7.


  • A fresh CentOS 7 server on the Atlantic.Net Cloud Platform
  • A valid domain name pointed to your server
  • A root password configured on your server

Step 1 – Create Atlantic.Net Cloud Server

First, log in to your Atlantic.Net Cloud Server. Create a new server, choosing CentOS 7 as the operating system with at least 2GB RAM. Connect to your Cloud Server via SSH and log in using the credentials highlighted at the top of the page.

Once you are logged in to your CentOS 7 server, run the following command to update your base system with the latest available packages.

yum update -y

Next, edit your /etc/hosts file and setup a fully qualified domain name as shown below:

nano /etc/hosts

Add the following line:


Step 2 – Install and Configure Apache

For this article, you will need to install the Apache webserver and create a virtual host configuration file for domain

First, install the Apache package with the following command:

yum install httpd -y

Once the installation is completed, start the Apache service and enable it to start at system reboot with the following command:

systemctl start httpd
systemctl enable httpd

Next, create a new virtual host configuration file with the following command:

nano /etc/httpd/conf.d/test.conf

Add the following content:

<VirtualHost *:80>
   ServerAdmin [email protected]
   DocumentRoot /usr/share/httpd/noindex
   DirectoryIndex index.html
   ErrorLog /var/log/httpd/test_error.log
   CustomLog /var/log/httpd/test_access.log combined


Save and close the file, then restart the Apache service to apply the changes:

systemctl restart httpd

Step 3 – Install AWStats

By default, AWStats is not available in the CentOS 7 default repo, so you will need to add EPEL repo to your system.

You can add it with the following command:

yum install epel-release -y

Next, install the AWStats with the following command:

yum install awstats -y

Once the installation is completed, you can proceed to the next step.

Step 4 – Configure AWStats

By default, AWStats all configuration files are located inside /etc/awstats/ directory. Here, you will need to create a separate configuration file for your domain

To do so, create a copy of the main configuration file to the file that matches your domain name:

cp /etc/awstats/awstats.centos7.conf /etc/awstats/

Next, edit the configuration file:

nano /etc/awstats/

Change the following lines:


Save and close the file when you are finished.

Step 5 – Generate Web Statistics from Apache Logs

Next, you will need to generate your initial statistics from the current Apache logs. You can generate it with the following command:


You should get the following output:

Create/Update database for config "/etc/awstats/" by AWStats version 7.8 (build 20200416)
From data in log file "/var/log/httpd/test_access.log"...
Phase 1 : First bypass old records, searching new record...
Searching new records from beginning of log file...
Phase 2 : Now process new records (Flush history on disk after 20000 hosts)...
Jumped lines in file: 0
Parsed lines in file: 13
 Found 0 dropped records,
 Found 0 comments,
 Found 0 blank records,
 Found 0 corrupted records,
 Found 0 old records,
 Found 13 new qualified records.

Step 6 – Configure Apache to Access AWStats

By default, the Apache webserver is configured to access AWStats only from the localhost, so you will need to edit awstats.conf file to grant access to your IP address.

nano /etc/httpd/conf.d/awstats.conf

Find the following line:

        Require local

Replace it with the following line:

        Require ip your-system-ip

Save and close the file when you are finished.

your-system-ip is the IP address of your desktop system from where you want to access AWStats. You can find the IP address of your desktop system using

Next, make sure CGI modules are enabled with the following command:

httpd -M | grep cgi

You should get the following output:

 proxy_fcgi_module (shared)
 proxy_scgi_module (shared)
 cgi_module (shared)

Next, set proper ownership to the AWStats root directory with the following command:

chown -R apache: /usr/share/awstats/wwwroot/

Next, restart the Apache service to apply the configuration changes:

systemctl restart httpd

Step 7 – Access AWStats

You can now view the Apache log statistics of your website ( using the URL http://your-server-ip/awstats/ You should see the AWStats dashboard on the following page:


In the above post, you learned how to install and configure AWStats to analyze your website log. You can now host AWStats in the production environment to monitor your website – try it on your dedicated server hosting account from Atlantic.Net.

Get started with 12 months of free cloud VPS hosting

Free Tier includes:
G3.2GB Cloud VPS Server Free to Use for One Year
50 GB of Block Storage Free to Use for One Year
50 GB of Snapshots Free to Use for One Year