• Categories
    Category
  • Categories
    Category
  • News
  • Tutorials
  • Forums
  • Tags
  • Users
Tutorial Comments FAQ Related Articles

How to install AWStats on CentOS 7

2190

To install AWStats on CentOS 7

AWStats, expanded as Advanced Web Statistics, is a free and easy-to-use web analytics reporting tool which generates advanced web, streaming, FTP, or mail server statistics written using the Perl language. It is indeed one of the most widely used log analyzers. It displays the HTML reports in a nice graphical display which is easy-to-comprehend. It is really simple to install AWStats and this tutorial covers the method to install AWStats on CentOS 7.

Basic requirements
Apache web server installed.

Installing Awstats

Installing Awstats requires the prior installation of the the EPEL Repository in the following way.

[root@linuxhelp ~]# wget https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
--2017-12-06 12:32:04--  https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
Resolving dl.fedoraproject.org (dl.fedoraproject.org)... 209.132.181.24, 209.132.181.23, 209.132.181.25
Connecting to dl.fedoraproject.org (dl.fedoraproject.org)|209.132.181.24|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 15080 (15K) [application/x-rpm]
Saving to: ‘ epel-release-latest-7.noarch.rpm’ 

100%[======================================> ] 15,080      59.7KB/s   in 0.2s   

2017-12-06 12:32:10 (59.7 KB/s) - ‘ epel-release-latest-7.noarch.rpm’  saved [15080/15080]

[root@linuxhelp ~]# rpm -ivh epel-release-latest-7.noarch.rpm
Preparing...                          ################################# [100%]
    file /etc/yum.repos.d/epel-testing.repo from install of epel-release-7-11.noarch conflicts with file from package epel-release-7-9.noarch
    file /etc/yum.repos.d/epel.repo from install of epel-release-7-11.noarch conflicts with file from package epel-release-7-9.noarch

And once you are through with the installation of EPEL, you shall proceed with the installation of Awstats.

[root@linuxhelp ~]# yum install awstats
Loaded plugins: fastestmirror, langpacks
Repodata is over 2 weeks old. Install yum-cron? Or run: yum makecache fast
base                                                     | 3.6 kB     00:00     
epel/x86_64/metalink                                     | 7.9 kB     00:00     
epel                                                     | 4.7 kB     00:00     
extras                                                   | 3.4 kB     00:00     
remi-php71                                               | 2.9 kB     00:00     
remi-safe                                                | 2.9 kB     00:00     
updates                                                  | 3.4 kB     00:00     
(1/7): epel/x86_64/group_gz                                | 266 kB   00:01     
(2/7): epel/x86_64/updateinfo                              | 851 kB   00:04     
(3/7): extras/7/x86_64/primary_db                          | 130 kB   00:01     
(4/7): remi-php71/primary_db                               | 207 kB   00:02     
(5/7): remi-safe/primary_db                                | 1.1 MB   00:09     
(6/7): updates/7/x86_64/primary_db                         | 4.5 MB   00:25     
.
.
.
.
perl-Net-SSLeay.x86_64 0:1.55-6.el7                                           
  perl-Switch.noarch 0:2.16-7.el7                                               
  perl-TimeDate.noarch 1:2.30-2.el7                                             
  perl-URI.noarch 0:1.60-9.el7                                                  
  perl-WWW-RobotRules.noarch 0:6.02-5.el7                                       
  perl-libwww-perl.noarch 0:6.05-2.el7                                          

Complete!

Later, move to your host file and check if you have provided your IP address with your fully qualified domain name.

[root@www ~]# vim /etc/hosts
192.168.7.165    www.linuxhelp1.com  linuxhelp1

And then, open your awstats default configuration file, set the aliases and do the following modifications in it.

[root@www ~]# vim /etc/httpd/conf.d/awstats.conf
Alias /awstats/icon/ /usr/share/awstats/wwwroot/icon/

ScriptAlias /awstats/ /usr/share/awstats/wwwroot/cgi-bin/
< Directory /usr/share/awstats/wwwroot/cgi-bin/> 
        DirectoryIndex awstats.pl
        Options ExecCGI
        order deny,allow
        allow from all
