Centos 7/8
---
[root@mail ~]# yum --enablerepo=epel -y install awstats -->Centos -7
# dnf --enablerepo=epel,PowerTools -y install awstats -->Centos -8
# "awstas.(your hostname).conf" is generated automatically
# cp /etc/awstats/awstats.mail.worldcm.net.conf /etc/awstats/awstats.mail.worldcm.net.conf.BK
[root@mail ~]# vi /etc/awstats/awstats.mail.worldcm.net
# line 50: change
LogFile="/usr/share/awstats/tools/maillogconvert.pl standard < /var/log/maillog |"
# line 62: change
LogType=M
# line 122: comment out and add like follows
#LogFormat=1
LogFormat="%time2 %email %email_r %host %host_r %method %url %code %bytesd"
# line 848: change l followsike
LevelForBrowsersDetection=0
LevelForOSDetection=0
LevelForRefererAnalyze=0
LevelForRobotsDetection=0
LevelForSearchEnginesDetection=0
LevelForKeywordsDetection=0
LevelForFileTypesDetection=0
LevelForWormsDetection=0
# line 966: change like follows
ShowMonthStats=UHB
ShowDaysOfMonthStats=HB
ShowDaysOfWeekStats=HB
ShowHoursStats=HB
ShowDomainsStats=0
ShowHostsStats=HBL
ShowRobotsStats=0
ShowEMailSenders=HBML
ShowEMailReceivers=HBML
ShowSessionsStats=0
ShowPagesStats=0
ShowFileTypesStats=0
ShowOSStats=0
ShowBrowsersStats=0
ShowOriginStats=0
ShowKeyphrasesStats=0
ShowKeywordsStats=0
ShowMiscStats=0
ShowHTTPErrorsStats=0
ShowSMTPErrorsStats=1
: wq
[root@mail ~]# vi /etc/httpd/conf.d/awstats.conf
------------------------------------------------
<Directory "/usr/share/awstats/wwwroot"> Options None AllowOverride None <IfModule mod_authz_core.c> # Apache 2.4 # Require local Require all granted </IfModule>### Add this line for Passwd [ Add this line ]
<directory /usr/share/awstats/wwwroot/> AuthType Basic AuthName "AWStats Admin Access Required" AuthUserFile /usr/share/awstats/wwwroot/awstats-htpasswd require valid-user ExpiresActive On ExpiresDefault M310</directory>-------------------------------------------------
# htpasswd -c /usr/share/awstats/wwwroot/awstats-htpasswd admin
# htpasswd /usr/share/awstats/wwwroot/awstats-htpasswd accessuser
# systemctl restart httpd
URL: mail.worldcm.net/awstats/awstats.pl
[root@mail ~]# systemctl restart httpd
Update File
[root@mail ~]# /usr/share/awstats/wwwroot/cgi-bin/awstats.pl -update -config=mail.worldcm.net -configdir=/etc/awstats
# update reports manually ( it's updated automatically for hours by Cron )
# crontab -e
0 * * * * /usr/share/awstats/wwwroot/cgi-bin/awstats.pl -update -config=mail.worldcm.net -configdir=/etc/awstats
0 * * * * root /usr/share/awstats/wwwroot/cgi-bin/awstats.pl -update -config=mail.worldcm.net -configdir=/etc/awstats
Webmin Configuration-Webmin Modules-
From local file : /usr/share/awstats/tools/webmin/awstats-2.0.wbm
The logfile analysis command /usr/local/awstats/wwwroot/cgi-bin/awstats.pl was not found on your system. Maybe AWStats is not installed, or your module configuration is incorrect. # Edit
Absolute filesystem path to AWStats update statistics command: /usr/share/awstats/wwwroot/cgi-bin/awstats.pl
Absolute or relative URL path to AWStats CGI : http://mail.worldcm.net/awstats/awstats.pl
---