AWStats Plugin for DA [version 3.0+]

I'm getting this error whenever I try to access my stats page:

Code:
Error: AWStats database directory defined in config file by 'DirData' parameter (/home/admin/domains/xxxxxx/stats/) does not exist or is not writable.

Setup ('/etc/awstats/awstats.xxxxxx.conf' file, web server or permissions) may be wrong.
Check config file, permissions and AWStats documentation (in 'docs' directory).
I try to run the updateall script and I get:
Code:
Running '"/usr/local/directadmin/plugins/awstats/hooks/cgi-bin/awstats.pl" -update -config=xxxxxx -configdir="/etc/awstats"' to update config xxxxxx
Error: AWStats database directory defined in config file by 'DirData' parameter (/home/admin/domains/xxxxxx/stats/) does not exist or is not writable.
Setup ('/etc/awstats/awstats.xxxxxx.conf' file, web server or permissions) may be wrong.
Check config file, permissions and AWStats documentation (in 'docs' directory).
What am I doing wrong?
 
Installed with no errors whatsoever.
Thanks!

Ive got 2 questions:

1- How far back will awstats go? Can I manually make it process my logs so that I can have older stats? Or perhaps copy webalizer stats?

2- I don't want to leave the webaccess public. Simple apache auth?

thanks!