< /Directory> 

Alias /awstatsclasses " /usr/share/awstats/wwwroot/classes/" 
Alias /awstatscss " /usr/share/awstats/wwwroot/css/" 
Alias /awstatsicons " /usr/share/awstats/wwwroot/icon/" 
ScriptAlias /awstats/ " /usr/share/awstats/wwwroot/cgi-bin/" 

Also, in that file, you need to permit URL access to scripts/files in AWStats directory. You shall do that by making the following modifications.

< Directory " /usr/share/awstats/wwwroot" > 
    Options None
    AllowOverride None
    < IfModule mod_authz_core.c> 
        # Apache 2.4    
        Require local
    < /IfModule> 
    < IfModule !mod_authz_core.c> 
        # Apache 2.2
        Order allow,deny
        Allow from 127.0.0.1
        Allow from 192.168.7.165
    < /IfModule> 
< /Directory> 

You should also edit the AWStats FQDN file with your Domain Name and Host Aliases as follows.

[root@www ~]# vim /etc/awstats/awstats.www.linuxhelp1.com.conf
SiteDomain=" www.linuxhelp1.com" 
HostAliases=" REGEX[^.*www.linuxhelp1.com$]" 

And then, you need to update your AWStats Configuration File by running the following command.

[root@www ~]# /usr/share/awstats/wwwroot/cgi-bin/awstats.pl -config=www.linuxhelp1.com &ndash update
Create/Update database for config " /etc/awstats/awstats.www.linuxhelp1.com.conf"  by AWStats version 7.6 (build 20161204)
From data in log file " /var/log/httpd/access_log" ...
Phase 1 : First bypass old records, searching new record...
Searching new records from beginning of log file...
Jumped lines in file: 0
Parsed lines in file: 0
 Found 0 dropped records,
 Found 0 comments,
 Found 0 blank records,
 Found 0 corrupted records,
 Found 0 old records,
 Found 0 new qualified records.

Once it is done, you need to restart your Apache service by making use of the following command.

[root@www ~]# systemctl restart httpd

Now you need to open your web browser and visit AWstats page by navigating to the following link: http://YourIP/awstats/awstats.pl?config=yourdomain. You will be taken to the summary page of AWStat.
browser

All the statistics are segmented based on the days and month, and are displayed graphically.
navigation

You can also check out the statistics of your site visitors.
statistics

With this, the installation of Awstats on CentOS 7 comes to an end.

Tags:
liam
Author: 

Comments ( 1 )

mohan08p
Thanks. It's really valuable guide... Cheers..!!
Add a comment

Frequently asked questions ( 5 )

Q

WHICH LOG FORMATS CAN AWSTATS ANALYZE ?

A

AWStats setup knows predefined log formats you can use to make AWStats config easier. However, you can define your own log format, that's the reason why AWStats can analyze nearly all web, wap and proxy server log files. Some FTP servers log files, Syslog or mail logs can also be analyzed.
The only requirement is "Your log file must contain required information".

Q

CAN AWSTATS BE INTEGRATED WITH PHP NUKE ?

A

The only plugin I know to integrate AWStats inside PHPNuke is here: PhpNuke addon for AWStats

Q

HOW TO USE AWSTATS WITH NO SERVER LOG FILE?

A

Because AWStats is a log analyzer, if you don't have any way to read your server log file, you have nothing to analyze and you should not be able to use AWStats. However, this is a trick that you can use to have a log file be built. You must add a tag to call a CGI script like pslogger into each of your web pages. This will allow you to have an artificial log file that can be analyzed by AWStats.

Q

WHAT IS THE LOG SIZE LIMIT AWSTATS CAN ANALYZE?

A

No. There is no limit in AWStats. This means you can use it on large log files (test were made on 10GB log files).
However your system (Operating System or Perl version) might have a limit. For example, you can experience size limit errors on files larger than 2 or 4 GB.

Q

WHICH SERVER LOG FILES OR OS ARE SUPPORTED ?

A

AWStats can works with :
All web server able to write log file with a combined log format (XLF/ELF) like Apache, a common log format (CLF) like Apache or Squid, a W3C log format like IIS 5.0 or higher, or any other log format that contains all information AWStats expect to find.
Most of all others Web/Wap/Proxy/Streaming servers.
Some FTP, Syslog or Mail log files.
Because AWStats is in Perl, it can works on all Operating Systems.

Related Tutorials in How to install AWStats on CentOS 7

Related Tutorials in How to install AWStats on CentOS 7

How To Install AnyDesk on Centos 7
How To Install AnyDesk on Centos 7
Apr 2, 2018
How to install Tiki Wiki CMS Groupware on CentOS 7
How to install Tiki Wiki CMS Groupware on CentOS 7
May 31, 2018
How to install PHP ImageMagick on CentOS 7
How to install PHP ImageMagick on CentOS 7
Nov 4, 2017
How to Upgrade and Downgrade the PHP Versions on CentOS 7.6
How to Upgrade and Downgrade the PHP Versions on CentOS 7.6
Jun 4, 2019
How to install Apache from Source Code on CentOS 7
How to install Apache from Source Code on CentOS 7
Oct 21, 2017
How to enable or disable repositories in CentOS
How to enable or disable repositories in CentOS
Mar 28, 2018
How to install AWStats on CentOS 7
How to install AWStats on CentOS 7
Dec 8, 2017
How to install Apache JMeter in CentOS 7
How to install Apache JMeter in CentOS 7
Mar 24, 2017

Related Forums in How to install AWStats on CentOS 7

Related Forums in How to install AWStats on CentOS 7

CentOS
connor class=
How To Completely Remove Apache package On CentOS 7.6
May 14, 2019
CentOS
ceriaimmaculate class=
setfacl : command not found
Jan 3, 2018
CentOS
mason class=
Error getting authority: Error initializing authority: Could not connect: No such file or directory (g-io-error-quark, 1)
Nov 20, 2018
CentOS
landon class=
Command to find SNMP Version
May 28, 2018
CentOS
arjitharon class=
cannot start minio service help
Mar 10, 2018
Apache tomcat
AadrikaAnshu class=
Cannot find ./catalina.sh The file is absent or does not have execute permission This file is needed to run this program
Jun 17, 2019
gitlab
caden class=
Insufficient space in download directory /var/cache/yum/x86_64/6/base/packages
Jul 22, 2019
OpenVAS
frank class=
Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=7&arch=x86_64&repo=os&infra=stock error was 14: curl#6 - "Could not resolve host: mirrorlist.centos.org; Unknown error"
Dec 20, 2018
Back To Top!
Rank
User
Points

Top Contributers

userNamenaveelansari
135850

Top Contributers

userNameayanbhatti
92510

Top Contributers

userNamehamzaahmed
32150

Top Contributers

1
userNamelinuxhelp
31040

Top Contributers

userNamemuhammadali
24500
Can you help Elijah ?
Remote Desktop Connection Has Stopped Working

When accessing my remote machine server using remote desktop on a windows machine I am getting this error

forum (1)

Networking
  • Routing
  • trunk
  • Netmask
  • Packet Capture
  • domain
  • HTTP Proxy
Server Setup
  • NFS
  • KVM
  • Memory
  • Sendmail
  • WebDAV
  • LXC
Shell Commands
  • Cloud commander
  • Command line archive tools
  • last command
  • Shell
  • terminal
  • Throttle
Desktop Application
  • Linux app
  • Pithos
  • Retrospect
  • Scribe
  • TortoiseHg
  • 4Images
Monitoring Tool
  • Monit
  • Apache Server Monitoring
  • EtherApe 
  • Arpwatch Tool
  • Auditd
  • Barman
Web Application
  • Nutch
  • Amazon VPC
  • FarmWarDeployer
  • Rukovoditel
  • Mirror site
  • Chef
Contact Us | Terms of Use| Privacy Policy| Disclaimer
© 2025 LinuxHelp.com All rights reserved. Linux™ is the registered trademark of Linus Torvalds. This site is not affiliated with linus torvalds in any way.