Stats Control (Yet another AwStats Plugin ;)

Damn... Now DirectAdmin consider plugin as installed even if install script returned non-zero value... Why it's so stupid???...

I'm suspecting that for most people who have problems with plugin it's just because installation process wasn't completed correctly...

Oh. Defenitely we have wrong permissions (444) on 3 awstats template files inside package (aw_default.conf, aw_override.conf, aw_template.conf) that will prevent it's editing. Permissions changed to 644.
 
Last edited:
Ok, found out what was wrong.

Inside the www.domain.com/awstats/ folder, it has the awstats.pl, but it had the old symlinks for the lib, lang, plugins, and icon directory.

I removed the icon symlink since I see that you put the awstatsicons in /var/www/html/.

I then remade the symlinks for lib, lang, and plugins.

Code:
lrwxrwxrwx  1 root    root        66 Mar 24 19:22 lang -> /usr/local/directadmin/plugins/Stats_Control/awstats/cgi-bin/lang/
lrwxrwxrwx  1 root    root        65 Mar 24 19:21 lib -> /usr/local/directadmin/plugins/Stats_Control/awstats/cgi-bin/lib/
lrwxrwxrwx  1 root    root        69 Mar 24 19:22 plugins -> /usr/local/directadmin/plugins/Stats_Control/awstats/cgi-bin/plugins/

No more errors. :)

In the meantime, I'm going to program something real quick to do it to all of the user's directories.

I'm going to guess when you issued the command ln -s in your install script, to a link that already existed, it didnt put in your symlink.
 
I've changed the plugin installer to not set it to "installed=yes" if a non-zero result is returned.

http://www.directadmin.com/features.php?id=635

The code was previously there.. but was commented out for some mystery reason. I had failed to comment why exactly it was commented out in the first place.. so we'll see what happens ;)

John
 
FeBox said:
Ok, found out what was wrong.

Inside the www.domain.com/awstats/ folder, it has the awstats.pl, but it had the old symlinks for the lib, lang, plugins, and icon directory.

I removed the icon symlink since I see that you put the awstatsicons in /var/www/html/.

I then remade the symlinks for lib, lang, and plugins.

Code:
lrwxrwxrwx  1 root    root        66 Mar 24 19:22 lang -> /usr/local/directadmin/plugins/Stats_Control/awstats/cgi-bin/lang/
lrwxrwxrwx  1 root    root        65 Mar 24 19:21 lib -> /usr/local/directadmin/plugins/Stats_Control/awstats/cgi-bin/lib/
lrwxrwxrwx  1 root    root        69 Mar 24 19:22 plugins -> /usr/local/directadmin/plugins/Stats_Control/awstats/cgi-bin/plugins/

No more errors. :)

In the meantime, I'm going to program something real quick to do it to all of the user's directories.

I'm going to guess when you issued the command ln -s in your install script, to a link that already existed, it didnt put in your symlink.

ahh so like a convertor script this would be handly if publicly available thanks.
 
Yep....here it is....

Code:
#!/bin/bash
############################################################
#           AWStats converter for DirectAdmin              #
#                                                          #
#  Converts the awstats directories that were previously   #
#  used for fusionictnl's plugin, and gets them ready for  #
#  ClayRabbit's plugin.                                    #
#                                                          #
#       Coded by Anthony Drimones of FeBox, LLC.           #
#            Contact: anthony [@] febox.com                #
############################################################

find /home/*/*/*/public_html/ -name awstats > dirlist

echo "Directory List Compiled"

for d in `cat dirlist`; do
        ln -sf /usr/local/directadmin/plugins/Stats_Control/awstats/cgi-bin/lang/ $d/lang
        ln -sf /usr/local/directadmin/plugins/Stats_Control/awstats/cgi-bin/lib/ $d/lib
        ln -sf /usr/local/directadmin/plugins/Stats_Control/awstats/cgi-bin/plugins/ $d/plugins
        rm $d/icon
        rm $d/awstats.pl
        cd $d
        echo '#!/usr/bin/perl' > awstats.pl
        echo "require '/usr/local/directadmin/plugins/Stats_Control/awstats/cgi-bin/awstats.pl';" >> awstats.pl
        perms=`echo $d | cut -f3 -d'/'`
        chown $perms.$perms awstats.pl
        chmod 755 awstats.pl
        cd /
done

echo "Conversion complete!"
 
Last edited:
I can not manage nightly update of Awstats to work.
The:
40 0 * * * root /usr/local/directadmin/plugins/Stats_Control/scripts/stats_run.sh #Added by Stats Control Plugin
is inside the crontab.

Everything else in the crontab works, so it shouldn’t be anything wrong with crontab it selves.
If I run /usr/local/directadmin/plugins/Stats_Control/scripts/stats_run.sh manually and the stats get updated.

(Os: CentOs 4.3)
 
Last edited:
FeBox, thanks for convertor script.
I think we will add option for removing existing symlinks during install in next version.

Oddis, try to run /usr/local/directadmin/plugins/Stats_Control/scripts/stats_run.sh by hands via SSH and see what's happening.
Also you can take look at /var/log/stats_run.log contents.
 
Last edited:
Yes. If config is specified, doesn't makes sence which hostname you are using - with or without "www."
 
Thanks for the reply both of you……
This is the great thing about this community.
The support and help from all the users here

I have had the plugin installed a couple of days.
/var/log/stats_run.log tells that the cron was performed
(2006-03-26 00:40:01 - Running awstats for domain.com)

I looked at the stats trough the link in the domain (stats control)
http://domain.com/cgi-bin/awstats/awstats.pl?config=domain.com

The stats was not updated

Then I tried to run the update by hand in SSH as root:
/usr/local/directadmin/plugins/Stats_Control/scripts/stats_run.sh
In var/log/stats_run.log I can see that the manual update was performed
(2006-03-26 04:31:26 - Running awstats for domain.com)
Now, when I go to site and use the link in Stats Control, the update is performed according to log.

I will see about the awstats log is updated this midnight by using www as mentioned by FeBox.

Again: Thanks both of you………

Tested the script with and without www.
The stats was not updated
 
Last edited:
It looks very promising, but I get these errors when I want to view the stats:

Error: awstats failed to create directory DirData (DirData="/../stats", CreateDirDataIfNotExists=1).

Setup ('/etc/awstats/awstats.conf' file, web server or permissions) may be wrong.
Check config file, permissions and AWStats documentation (in 'docs' directory).

Someone who knows what's going wrong?

Regards,
Marco
 
yea, I don't get it...mine stopped updating as of the 25th. I can run the cron line, the log says its being run, but doesnt update the stats. I looked through the script, can't find anything as to why it wouldnt be working.

ClayRabbit?
 
vanrooij said:
It looks very promising, but I get these errors when I want to view the stats:

Error: awstats failed to create directory DirData (DirData="/../stats", CreateDirDataIfNotExists=1).
Seems under your OS environment variables substitution inside awstats.conf not working correctly.
Try to apply plugins/Stats_Control/awstats/cgi-bin/awstats.pl.rh90.patch to awstats.pl or just use "?config=<yourdomain>" in stats URL (will work after stats update).
woyteck said:
Hello.
I installed this plugin but found some problem.
There is no graphics in /cgi-bin/awstats/icons, and therefore stats look ugly.
Please check that you have line:
Alias /awstatsicons/ /var/www/html/awstatsicons/
inside your httpd.conf and image folders are correctly copied into /var/www/html/awstatsicons.

FeBox, Do you receive any errors/messages while running stats_run.sh in SSH? Do you have lines like
<date> <time> Running <stats_type> for <yourdomain>
inside /var/log/stats_run.log? Also look for /home/<user>/domains/<domain>/stats/awstats.log file (or webalizer.log) and check it's content.
 
Last edited:
We left Plesk for DA because we thought we could get good AWStats here. It would have been a different decision if we knew that we couldn't. It looks like you could be the one to make that happen.

ClayRabbit, if you get that thing solid to where I can use it, you have another customer. We have a FreeBSD 6.0 server that SURE could use some reliable AWStats. We are not looking forward to changing control panels again, but we and our customers need to have good stats.
 
I don't know if this has been asked before but if I were to move from webalizer to awstats what would happen to the stats generated by webalizer in previuos months?

Would the stats be lost?


Jon
 
IT_Architect said:
We left Plesk for DA because we thought we could get good AWStats here. It would have been a different decision if we knew that we couldn't. It looks like you could be the one to make that happen.
AWStats has never been an official part of DirectAdmin.

I, too, am looking at this thread as a possible answer to using AWStats, but it's important to note that DA has never promised AWStats; it's always been a third-party offering by volunteers.

Jeff
 
Back
Top