AwStats plugin for DA [Still in BETA]

fusionictnl

Verified User
Joined
Jun 22, 2004
Messages
1,052
Location
Netherlands
AwStats plugin for DA v2.1.8

NOTE: This plugin appears to be unsupported; the author hasn't posted on the DirectAdmin forums for over 15 months.

This Plugin will update all awstats.pl to the current awstats version

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

Click this link if you want to donatehttps://www.paypal.com/xclick/busin..._shipping=0&no_note=1&tax=0&currency_code=EUR and maybe it will get better :p it's STILL free :)

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.

Let me know if it works or if there are any problems ;)

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



I Have added an option (ver > 1.4) to the awstats_updateall.pl: -rotated=[size]

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).

As of 2.0.5 there is an other tool added in the hooks: awstatsinstall.php (heavily documented). This can be used to install/update/check the awstats installations of the plugin! Thx to: Cal Evans


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:

#!/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!!

Some people asked if they could donate something to the good of me :) I created the plugin for myself and are sharing it among others of the DA community. So please don't feel like you'll have to donate. This is just for the people that want to thank me for it! And offcourse I appreciate it, as well as you don't.


Good luck!
 
Last edited:
v. 0.2

Updated v0.2:

*- History files will be written to /etc/awstats (faster reporting)
*- Seperate AwStats config files will be generated to /etc/awstats for futere settings (per user).
 
Updated v0.4:

*- Plugin name is correct.
*- Admin/Resellers can view his/her own domains on User Level
*- Multiple domain bug (users could access every domain stats) fixed.
*- Script name is changed to awstats.tar.gz, old update doesn't work

Let me know if there are things that don't work or should be added!
 
Stats for domains under admin user are not working. here is the error message.
----- awstats 6.2 (build 1.761) (c) 2000-2004 Laurent Destailleur ----- awstats is a free web server logfile analyzer to show you advanced web statistics. awstats comes with ABSOLUTELY NO WARRANTY. It's a free software distributed with a GNU General Public License (See LICENSE file for details). Syntax: awstats.pl -config=virtualhostname [options] This runs awstats in command line to update statistics of a web site, from the log file defined in AWStats config file (with -update option), or build a HTML report (with -output option). First, awstats tries to read awstats.virtualhostname.conf as the config file. If not found, awstats tries to read awstats.conf Note 1: Config files (awstats.virtualhostname.conf or awstats.conf) must be in /etc/awstats, /usr/local/etc/awstats, /etc or same directory than awstats.pl script file. Note 2: If AWSTATS_FORCE_CONFIG environment variable is .......... and it just goes on a page or so more.
So it appears it is not executing just reading the file.

also, something wrong with the code used in the plugin link that displayed on the user levels etc when DA is secured. The error message is about a part of the page is not secure, only change was this plugin

Hope this helps a little.
 
would just like to say ive installed this on my box and it works a treat, nice work dude :D
 
Does awstats need to be preinstalled on the server? I do not have awstats preinstalled. After running the install, the link appeared, I clicked it, and it went to a standard enhanced template page which was blank in the content area. I've gone as far as adding an echo "AwStats"; at the top of the index.html file, which now is the only thing that appears in the content area.

I'm also playing with a plugin of my own which now has a bolded link, caused by your <B>AwStats Statistics<B> syntax in the user_txt.html file which should read <B>AwStats Statistics</B> enstead.
 
I answered my own question. No you do not have to have awstats preinstalled.

I did however make the following changes.

1)in file user_txt.html added closing slash in bold tags.

<B>AwStats Statistics</B>

2)in file index.html

#$dir=$_ENV["DOCUMENT_ROOT"]."/../hooks";
$dir="/usr/local/directadmin/plugins/awstats/hooks";

when echoing $dir on my server, I found the value for $_ENV["DOCUMENT_ROOT"] is always null. Maybe it is different on other servers.

all in all, cool plugin, I hope this sparks others to start developing a few more plugins of their own :)
 
