Wednesday, December 18, 2019

How To Install AWStats (Advanced Web Statistics) on Ubuntu 18.04 with Apache

Video Tutorial - https://youtu.be/nXKevainGWI

------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

AWStats is a free powerful and featureful tool that generates advanced web, streaming, ftp or mail server statistics, graphically.
Offcial Website: https://awstats.sourceforge.io/                       
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Our Server Specification- [ Os:  Ubuntu 18.04.2 LTS Bionic Beaver 64Bit ]
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
lsb_release -cd  ; getconf LONG_BIT ; whoami ; apt update -y ; apt install -y build-essential software-properties-common curl gdebi vim wget aptitude leafpad nano git net-tools lsb-release apt-transport-https

Hostname:
sed -i 's/ubuntu/www.yourdomain.com/g' /etc/hosts ; sed -i 's/ubuntu/www.yourdomain.com/g' /etc/hostname

apt update ; apt install apache2 awstats -y
gedit /etc/awstats/awstats.conf &>/dev/null
LogFormat=1
SiteDomain="www.yourdomain.com"

cp /usr/share/doc/awstats/examples/apache.conf /etc/apache2/conf-available/awstats.conf
gedit /etc/apache2/conf-available/awstats.conf &>/dev/null

# This (hopefully) enables _all_ CGI scripts in the default directory
# Security concerns: Are you sure _all_ CGI scripts are safe?
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
Alias /awstatsclasses "/usr/share/awstats/lib/"
Alias /awstats-icon/ "/usr/share/awstats/icon/"
Alias /awstatscss "/usr/share/doc/awstats/examples/css"
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
ScriptAlias /awstats/ /usr/lib/cgi-bin/
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch

apache2ctl configtest ; ifconfig
a2enconf awstats serve-cgi-bin
a2enmod cgi
systemctl restart apache2 ; systemctl reload apache2 ; systemctl status apache2

sed -i -e "s/www-data/root/g" /etc/cron.d/awstats
sudo /usr/share/awstats/tools/update.sh
http://www.yourdomain.com/cgi-bin/awstats.pl
http://www.yourdomain.com

------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

No comments:

Post a Comment