AwStats plugin for DA [Still in BETA]

Well in fact i don't really wish to make this job silent.

I was wondering if there was a way to send this mail to other user than root which is not on never list.
In fact i'd like to know where in the script i should modify to send for example to admin account.

Thks for help

Tdldp

jmstacey said:
You can make the cronjob silent.

So for example, you would modify that cronjob to look something like

* * * * * /run/my/script.pl 1>/dev/null 2>&1
 
fusionictnl said:
Awstats doesn't support Subdomains as far as I know. They are just added to the totals.

An option is to create a subdomain AS domain in DA. This way it will get it's own awstats page.

Thanks...
Sounds like a simple workaround...
 
the following crontab is NOT running my tallies.

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


is it correct?
 
Chrysalis

It should be correct if it is nicely on one row offcourse ;)
Check it through command and see if it works.

Two_A_T

This was the pre-release of 6.4 so the version number is 6.3. They probably didn't change it in that release. (All functionality is the same, except the things I've removed from it).
 
ok its one line in the crontab, when run from command line the tally is run but from crontab the bit after && (tally) is not executed.

Does running the tally rotate logs so if awstats run after it loses data?
 
Yes.. you could play it safe and run the awstats plugin around 20:00 ;) or 18:00 :) That way it shouldn't be rotated on regular machines and hopefully processes it before the taly (log rotate).

I don't know why your cron doesn't run the bit after && :s looks pretty strange as it should work on most OS'es :s
 
Ok well what I done now is calling it a bit different from the cron using a script, and will check the tallies after the cron is called to see if they update, if it still fails I will just juggle them around a bit and run seperate.
 
Cron and permissions

Hi, I'm having trouble with getting the cron task to run. As per the instructions on the first page of this thread, I've replaced:

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've done this by editing the /etc/cron.d/directadmin_cron file with nano. Is this the correct way of doing it? Do I have to restart the Cron daemon for it to recognise the new file?

I'm also having issues with permissions when clicking on the update now link on the awstats page. The error message I get is:

Error: Couldn't open server log file "/var/log/httpd/domains/whitespace-studios.com.log" : Permission denied

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

I can run /usr/local/directadmin/plugins/awstats/hooks/cgi-bin/awstats_updateall.pl now -awstatsprog=/usr/local/directadmin/plugins/awstats/hooks/cgi-bin/awstats.pl
as root just fine but if I try as a user it gives me the same permission trouble.

Can anyone advise me in simple terms how to correct the permission problem and also the correct way to add to or change the cron file?

Thanks.
 
my tallies now update after I moved the command to a script and call the script from the cron.
 
Cutia

Could you check the permissions on the log files. These have to be of both apache and the user :)

Do you have it with all the domains or just one ?

Chrysalis

On centos I have the same issues with some other scripts in the cron, and I use a script to run them all ;) Strangely Awstats doesn't give any trouble .
 
The permissions on all the log files are root root, even the ones which aren't updated by the script (dated from before I installed the plugin).

I'm using awstats on three domains only. I've deleted the conf files for the other ones. It's installed via the plugin manger.

I'm running CentOS and Apache 2 if that helps.
 
Last edited:
Cutia, It can't be that the logs are owned by root. I run centos and apache 2. It seems you've changed the permissions on the log files yourselfs or your apache is running as root. Both of wich isn't the best way to use it ;)

So I'll gues you didn't correltly setup, apache, or the whole box.

Please double check you are reffering to the correct logs. As the ones I mean are:

/var/log/httpd/domains/
 
Thanks for your reply fusionictnl, I'm getting there...

The log files are indeed owned by user root and group root. The server was set up by Layered Tech and they also installed DirectAdmin. DirectAdmin installs Apache and sets everything up so I'm not sure why it would be set up wrong. Can you explain what the correct permissions on the log files should be for the centos/apache2/DA configuration?

Also as far as I comprehend, DA sets things up so that Apache runs as root (but then spawns the child processes as user apache).
 
Last edited:
Sorry my fault I did mess things up :s

The owner is indeed root as apache runs as root in first instance.
The permissions on ls -la for /var/log/httpd/domains/*

should be as your setup is correctly (root:root)
further permissions: -rw-r--r

The Awstats runs as the User of the domain. So it has to have "r" read permissions for others.
 
:Edit:
Seems to work if permissions on /var/log/httpd folder are set to drwxr-xr-x
Previously they were: drwx------

Is this ok or a security risk?
 
Last edited:
Re: Cron and permissions

Cutia said:
Can anyone advise me in simple terms how to correct the permission problem and also the correct way to add to or change the cron file?
If files are owned by root, then root must run the crontab that will manipulate them. Otherwise the crontab may be run by any other user with login rights which can manipulate the files based on their rights and ownership.

The right way to manipulate crontabs is:

crontab -u username -e

which will automatically run the standard editor, and when you're done and exit the editor it will automatically set up the crontab and restart it.

If you don't like the standard editor then you should change it before you run crontab. For example, I prefer the joe editor, so before I run the above command, I run:

export EDITOR=joe

Jeff
 
Hi,

I'm successfully using the Awstats plugin for my DA domains however I'd also like to use it to process some Iceast2 logs I have generated in a FreeBSD jail.

I have created the necessary conf file and it seems to process with no problem. However I'm not sure how I can gain access to these stats. If I use http://domain.com/awstats/awstats.pl?config=icecastdomain it always refers to the domain.com config.

Is it possible to gain access to Awstats in a more generic way? Could I maybe place the awstats.pl in the /var/www/cgi-bin so it can run off of my primary domain?

I'd appreciate any thoughts and feedback.

Thanks :)

Matt
 
Back
Top