Awstat automake config and domain report




Step 1 - Make automake script to generate domain config

cd /etc/awstats
cp -av awstats.model.conf awstats.www.copy.com.conf

vi awstats.www.copy.com.conf
#LogFile="/var/log/httpd/mylog.log"
#SiteDomain=""
UseFramesWhenCGI=0

First copy the page as dummy , and modify to uncomment "LogFile" , "SiteDomain" and change value of UseFramesWhenCGI=0

vi /root/domain-list.txt

aaa.com
bbb.com
ccc.com

Make the domain list file for automake domain script. It is required update again if you have new domain.

cd /root
wget linux.alanstudio.hk/awstats-makeconf.sh
chmod +x awstats-makeconf.sh

crontab -e
## awstats generate all domain config automatically daily
0 0 * * * /root/awstats-makeconf.sh &> /dev/null

/root/awstats-makeconf.sh

Download my "awstats-makeconf.sh" script and add in cronjob task. Before run the script , check the location path of apache domain logs (match with awstats-makeconf.sh). Then run once and check in /etc/awstats/




Step 2 - Make domain report scrip

wget linux.alanstudio.hk/awstats-domain-report.sh
chmod +x awstats-domain-report.sh

vi awstats-domain-report.sh
webpage="/var/www/html/awstats-domain-report.html"
serverip="123.123.123.123"

crontab -e

## awstats make domain webpage report daily
1 0 * * * /root/awstats-domain-report.sh &> /dev/null

/root/awstats-domain-report.sh

Download my "awstats-domain-report.sh" script and add in cronjob task. Edit the script to change "webpage" location and "serverip". Run once and open it in webbrowser : "http://serverip/awstats-domain-report.html"


Server is hosted by Alanstudio
Linux Operating System

Recommend screen resolution 1024 x 768 / IE / FireFox
Alan Studio © 2007 by Alan Cheung Hin Lun. All rights reserved.