AWStats Plugin for DA [version 3.0+]

error creating stats dir

Hello,
this script it's perfect. i never have problem with it.
But i reinstall my server and reinstall this plugin and now when user clic on "Install AwStats on this domain*"
the stats dir in domain directory not created.
i check /usr/local/directadmin/plugins/awstats/user/index.html and i see nothing about this rep. So i have add this:
$location2=$_SERVER["HOME"]."/domains/$domains[$awdomain]/stats";
echo "Checking if there is already something installed..<BR>";
if (file_exists($location2)) echo "AwStats Directory already exists on domain<BR>";
else {
echo "Creating AwStats dir on domain<BR>";
mkdir($location2);
echo "Setting Directory Permissions";
chgrp($location2,$_SERVER['USER']);
}

after:
$location=$_SERVER["HOME"]."/domains/$domains[$awdomain]/public_html/awstats";
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);
echo "Setting Directory Permissions";
chgrp($location,$_SERVER['USER']);
}
it's work, but i don't now if it's the good solution or if i must do something else.
 
Shouldn't have to create the /stats folder...should be there since it's the same one Webalizer uses.
 
I had the same issue today
bought server, installed da on centos 5
installed this plugin
had problem that stats folder doesnt exist added in manually
Matt
 
Did you install the plugin immediately after installing DA? Had a instance of Webalizer or quotas ran yet after the initial install?
 
yes immediately after so no webaliser or anything had run.
awstats should be part of default installation its so important! So once webaliser has run it will create the folder?
Thinking for future accounts?
Ta
Matt
 
YES it's right

YES!!!
you're right.
the stats folder are created automaticly by webalizer after some time.
thanks a lot :)
 
In the last version of the script is the hooks/cgi-bin/awstats.pl missing. So it is not possible to run updates for the stats. I have currently added it from a lower version and it works fine for me for the moment.
 
In the last version of the script is the hooks/cgi-bin/awstats.pl missing. So it is not possible to run updates for the stats. I have currently added it from a lower version and it works fine for me for the moment.


You referring to 3.02?
 
Hi I am struggling to update the stats - if I run the script
it says its updating but the page is showing all 0's and where you can update manually from browser it is saying never updated

[root@server ~]# /usr/local/directadmin/plugins/awstats/hooks/cgi-bin/awstats_updateall.pl now -awstatsprog=/usr/local/directadmin/plugins/awstats/hooks/cgi-bin/awstats.pl
Running '"/usr/local/directadmin/plugins/awstats/hooks/cgi-bin/awstats.pl" -update -config=my-french-house.com -configdir="/etc/awstats"' to update config my-french-house.com
Create/Update database for config "/etc/awstats/awstats.my-french-house.com.conf" by AWStats version 6.7 (build 1.892)
From data in log file "/var/log/httpd/domains/my-french-house.com.log"...
Phase 1 : First bypass old records, searching new record...
Direct access after last parsed record (after line 7958)
Jumped lines in file: 7958
Found 7958 already parsed records.
Parsed lines in file: 4869
Found 0 dropped records,
Found 0 corrupted records,
Found 0 old records,
Found 4869 new qualified records.
 
I was wondering if this is the problem
(this is the message if you "Install" awstats)

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/myfh/domains/my-french-house.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.
 