...... also, something wrong with the code used in the plugin link that displayed on the user levels etc when DA is secured. The error message is about a part of the page is not secure, only change was this plugin

Link changed ;)

Look at your URL when you open op the plugin. Does it say something like ?domain=... ?

Did you first delete your plugin completely (because you already had one installed?) If not do so and check /usr/local/directadmin/plugins if there isn't any trash in it ;) (probaly not). And then re-install it. (maybe the last update fixed some things for you, I hope).


1)in file user_txt.html added closing slash in bold tags.

Changed

$dir="/usr/local/directadmin/plugins/awstats/hooks";

Changed, probaly less problems, but I don't know if everybody has da in /usr/local/directadmin ;)

You can just Update your plugin. It should then be version 0.5 ;)
 
Whenever I try accessing the user level I get a warning message still.
"This page contains both secure and nonsecure content...."
It is because of the small image you have in it since its not on a secure server ;)

I did uninstall and delete the old version before installing the new one but stats are not working on any accounts. Still displaying the same message.
All user urls are CMD_PLUGINS/awstats
thats it, so it looks like its not putting in the domain correctly, or displaying the list to select multiple domains from depending on how you did it.
 
You're running Da on HTTPS :)

You can fix it by changing the user....txt file in /usr/local/directadmin/plugins/awstats/hooks/

Removing the <img src......>
 
fusionictnl said:
Changed, probaly less problems, but I don't know if everybody has da in /usr/local/directadmin ;)

I found a more proper fix for my DOCUMENT_ROOT problem. I changed the line back to the way you had it and modified the association line at the top of the index.html file to look like this.

#!/usr/local/bin/php -c /usr/local/lib/php.ini
.
.
$dir=$_ENV["DOCUMENT_ROOT"]."/../hooks";
 
Thx will be added next release ;)

Some points I'm going to add:

-- Let users choose if they want to have a cron job and export it to a defined path for ex. http://www.xxx.xxx/awstats
This way all links will work and frames (Standard) can be used.
The stats in the CP will then be removed, it will only be for the statistics options.

-- Users can modify it's config, for example the plugins DNS Lookups etc.

-- Resellers could choose wich users can change the options or add cronjobs. (No cronjobs will disable it for the user)

-- Resellers can create a default configuration file, wich will be used for their users.
This way if some AwStats plugins are to heavy load for the server, the reseller can define a standard configuration file and deny users from modifying it's own configuration file.

Fixes:

- ENV: Document root (prev. topic).
- HTTPS problem, fixing by using the local picture's instead of http://www.awstats.org

If you have any comments on above features or how it should be implemented on a better way, please tell me ;)
 
Last edited:
Dude, THANK YOU!

Tho this only reports for the current log cycle, it's gonna be a blessing for some of my customers that can't stand webalizer. Awstats rocks (as far as free stats goes).

There are some issues however. I tried to click on
Referers: Refering sites and got this error:


Unable to execute your request

Details

That plugin does not exit for the specified User Level


Does not exit? Exist maybe? Is that a seperate plugin? The item links to: http://hostpc.com:2222/CMD_PLUGINS/awstats.hostpc.com.refererpages.html

Any thoughts?

Thanks again!

Joe
 
There is a problem with the links, because these require some static page's or the awstats.pl I'm working on it.

I'm testing 2 things:

- Static page's generated by a cron
- Put the awstats.pl in each users ./cgi-bin/ dir.

Probaly for the next release I will take the second way ;) Always the easiest way, so you guys and my customers can use AwStats to the fullest a.s.a.p.

Scripts from AwStats that generate the static pages, doesn't have enough configuration options. So that's why I'll use the awstats.pl instead of static reports. This way The plugin doesn't have to change to much on the system ;)
 
Last edited:
awstats installed in each user's cgi-bin?

Why not set it up so that it runs in a server wide cgi-bin. This makes it very easy to update and should operate with much lower overhead.
 
Back
Top