• Home
  • Ubuntu 18.04
    • Whats New?
    • Upgrade Ubuntu
    • Install Java
    • Install Node.js
    • Install Docker
    • Install Git
    • Install LAMP Stack
  • Tutorials
    • AWS
    • Shell Scripting
    • Docker
    • Git
    • MongoDB
  • Funny Tools
  • FeedBack
  • Submit Article
  • About Us
TecAdmin
Menu
  • Home
  • Ubuntu 18.04
    • Whats New?
    • Upgrade Ubuntu
    • Install Java
    • Install Node.js
    • Install Docker
    • Install Git
    • Install LAMP Stack
  • Tutorials
    • AWS
    • Shell Scripting
    • Docker
    • Git
    • MongoDB
  • Funny Tools
  • FeedBack
  • Submit Article
  • About Us

How to Install AWStats (Apache Log Analyzer) on Ubuntu, Debian & LinuxMint

Written by Rahul, Updated on January 13, 2016

AWStats is a free and very powerful tool that creating statics by analyzing Apache log files, ftp or mail servers. AWStats log analyzer works on CGI or command line interface and generate graphical statics from log files.

This tutorial will help you to install AWStats Apache Log Analyzer on Ubuntu, Debian and LinuxMint systems.. This article has been tested with Ubuntu 14.04 LTS only.

Step 1 – Install AWStats & Apache Package

AWStats required Apache web server to be running. If you don’t have Apache install Use below commands to install Apache2 web server and awstats packages. It will also install all other required dependencies.

$ sudo apt-get install awstats apache2

Step 2 – Configure Apache

Now create Apache configuration file for awstats setup. Use your favorite text editor and edit a new file /etc/apache2/conf-available/awstats.conf.

$ sudo nano /etc/apache2/conf-available/awstats.conf

Now add the following configuration

ScriptAlias /awstats/ /usr/lib/cgi-bin/
Alias /awstats-icon/ /usr/share/awstats/icon/
Alias /awstatsclasses/ /usr/share/java/awstats/

<Directory "/usr/lib/cgi-bin/">
    Options None
    AllowOverride None
    <IfModule mod_authz_core.c>
        # Apache 2.4
        Require host 192.168.0.0/24
    </IfModule>
    <IfModule !mod_authz_core.c>
        # Apache 2.2
        Order allow,deny
        Allow from 192.168.0.0/24
        Allow from ::1
    </IfModule>
</Directory>

Now enable CGI module (if not enabled) and Also enable Awstats apache configuration.

$ sudo a2enmod cgi
$ sudo a2enconf awstats

Restart Apache service to reload new settings

$ sudo service apache2 restart

Step 3 – Create AWStats Configuration File

It’s required to create a configuration file for each of your website for which statics need to generate. Copy AWStats example configuration file with new name and make changes as below.

$ sudo cp /etc/awstats/awstats.conf /etc/awstats/awstats.tecadmin.net.conf
$ sudo vim /etc/awstats/awstats.tecadmin.net.conf

Update below settings in awstats.tecadmin.net.conf file

LogFile="/var/log/apache2/tecadmin.net-access_log"
SiteDomain="tecadmin.net"
HostAliases="tecadmin.net www.tecadmin.net"

Now execute following command to update logs files

$ sudo /usr/lib/cgi-bin/awstats.pl -config=tecadmin.net -update

Step 4 – Access AWStats in Browser

Use your server ip address or domain name to access AWStats statics. Change domain name at the end of url as per your settings.

https://tecadmin.net/awstats/awstats.pl?config=tecadmin.net

awstats-log

Congratulation’s! you have successfully configured AWStats for you website. Read our next article to Setup vnStat ( Web-based Network Monitoring Tool ) and Install Munin Network Monitoring Tool on your Linux system.

Share it!
Share on Facebook
Share on Twitter
Share on LinkedIn
Share on Reddit
Share on Tumblr
Share on Whatsapp
Rahul
Rahul
Connect on Facebook Connect on Twitter

I, Rahul Kumar am the founder and chief editor of TecAdmin.net. I am a Red Hat Certified Engineer (RHCE) and working as an IT professional since 2009..

3 Comments

  1. Avatar Hameed Hussain Reply
    July 19, 2020 at 10:27 am

    Hi, It is showing the dashboard but no data. Can you please hep me to resolve. Thank you

  2. Avatar labrat Reply
    May 22, 2018 at 12:19 am

    The Apache allow commands did not secure access to awstats.

    The /etc/awstats.—-.conf file has the parameter:
    AllowAccessFromWebToFollowingIPAddresses=””

    which worked nicely for me.

  3. Avatar Calx Reply
    May 5, 2017 at 12:04 am

    Congratulations and thanks Rahul.I tryed before several long tutorial probably too old to install awstats and only your work with Debian Jessy.Just at the end have to change owner of /var/lib/awstats.It is by default awstats and it require to be www-data.

Leave a Reply Cancel reply

Popular Posts

  • How to Install Python 3.9 on CentOS/RHEL 7 & Fedora 32/31 0
  • How To Install VNC Server on Ubuntu 20.04 1
  • How To Install NVM on macOS with Homebrew 0
  • (Solved) apt-add-repository command not found – Ubuntu & Debian 0
  • How to Install .NET Core on Debian 10 0
© 2013-2020 Tecadmin.net. All Rights Reserved | Terms  | Privacy Policy