hmm struggling here!
I have checked and the conf file is correctly written and the .htaccess /.htpasswd files (am wondering if the permissions from root setpup causing problem?)
I have run successful the update script - it all seems ok (in directory worried about trailing / in "/stats/"
there seems to be the right txt file in the stats directory
but I am still getting nothing from the script - ie it cant see the database.
any ideas?
thanks
Matt
 
The problem lies in your server config, not in the plugin. Check in php.ini and be sure that you haven't disabled fopen.
 
Hi Sean
Sequence was as follows
- clean install of CentOs
- install of Direct Admin
- install of awstats plugin

didn't touch php.ini

as I mentioned as root the fopen has worked as the paths etc are setup

here is line in php.ini

; Whether to allow the treatment of URLs (like http:// or ftp://) as files.
allow_url_fopen = On

the fopen is a red herring!

did you read last post?
everything "seems" as it should be - but the awstats.pl doesn't seem to read the database file -which is updating correctly.

Appreciate help!
 
found by changing this in an individual config file
DirData="/etc/awstats"
#DirData="/home/myfh/domains/my-french-house.com/stats/"

(swapped the # comment out around) - it works.
I was unhappy with the last / in stats, also wondering if there was a permission/owner issue in the stats folders - as I created these myself (see above threads)
take care
Matt
 
auto install awstats for each users

Hello do you have a solution for auto install awstats for each users, i make this:
3) Setup to automatically add access for new accounts created in DA:

nano -w /usr/local/directadmin/scripts/custom/user_create_post.sh

insert the following:

#!/bin/sh
echo $username >> /usr/local/directadmin/plugins/awstats/hooks/permissions.txt

cntl-x to save

> chmod 755 /usr/local/directadmin/scripts/custom/user_create_post.sh

but this active only plugin for users, dont install this:
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.
etc...

Can i do something for auto install this ?

thanks

I make something for when i del one user:

nano -w /usr/local/directadmin/scripts/custom/user_destroy_post.sh

#!/bin/sh
cat - /usr/local/directadmin/plugins/awstats/hooks/permissions.txt | grep -v $username > /usr/local/directadmin/plugins/awstats/hooks/permissions.txt~
mv -f /usr/local/directadmin/plugins/awstats/hooks/permissions.txt~ /usr/local/directadmin/plugins/awstats/hooks/permissions.txt
chmod 777 /usr/local/directadmin/plugins/awstats/hooks/permissions.txt
chown diradmin:diradmin /usr/local/directadmin/plugins/awstats/hooks/permissions.txt

exit 0;
 
Last edited:
Hey guys, I discovered a solution that worked for me for the .htaccess problem...

from within the public_html folder:
chown -R <username>:<username> awstats

"reinstall" the plugin for the individual users and the .htaccess error should be gone.

Now, if you have a lot of users, this could become tedious... I'm sure someone who is an expert in shell scripting could fairly easily come up with a quick script to do this all in one swoop... I had about 10 users or so so this was no big deal for me.

Hope this helps someone!
 
Hi, my first post here :)

I have installed the plugin, not without problems, but i'ts running now.
But, i have 1 problem, the .htaccess and .htpasswd doen'st have rights.

Warning: fopen(/home/****/domains/*****/public_html/awstats/.htpasswd): failed to open stream: Permission denied in /usr/local/directadmin/plugins/awstats/user/options.php on line 40 Warning: fwrite(): supplied argument is not a valid stream resource in /usr/local/directadmin/plugins/awstats/user/options.php on line 41 Warning: fclose(): supplied argument is not a valid stream resource in /usr/local/directadmin/plugins/awstats/user/options.php on line 42

Thanks for your help!

Problem solved :$ i'm already logged in
 
Last edited:
my installation went well..

But it isn't showing any stats..

only zero's o_0
(even 3 days later)
 
Hmmz, users can't chance his password, permission dined, anywone that can help me?

Warning: copy(/home/****/domains/***l/public_html/awstats/.htaccess): failed to open stream: Permission denied in /usr/local/directadmin/plugins/awstats/user/options.php on line 34 Warning: fopen(/home/***/domains/***public_html/awstats/.htaccess): failed to open stream: Permission denied in /usr/local/directadmin/plugins/awstats/user/options.php on line 36 Warning: fwrite(): supplied argument is not a valid stream resource in /usr/local/directadmin/plugins/awstats/user/options.php on line 37 Warning: fclose(): supplied argument is not a valid stream resource in /usr/local/directadmin/plugins/awstats/user/options.php on line 38 Warning: fopen(/home/***/domains/****/public_html/awstats/.htpasswd): failed to open stream: Permission denied in /usr/local/directadmin/plugins/awstats/user/options.php on line 40 Warning: fwrite(): supplied argument is not a valid stream resource in /usr/local/directadmin/plugins/awstats/user/options.php on line 41 Warning: fclose(): supplied argument is not a valid stream resource in /usr/local/directadmin/plugins/awstats/user/options.php on line 42 Password protected!
 
Hi, my first post here :)

I have installed the plugin, not without problems, but i'ts running now.
But, i have 1 problem, the .htaccess and .htpasswd doen'st have rights.

Warning: fopen(/home/****/domains/*****/public_html/awstats/.htpasswd): failed to open stream: Permission denied in /usr/local/directadmin/plugins/awstats/user/options.php on line 40 Warning: fwrite(): supplied argument is not a valid stream resource in /usr/local/directadmin/plugins/awstats/user/options.php on line 41 Warning: fclose(): supplied argument is not a valid stream resource in /usr/local/directadmin/plugins/awstats/user/options.php on line 42

Thanks for your help!

Problem solved :$ i'm already logged in

I have the exact problem. fopen is on in php.ini
 
Back
Top