Thursday, August 31, 2006

AwStats plugin for DirectAdmin

AwStats DA Plugin : v.2.1.9 09-Jan-2006 (GMT+1)
Awstats Version: (Auto-Update)

ALWAYS USE LATEST DA RELEASE - EXTRA FEATURES AREN'T ADDED ANYMORE, SO DON'T REQUEST

Use the above url in your DA Plugin Management to install (Admin-Level).

On user-level users, can activate awstats on their domain through the control panel.
It creates a /awstats for the specified domain. So you can browse to: http://www.yourdomain.com/awstats
and see the statistics.

Admin-level, choose wich users can access awstats plugin.

It features password protection and all other awstats functions.

If you want to install awstats to all domains, login as root on your machine and run: /usr/local/directadmin/plugins/awstats/hooks/alldomains.php

For use in a Cron
Add to cron: /usr/local/directadmin/plugins/awstats/hooks/cgi-bin/awstats_updateall.pl now -awstatsprog=/usr/local/directadmin/plugins/awstats/hooks/cgi-bin/awstats.pl

*OR*


Replace:-

10 0 * * * root echo 'action=tally&value=all' >> /usr/local/directadmin/data/task.queue

With:-

10 0 * * * root /usr/local/directadmin/plugins/awstats/hooks/cgi-bin/awstats_updateall.pl now -awstatsprog=/usr/local/directadmin/plugins/awstats/hooks/cgi-bin/awstats.pl && echo 'action=tally&value=all' >> /usr/local/directadmin/data/task.queue


This size is in MB's and this will let the update only update the log's bigger as this SIZE. So : -rotated 99 will only update logs bigger as 99 MB. (For example da logrotate size)


I don't recommend upgrading the awstats.pl yourselfs as the original has a minor bug/feature in it, that would let you read any stats for any apache log file. (This is a customized version of AwStats and a customized version of the awstats_updateall.pl with some extra's in it).


Automaticaly give access to stats to new users

# cd /usr/local/directadmin/scripts/custom
# vi user_create_post.sh

Add the following to the new file or add the line if exists:

quote:


#!/bin/sh
echo $username >> /usr/local/directadmin/plugins/awstats/hooks/permissions.txt




# save the file VI command ( 'ESC' then ':' then 'wq!' )
# chmod a+x user_create_post.sh

This should now automaticaly add new users to the permissions file!


Use /usr/local/directadmin/plugins/awstats/update/update.sh to update your awstats, to the latest version!!

No comments: