AwStats plugin for DA [Still in BETA]

Updated v0.9:

DEBUG info domain array removed.

Direct link to statistics

Replaced the HTTPS setting (jmstacey) so it will hopefully work with https ;)



The -config= isn't needed because the .pl is user through CGI. This way it will use the domainname it's called by. Ex:

http://www.test.nl/awstats will use awstats.www.test.nl.conf

Further a 500 Error looks more like a cgi-bin permission error :s Probaly the rights on the file aren't setted correctly.

check the following files:

/var/log/httpd/suexec_log and /var/log/httpd/domains/[domain].error.log

It should prompt there what the real problem is.

For using a cron script for generating the statistics is way to complicated :P First there should be an output dir for each domain /home/domain/httpdocs/awstats

The scripts used for generating the statistics for all domains is very cpu/time consuming (they are too simple setupped)

The CGI only generates the statistics when needed and is way faster :) For my feeling :P
 
Last edited:
I'll look into the permissions settings. Personally the cron sounds a little less complicated that each user having a awstats.pl which has file linked to here which has files linked to there and everywhere :p
 
Problem fixed finally! Does require your installation script to be modified somewhat though. The awstats directory that your plugin creates belongs to username:apache where it should be username:username. once I fixed that its working like it should.
I highly suggest you add this to the installation script as it does not work for any of my domains without this step.

Heres the fix :D
In the index.html page find the following
Code:
echo "Checking if there is already something installed..<BR>";
if (file_exists($location)) echo "AwStats Directory already exists on domain<BR>";
else {
  echo "Creating AwStats dir on domain<BR>";
  mkdir($location);
}

and replace it with this
Code:
if (file_exists($location))
{
echo "AwStats Directory already exists on domain<BR>";
echo "Setting Directory Permissions";
chgrp($location,$_SERVER['USER']);
}
else {
  echo "Creating AwStats dir on domain<BR>";
  mkdir($location);
  echo "Setting Directory Permissions";
  chgrp($location,$_SERVER['USER']);
}

Also you can get the latest version thing working to show in the plugins page by modifying the plugin.conf and changing
Code:
version_url=http://awstats.sf.net
to
Code:
version_url=http://www.yourdomain.com/version
then on your server create a file named "version" that contains the version information such as "1.0"

:cool:
 
Some things that need working on.

+ Only the current days stats are processed but then are lost when DA cleans it out every 24 hours. This needs to be fixed since I would like history and not just todays stats ;)

+ If static pages were used it would save a lot of processing time from having to generate all of your records each time you viewed the page. Although I'm not sure how you can do this easily without heading the cron way. This would also fix the problem where you can't access the stats without the www

+ Short term solution to the www problem is adding a link in /etc/awstats of awstats.domain.net.conf to awstats.www.domain.net.conf
 
Updated v0.9.1

- jmstacey fix for permissions and latest version info

In reply:

History is being written to /etc/awstats/awstats[date].www.[domain].txt

My statistics go back to beginning of the year ;)

For using without the www, awstats will write another history file. This way all history files will be doubbled for every domain.
 
fusionictnl said:
Updated v0.9.1
History is being written to /etc/awstats/awstats[date].www.[domain].txt

My statistics go back to beginning of the year ;)

For using without the www, awstats will write another history file. This way all history files will be doubbled for every domain.

But there is still the two major problems
1. All of the stats must be generated everytime a new session is started. Rather time consuming but not really a problem unless there are lots of stats to generate over a lengthy period of time.

2. Statistics are not complete if you don't run them right before DA rotates the usage log.
For example, I ran it at the end of the 12th and today (14th) and did not run it on the 13th. As such there are no statistics for the 13th.

Perhaps at least a script that will generate stats right before webalizer does and when DA rotates the logs. That way there will at least be stats for that day whether or not the user updated his stats. See what I'm saying?
 
"All of the stats must be generated everytime a new session is started."
What does this mean?

Aren't stats incremental?
 
Yes they are incremental, but you must rebuild the nice graphics and such everytime you start a new session viewing stats because it must reparse the incremental log data.
 
That would make sense since it is dynamic but seems like a load to deal with if you have a busy server
.
They give you the choice to run static pages, but it doesn't look very good.
 
1.All of the stats must be generated everytime a new session is started. Rather time consuming but not really a problem unless there are lots of stats to generate over a lengthy period of time.

Check the permissions and look for the files I earlier described before. All of the stats aren't regenerated everytime (There must be some permission issue). "/etc/awstats/*.txt" are the history files and processed info.


2. Statistics are not complete if you don't run them right before DA rotates the usage log.
For example, I ran it at the end of the 12th and today (14th) and did not run it on the 13th. As such there are no statistics for the 13th.

Don't know when DA rotates it's logs ?? On my server I have no problems with incomplete awstats statistics even if it isn't ran for 1,5 month (just checked it).
 
Ok, yeah file permissions was messed up but it appears that it was only for that file as it is working for other domains I try installing it on. I probably messed it some time down the road.'

OK! That fixed all the problems :p
 
[root@joelinux root]# dig fusion-ict.nl

; <<>> DiG 9.2.3 <<>> fusion-ict.nl
;; global options: printcmd
;; connection timed out; no servers could be reached
[root@joelinux root]#


???:confused:
 
This machine where the site is hosted is running in test fase with DA. It's a new server, but it's randomly crashing a lot. about 1 or 2 weeks between.

So it could be that it sometimes wouldn't respond.

Sorry for the incovenience. Hope we'll get it fixed soon. New hardware is being changed to test where the problem is.

;) You can "dig" again ;)
 
i accidently un-tarred in a public_html directory and now i cannot remove it. it says access denied and when i try to reinstall i get a 404 error or something. how in the hell do i delete the directory so i can start the install on that site again from scratch. also it is in my FTP area becuase i was looking for a readme. which wasn't there!!!!



HELP

Works great everywhere else but in my one site!!!!
 
ehemmm.
First Login as root then you can remove the directory. Secondly, this is a DirectAdmin Plugin. You must have admin access to the control panel, once there head to the Plugins page. The link is on the main admin page, you install the "Plugin" from there ;)
 
come on im not that stupid!!!!!

I SSH as root and i still can't remove the dr i tried rm -d -f and rmdir (im not great with Command line yet) any thing else i could use.

I got it installed and running on every other site other than one with this problem

anyother suggestions
 
Back
Top