AWstats from static to dynamic

it doenst work

even worse:

our stats stopped updating every night.

Good luck with limited support of DA.
 
Anyone found a proper solution for this yet ?

We used to supply the awstats plugin with the dynamic version with new servers, and now the customers that upgrade to a newer server with a clean install or order a second server complain when it comes to the limited awstats functionality included in Directadmin.

Same goes for hosting customers that get a new hosting account on another server with the included awstats..

And to be honest, I can't blame them, the included awstats lacks a lot of the nifty functions that come with the dynamic install..
 
I spent hours searching the internet and debugging the server (.sh files etc.) but no solution.

We could say there is a lack of support of DA.
 
You can still use the plugin for the dynamic awstats. Problem solved.
 
For me all works perfect :)
I just follow the Marshall install, with the change I made.

this:
cd /usr/local/directadmin/scripts
./awstats.sh

cd /usr/local/awstats/wwwroot/cgi-bin
nano .htaccess

Options +ExecCGI
AddHandler cgi-script pl
DirectoryIndex awstats.pl
AuthGroupFile /dev/null
AuthName "awstats"
AuthType basic
AuthUserFile /home/USER/domains/DOMAIN/.htpasswd/public_html/awstats/.htpasswd
require valid-user

nano awstats.model.conf
change:
AllowFullYearView=2
with:
AllowFullYearView=3

change:
AllowAccessFromWebToAuthenticatedUsersOnly=0
with:
AllowAccessFromWebToAuthenticatedUsersOnly=1

cp awstats.pl awstats.pl_bak
nano awstats.pl
change:
else {
@PossibleConfigDir = (
"$DIR", "/etc/awstats",
"/usr/local/etc/awstats", "/etc",
"/etc/opt/awstats"
);
}

with:
else {
@PossibleConfigDir = (
"$DIR", "/etc/awstats",
"/usr/local/etc/awstats", "/etc",
"/etc/opt/awstats", "../../awstats/.data"
);
}
$SiteConfig =~ s/^www\.//;

cd /usr/local/directadmin/scripts/custom
chown diradmin.diradmin awstats_process.sh
wget http://www.pejoo.net/awstats_process.sh
chmod 0700 awstats_process.sh
chown diradmin:diradmin awstats_process.sh
nano awstats_process.sh
change:
if [ ! -e ${DATA_DIR} ]; then
mkdir -p ${DATA_DIR}
chmod 755 ${STATS_DIR}
chmod 711 ${DATA_DIR}
fi

cp -f ${MODEL} ${CONFIG}
chmod 644 ${CONFIG}
perl -pi -e "s#LogFile=\"/var/log/httpd/mylog.log\"#LogFile=\"${LOG}\"#" ${CONFIG}
perl -pi -e "s#SiteDomain=\"\"#SiteDomain=\"${DOMAIN}\"#" ${CONFIG}
perl -pi -e "s#DirData=\".\"#DirData=\"${DATA_DIR}\"#" ${CONFIG}
perl -pi -e "s#DirCgi=\"/cgi-bin\"#DirCgi=\/awstats\"#" ${CONFIG}
perl -pi -e "s#DirIcons=\"/icon\"#DirIcons=\"icon\"#" ${CONFIG}
perl -pi -e "s#ValidHTTPCodes=\"200 304\"#ValidHTTPCodes=\"200 304 206\"#" ${CONFIG}
perl -pi -e "s#DNSLookup=2#DNSLookup=1#" ${CONFIG}
perl -pi -e "s#\#LoadPlugin=\"geoip GEOIP_STANDARD /pathto/GeoIP.dat\"#LoadPlugin=\"geoip GEOIP_STANDARD /var/lib/GeoIP/GeoIP.dat\"#" ${CONFIG}

mkdir -p ${WEBDIR}
cp -Rp ${AWSTATS}/wwwroot/icon ${WEBDIR}
cp -Rp ${AWSTATS}/wwwroot/cgi-bin/lib ${WEBDIR}
cp -Rp ${AWSTATS}/wwwroot/cgi-bin/lang ${WEBDIR}
cp -Rp ${AWSTATS}/wwwroot/cgi-bin/plugins ${WEBDIR}
cp -fp ${AWSTATS}/wwwroot/cgi-bin/awstats.pl ${WEBDIR}
cp -fp ${AWSTATS}/wwwroot/cgi-bin/.htaccess ${WEBDIR}

chown -R ${USER}:${USER} ${WEBDIR}
chown -R root:${ROOTGRP} ${STATS_DIR}
with:
if [ ! -e ${DATA_DIR} ]; then
mkdir -p ${DATA_DIR}
fi
chmod 755 ${STATS_DIR}
chmod 755 ${DATA_DIR}

cp -f ${MODEL} ${CONFIG}
chmod 644 ${CONFIG}
perl -pi -e "s#LogFile=\"/var/log/httpd/mylog.log\"#LogFile=\"${LOG}\"#" ${CONFIG}
perl -pi -e "s#SiteDomain=\"\"#SiteDomain=\"${DOMAIN}\"#" ${CONFIG}
perl -pi -e "s#AllowAccessFromWebToFollowingAuthenticatedUsers=\"\"#AllowAccessFromWebToFollowingAuthenticatedUsers=\"${USER}\"#" ${CONFIG}
perl -pi -e "s#DirData=\".\"#DirData=\"${DATA_DIR}\"#" ${CONFIG}
perl -pi -e "s#DirCgi=\"/cgi-bin\"#DirCgi=\/awstats\"#" ${CONFIG}
perl -pi -e "s#DirIcons=\"/icon\"#DirIcons=\"icon\"#" ${CONFIG}
perl -pi -e "s#ValidHTTPCodes=\"200 304\"#ValidHTTPCodes=\"200 304 206\"#" ${CONFIG}
perl -pi -e "s#DNSLookup=2#DNSLookup=1#" ${CONFIG}
perl -pi -e "s#\#LoadPlugin=\"geoip GEOIP_STANDARD /pathto/GeoIP.dat\"#LoadPlugin=\"geoip GEOIP_STANDARD /var/lib/GeoIP/GeoIP.dat\"#" ${CONFIG}

