Sorry to bump a month old thread but for anyone else looking to do this, here are some tweaks I made to mine to have it work.
First, go to /usr/local/directadmin/scripts and run ./awstats.sh to install awstats onto the server.
Second, browse to /usr/local/awstats/wwwroot/cgi-bin and make a file called .htaccess and put
Code:
Options +ExecCGI
AddHandler cgi-script pl
DirectoryIndex awstats.pl
into the file.
Third, make a backup of the original awstats.pl and then open it and find the line (searching for etc lets you jump to this line in 2-3 searches):
Code:
else { @PossibleConfigDir=("$DIR","/etc/awstats","/usr/local/etc/awstats","/etc","/etc/opt/awstats"); }
and replace it with
Code:
else { @PossibleConfigDir=("$DIR","/etc/awstats","/usr/local/etc/awstats","/etc","/etc/opt/awstats","../../awstats/.data"); }
$SiteConfig =~ s/^www\.//;
Fourth, go to /usr/local/directadmin/scripts/custom and download the modified shell file (feel free to look through it all to make sure it isn't doing anything harmful, there are too many code changes made throughout the script to list them all out here)
Code:
cd /usr/local/directadmin/scripts/custom
wget http://www.pejoo.net/awstats_process.sh
chmod 0700 awstats_process.sh
chown diradmin:diradmin awstats_process.sh
Note that this will turn on GeoIP (which requires the perl-Geo-IP package as well as the GeoIP database) and full DNS Lookup for AWStats, if you do not want this find the lines
Code:
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}
and remove them.
That should make AWStats run dynamically on your server and, if you are using the awstats plugin already, just copy all your current .txt data files into the /home/user/domain/awstats/.data directory and it will read all of your old monthly stats.
To view the stats, just go to
http://www.domain.com/awstats and it will all be there. The script can probably be adjusted to make it even more robust but this is all I needed it to do so I do not plan to modify it any further, though if you want to then by all means go for it.