1) It processes whatever is in your /var/log/httpd/domains/* files currently. If you want it to process other logs, you'll have to modify the individual *.conf files in /etc/awstats and point them to the logs you want to process.

2) The plugin automatically locks the http://www.domain.tld/awstats folder behind simple .htaccess password protection. (defaults to id=DAUserid and pw=default). You can change these both via the clientside plugin in DA.
 
I'm getting this error whenever I try to access my stats page:

Code:
Error: AWStats database directory defined in config file by 'DirData' parameter (/home/admin/domains/xxxxxx/stats/) does not exist or is not writable.

Setup ('/etc/awstats/awstats.xxxxxx.conf' file, web server or permissions) may be wrong.
Check config file, permissions and AWStats documentation (in 'docs' directory).
I try to run the updateall script and I get:
Code:
Running '"/usr/local/directadmin/plugins/awstats/hooks/cgi-bin/awstats.pl" -update -config=xxxxxx -configdir="/etc/awstats"' to update config xxxxxx
Error: AWStats database directory defined in config file by 'DirData' parameter (/home/admin/domains/xxxxxx/stats/) does not exist or is not writable.
Setup ('/etc/awstats/awstats.xxxxxx.conf' file, web server or permissions) may be wrong.
Check config file, permissions and AWStats documentation (in 'docs' directory).
What am I doing wrong?

Is this a fresh install or did you update from a 2.* version?
 
Posted by VisiGod in old AWStats plugin thread. Since it applies to this version as well, figured I'd copy it here. I'll make the change in the next update. - Sean



There's a small glitch in your script (nothing unsecure). If you have E_NOTICES enabled in your PHP configuration you get an error if the user dont have awstats enabled for him.

So in user_img.html and in user_txt.html i've changed:

Code:
if ($deny==1) echo '<a href="/CMD_PLUGINS/awstats"><B>AwStats Statistics</B></a>'; else echo " ";

to

Code:
if (isset ($deny) && $deny==1) echo '<a href="/CMD_PLUGINS/awstats"><B>AwStats Statistics</B></a>'; else echo " ";
 
Thanks for your help guys.

No joy on both suggestions. The plugin was already enabled in the plugin.conf file.

Then I uninstalled the plugin completely, making sure /etc/awstats and the plugins/awstats directory were removed. Have I missed any?

Reinstalled, same problem, plugin not showing within the users skin.

I did wonder if there was a problem with the skin maybe (although it's not been customised), so I tried putting Installatron on there. But it shows up fine in the user side, so I think that eliminates it.

I do have it installed for all users, so I may just hardcode it to the skin.

Cheers
Nick

I have the same problem you do and tried the same things you did.
Let me know once you've found a fix, I'll keep looking too.
 
- Fixed problem with users updating .htpasswd from their plugin options screen. Seems that .htpasswd was getting owned by root and uses couldn't update it. Now when awstats is turned on for a user, it will chown it to the user. For existing users, you'll need to go and fix this manually for now. I'll script it next update.

Hello,

Thanks for your plugin, I've installed it on debian today and it's run perfectly. For existing users I've scripted that and it's run :

Code:
#!/bin/sh
for i in `ls /usr/local/directadmin/data/users`; do
 {
 for d in `cat /usr/local/directadmin/data/users/${i}/domains.list`; do
  {
  chown ${i}:${i} /home/${i}/domains/${d}/public_html/awstats/.htaccess
  chown ${i}:${i} /home/${i}/domains/${d}/public_html/awstats/.htpasswd
  };
 done;
 };
done;
exit 0;

Bye.
 
Ok, everything installed ok. Ran it manually for the first time and also ok.
A day later, I went in to see if it ran with the cron, and NO, it did not run.

Checked the logs, and there is no error message.
SOme help would be nice
 
Ok, everything installed ok. Ran it manually for the first time and also ok.
A day later, I went in to see if it ran with the cron, and NO, it did not run.

Checked the logs, and there is no error message.
SOme help would be nice

Only way it would not run from the cron is if you did not set it up correctly.

Run crontab -e and then cut/paste it here and I'll see if I can see the problem.
 
directadmin_cron:
Code:
* * * * * root /usr/local/directadmin/dataskq
2 0-23/6 * * * root echo 'action=vacation&value=all' >> /usr/local/directadmin/data/task.queue;
#5 5 * * 0 root /sbin/quotaoff -a; /sbin/quotacheck -augm; /sbin/quotaon -a;
#10 0 * * * root echo 'action=tally&value=all' >> /usr/local/directadmin/data/task.queue
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
20 4 1 * * root echo 'action=reset&value=all' >> /usr/local/directadmin/data/task.queue
0 4 * * * root echo 'action=check&value=license' >> /usr/local/directadmin/data/task.queue
 
neekster said:
Quote:
Originally Posted by neekster View Post
Thanks for your help guys.

No joy on both suggestions. The plugin was already enabled in the plugin.conf file.

Then I uninstalled the plugin completely, making sure /etc/awstats and the plugins/awstats directory were removed. Have I missed any?

Reinstalled, same problem, plugin not showing within the users skin.

I did wonder if there was a problem with the skin maybe (although it's not been customised), so I tried putting Installatron on there. But it shows up fine in the user side, so I think that eliminates it.

I do have it installed for all users, so I may just hardcode it to the skin.

Cheers
Nick
I have the same problem you do and tried the same things you did.
Let me know once you've found a fix, I'll keep looking too.

I never found a direct fix, instead just hardcoded it to my skin instead. It works, just not ideal.

Interestingly, if you use /CMD_PLUGINS on the end of your url, it will show all the plugins installed, including awstats and allow you to access the page from there. I'm no guru with this things, but I'm sure someone that knows the da plugin system a little better would be able to pin this down with that little bit of info.
 
I have installed version 3.02. It used to work without problems, but when new users install it on their domain it doesn´t create the directory stats anymore. I need to create it manual and and chmod 755 it. After that it is working normal.
Does somebody know how to solve this?
 
Error: Couldn't open config file "awstats.xyz.abc.com.conf" nor "awstats.conf" after searching in path ".,/etc/awstats,/usr/local/etc/awstats,/etc,/etc/opt/awstats": No such file or directory

- Did you use the correct URL ?
Example: http://localhost/awstats/awstats.pl?config=mysite
Example: http://127.0.0.1/cgi-bin/awstats.pl?config=mysite
- Did you create your config file 'awstats.server3.dotcom.sg.conf' ?
If not, you can run "awstats_configure.pl" from command line, or create it manually.

Check config file, permissions and AWStats documentation (in 'docs' directory).

I get this when i go to the /awstats of on my of websites.

Why does this happen? It says the .conf file is missing, so after installing the plugin and awstats, do i have to do anything else?



Besides, i get these when installing awstats on a particular domain, through DirectAdmin.
Now (re-)creating your configuration file.
Warning: fopen(/home/fusion/domains/fusionstream.org/public_html/awstats/.htpasswd): failed to open stream: Permission denied in /usr/local/directadmin/plugins/awstats/user/index.html on line 140 Warning: fwrite(): supplied argument is not a valid stream resource in /usr/local/directadmin/plugins/awstats/user/index.html on line 141 Warning: fclose(): supplied argument is not a valid stream resource in /usr/local/directadmin/plugins/awstats/user/index.html on line 142 Warning: chown(): Operation not permitted in /usr/local/directadmin/plugins/awstats/user/index.html on line 144
 
Last edited:
Hmmm anybody have a clue as to why I'm getting the following error (besides the 404 and it not being there :)):

[root@earth update]# /usr/local/directadmin/plugins/awstats/update/update.sh
Checking for latest version<BR>
...
Updating to <BR>
Downloading <BR>
--16:38:14-- http://awstats.sourceforge.net/files/awstats-.tar.gz
=> `/usr/local/directadmin/plugins/awstats/update/awstats.tgz'
Resolving awstats.sourceforge.net... 66.35.250.209
Connecting to awstats.sourceforge.net|66.35.250.209|:80... connected.
HTTP request sent, awaiting response... 404 Not Found
16:38:14 ERROR 404: Not Found.

Extracting<BR>

gzip: stdin: unexpected end of file
/bin/tar: Child returned status 1
/bin/tar: Error exit delayed from previous errors
Extracted.. now Updating<BR>
Awstats extracted in /usr/local/directadmin/plugins/awstats/update/awstats-<BR>
/usr/local/directadmin/plugins/awstats/update/update.sh: line 20: cd: /usr/local/directadmin/plugins/awstats/update/awstats-: No such file or directory
Copying awstas /usr/local/directadmin/plugins/awstats/update/awstats-/wwwroot/cgi-bin/awstats.pl to basedir
cp: cannot stat `/usr/local/directadmin/plugins/awstats/update/awstats-/wwwroot/cgi-bin/awstats.pl': No such file or directory
Patched..<BR>
cp: cannot stat `/usr/local/directadmin/plugins/awstats/update/awstats-/wwwroot/cgi-bin/lib': No such file or directory
cp: cannot stat `/usr/local/directadmin/plugins/awstats/update/awstats-/wwwroot/cgi-bin/lang': No such file or directory
cp: cannot stat `/usr/local/directadmin/plugins/awstats/update/awstats-/wwwroot/icon': No such file or directory
cp: cannot stat `/usr/local/directadmin/plugins/awstats/update/awstats-/wwwroot/cgi-bin/plugins': No such file or directory
Removing all temp. files<BR>
Updating all user files..<BR>

Done.. updated to <BR>
 
All of those errors are a result of it not being able to get the awstats package in the beginning, so as it progresses none of the related files/directories are going to be in existence because it didn't install the package in the first place.
 
Hmmm anybody have a clue as to why I'm getting the following error (besides the 404 and it not being there :)):


--16:38:14-- http://awstats.sourceforge.net/files/awstats-.tar.gz

the update script is not filling in the version for some reason. Why? good question. Why version linux you using?

The update script first does a wget on http://awstats.sourceforge.net and puts it in a file called awstats.ver.

It then parses that file and searchs for the version number in this url:
http://prdownloads.sourceforge.net/awstats/awstats-*.*.tar.gz

It then assigns that version number (recently 6.6) and puts it in a varible called VER which is then used to build the wget to grap the latest awstats package using http://awstats.sourceforge.net/files/awstats-$VER.tar.gz

From your output above, the $VER is not getting populated. Just checked and the script is working ok on CentOS 4.4 and below.

Try running it again..could been just a network glitch.
 
Checking if there is already something installed..
AwStats Directory already exists on domain
Checking if awstats files are available....
Checking for AwStats itself
Awstats already exists.
So I will delete it...Deleted!
Going to install the awstats.pl
+
(Re-)Activating CGI for dir
Ok .htaccess already exists let's delete it..Deleted!
Doing an extra permission setting through shell..+(Re-)Setting permissions
Doing an extra permission setting through shell..Done
Now (re-)creating your configuration file.
Warning: fopen(/home/clarissa/domains/domain.com/public_html/awstats/.htpasswd): failed to open stream: Permission denied in /usr/local/directadmin/plugins/awstats/user/index.html on line 140 Warning: fwrite(): supplied argument is not a valid stream resource in /usr/local/directadmin/plugins/awstats/user/index.html on line 141 Warning: fclose(): supplied argument is not a valid stream resource in /usr/local/directadmin/plugins/awstats/user/index.html on line 142 Warning: chown(): Operation not permitted in /usr/local/directadmin/plugins/awstats/user/index.html on line 144

Default password protection set.
Userid: username
Password: default

It is EXTREMELY recommended that you use the Tune AwStats and modify the default values immediately!

Config file has been created and your statistics are now setup!

Any idea about mine? I tried reinstalling, and followed all the steps and it's still somewhat the same.
 
Warning: fopen(/home/clarissa/domains/domain.com/public_html/awstats/.htpasswd): failed to open stream: Permission denied in /usr/local/directadmin/plugins/awstats/user/index.html on line 140

Warning: fwrite(): supplied argument is not a valid stream resource in /usr/local/directadmin/plugins/awstats/user/index.html on line 141

Warning: fclose(): supplied argument is not a valid stream resource in /usr/local/directadmin/plugins/awstats/user/index.html on line 142

Warning: chown(): Operation not permitted in /usr/local/directadmin/plugins/awstats/user/index.html on line 144

Error messages say it quite clearly.

.htpasswd access via fopen is not being allowed. Same goes for fwrite, fclose, and chown. You've got something setup (most like in php.ini) that is denying access to these functions by user clarrisa
 
Yes, but the thing is .htaccess and .htpasswd have those lines that's supposed to be written in. I went in through shell, and they seemed to be correct.

I didn't care and just went ahead, http://www.domain.com/awstats and it showed me an error message something about DirData at /home/clarissa/domains/domain.com/stats. Thus i tried to play his game, and simply create the 'stats' folder since its not there. Everything seems to work fine at http://www.domain.com/awstats now, but there's no statistics record.

In that awstats page, right at the top it says the following.
Code:
Last Update:  Never updated (See 'Build/Update' on awstats_setup.html page)
Does it matter? I can't find where awstats_setup.html is.

Another thing is, i tried to surf around 'domain.com' and hopefully awstats will capture some results. However, there's nothing after 10 minutes of trying to surf, and refreshing of awstats' statistics page.

Did i miss something important?
 
Back
Top