mkdir -p ${WEBDIR}
cp -Rp ${AWSTATS}/wwwroot/icon ${WEBDIR}
cp -Rp ${AWSTATS}/wwwroot/cgi-bin/lib ${WEBDIR}
cp -Rp ${AWSTATS}/wwwroot/cgi-bin/lang ${WEBDIR}
cp -Rp ${AWSTATS}/wwwroot/cgi-bin/plugins ${WEBDIR}
cp -fp ${AWSTATS}/wwwroot/cgi-bin/awstats.pl ${WEBDIR}
cp -fp ${AWSTATS}/wwwroot/cgi-bin/.htaccess ${WEBDIR}

perl -pi -e "s#AuthUserFile /home/USER/domains/DOMAIN/.htpasswd/public_html/awstats/.htpasswd#AuthUserFile ${UHOME}/domains/${DOMAIN}/.htpasswd/public_html/awstats/.htpasswd#" ${WEBDIR}/.htaccess
mkdir -p ${UHOME}/domains/${DOMAIN}/.htpasswd/public_html/awstats
cat /etc/shadow | grep ${USER} > ${UHOME}/domains/${DOMAIN}/.htpasswd/public_html/awstats/.htpasswd
echo -e "/domains/${DOMAIN}/public_html/awstats" >> ${UHOME}/domains/${DOMAIN}/.htpasswd/.protected.list

chown -R ${USER}:${USER} ${UHOME}/domains/${DOMAIN}/.htpasswd/public_html
chown -R ${USER}:${USER} ${WEBDIR}
chown -R root:${ROOTGRP} ${STATS_DIR}
chmod 755 ${WEBDIR}/awstats.pl

change:
#/usr/bin/perl ${AWSTATS}/tools/awstats_buildstaticpages.pl -config=${DOMAIN} -configdir=${DATA_DIR} -update -diricons=icon -awstatsprog=${AWSTATS}/cgi-bin/awstats.pl -dir=${STATS_DIR} -builddate=%YY%MM

/usr/bin/perl ${AWSTATS}/wwwroot/cgi-bin/awstats.pl -config=${DOMAIN} -configdir=${DATA_DIR} -update -diricons=icon -dir=${STATS_DIR}

RET=$?

#MAIN_FILE=awstats.${DOMAIN}.`date +%y%m`.html
#MAIN_HTML=${STATS_DIR}/${MAIN_FILE}
#INDEX_HTML=${STATS_DIR}/index.html

#if [ -e ${MAIN_HTML} ] && [ ! -e ${INDEX_HTML} ]; then
# ln -sf ${MAIN_FILE} ${INDEX_HTML}
#fi

#changes per month
#ln -sf ${MAIN_FILE} ${INDEX_HTML}

with:
/usr/bin/perl ${AWSTATS}/tools/awstats_buildstaticpages.pl -config=${DOMAIN} -configdir=${DATA_DIR} -update -diricons=icon -awstatsprog=${AWSTATS}/cgi-bin/awstats.pl -dir=${STATS_DIR} -builddate=%YY%MM

/usr/bin/perl ${AWSTATS}/wwwroot/cgi-bin/awstats.pl -config=${DOMAIN} -configdir=${DATA_DIR} -update -diricons=icon -dir=${STATS_DIR}

RET=$?

MAIN_FILE=awstats.${DOMAIN}.`date +%y%m`.html
MAIN_HTML=${STATS_DIR}/${MAIN_FILE}
INDEX_HTML=${STATS_DIR}/index.html

#if [ -e ${MAIN_HTML} ] && [ ! -e ${INDEX_HTML} ]; then
# ln -sf ${MAIN_FILE} ${INDEX_HTML}
#fi

#changes per month
ln -sf ${MAIN_FILE} ${INDEX_HTML}

If awstats already run, you need to delete all awstats.*.*.conf for each domains.
and do this: (do this directly if awstats not run)
echo 'action=tally&value=all' >> /usr/local/directadmin/data/task.queue
/usr/local/directadmin/dataskq d

Perhaps it can help you.
good luck
 
I have just installed a new server with DA 1.322 with AWstats included. This install uses AWstats with static pages, this does not look very nice. All our other server use AWstats plugin with dynamic pages. Our customers are used to the dynamic version.
We've decided we're going to offer AWStats for our retail and reseller accounts.

Can someone point me to examples of the above two methods so I can see the difference in how they look.

Thanks.

Jeff
 
dynamic look

This is how it looks: you can select month & year on top whereas static default method shows only current month. (also links on the left appear on top in DA default but I guess that's just some config option that can be easily changed).
 

Attachments

  • Screen shot 2011-03-10 at 17.33.24.png
    Screen shot 2011-03-10 at 17.33.24.png
    70.7 KB · Views: 127
Back
Top