AWStats Plugin for DA [version 3.0+]

Did you guys read my post, or try what helped me?
http://www.directadmin.com/forum/showpost.php?p=110793&postcount=196

I have another problem with updating. I have changed to setting to allow manual updating from the stats page but I get this error:

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

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

I have tried every permission and ownership I could think of, from root:root, root:nobody, nobody:nobody, apache: noboday, apache:apache, etc. I have also tried 777, 755, 666, 644 permissions as well. I have looked at all the awstats docs, and couldn't find anything about permissions as such.

Any ideas, or anyone able to get this correct?

Thanks.
 
Not sure why they would not be writable..

this code:

Code:
                                $this->storeMessage("Checking for .htaccess.");
                                if (!file_exists($location.'/.htaccess') or $this->_force)
                                {
                                        $this->storeMessage((file_exists($location.'/.htaccess')?'Re-':'')."Activating CGI for direc$
                                        if (file_exists($location.'/.htaccess')) unlink ($location.'/.htaccess');
                                        copy ("$this->_hooksDir/cgi-bin/.htaccess","$location/.htaccess");
                                        chmod ("$location/.htaccess",0755);
                                        chown ("$location/.htaccess",$domainToProcess['user']);
                                        chgrp ("$location/.htaccess",$domainToProcess['user']);
                                } // if (!file_exists($location.'/.htaccess') or $this->_force)

forces teh owner:group to the da account userid and chmods it to 755.
 
Not sure why they would not be writable..

this code:

Code:
                                $this->storeMessage("Checking for .htaccess.");
                                if (!file_exists($location.'/.htaccess') or $this->_force)
                                {
                                        $this->storeMessage((file_exists($location.'/.htaccess')?'Re-':'')."Activating CGI for direc$
                                        if (file_exists($location.'/.htaccess')) unlink ($location.'/.htaccess');
                                        copy ("$this->_hooksDir/cgi-bin/.htaccess","$location/.htaccess");
                                        chmod ("$location/.htaccess",0755);
                                        chown ("$location/.htaccess",$domainToProcess['user']);
                                        chgrp ("$location/.htaccess",$domainToProcess['user']);
                                } // if (!file_exists($location.'/.htaccess') or $this->_force)

forces teh owner:group to the da account userid and chmods it to 755. This is during the initial AWStats install...the .htaccess is only created for existing accounts.

Now if a user activates it via the CP, thsi code:

Code:
copy ("$dir/cgi-bin/.htaccess","$location/.htaccess");
chmod ("$location/.htaccess",0755);
chown ("$location/.htaccess",$_SERVER['USER']);
echo "Doing an extra permission setting through shell..";
@system("chmod 755 $location/.htaccess");
@system("chmod -L 755 $location/.htaccess");

sets the .htaccess file to the users id. Even trys it two way. Maybye I should add chgrp to it. hmmm.

Could be something to do with fopen on your server being blocked or some other configuration problem.
 
Install

hecking 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/samplex/domains/xxxxxx.xxx/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


How can i resolve this error?
 
Last edited:
You have to change permissions of the .htpasswd file

chown -R user.user .htpasswd

__________________________________________________________________

Sullise,
This is clearly a problem for many including myself. Why isn't the script correctly changing the ownership of this file?
 
You have to change permissions of the .htpasswd file

chown -R user.user .htpasswd

__________________________________________________________________

Sullise,
This is clearly a problem for many including myself. Why isn't the script correctly changing the ownership of this file?


user.user is correct or must i put in a other name? must user.user be the name of that account?
 
whats the diff

Hi,

Just wondering what the difference from this version is to "Stats Control Plugin"? Are both not really update much anymore, both appear from 2004
 
"Just wondering what the difference from this version is to "Stats Control Plugin"? Are both not really update much anymore, both appear from 2004"

Stats Control is not supported at all at this point, but it does work. This version is moderately supported. AWstats are at least updated. Why not contact DA and ask for support of AWStats.
 
yep

yeh just emailed them.... was wondering... I've installed the other one instead of this one and it appears ok, just wondering whats different in this one?

Cheers
 
The difference is that this plugin just adds AWstats. Stats Control let you/user choose which stats they want to use. Also stats control has some features related to log rotation.
 
Found a bug. (how horrible).

/usr/local/directadmin/plugins/awstats/hooks/awstatsinstall.php

Incorrectly sets the data directory to /home/username/domains/domainname/awstats..

should be /stats

I'll get a fixed version out this weekend..in the meantime, you can fix any broken installs by doing:

log in as root

Code:
cd /usr/local/directadmin/plugins/awstats/hooks/
perl -pi.bak -e 's/\/awstats\/\",$cont/\/stats\/\",$cont/' awstatsinstall.php
mkdir /etc/awstats_backup/
mv /etc/awstats/*.conf /etc/awstats_backup/
./awstatsinstall.php -a

This will recreate all the users .conf files with the correct DirData directive.

To see if your install is having the problem, check any of the /etc/awstats/*.conf files and look for the DirData directive and see if it's pointing to a /awstats folder instead of a /stats one.
 
Code:
Warning: copy(/home/admin/domains/***/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/admin/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/admin/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!
That is what happens when I try to change the Password for awstats ,Also ,It wont let me access awstats because it says i have the wrong password .
I followed the instructions as stated ,I run CentOS
 
I just have a quick questions. I used this script to install awstats a long time ago.

Now I have a single user that is receiving an error when attempting to manually update.

Error: An AWStats update process seems to be already running for this config file. Try later. If this is not true, remove manually lock file '/tmp/awstats.userdomainname.com.lock'.

I can delete the lock file and run the update manually, but the problem is, then awstats will only parse in the current days log. And the days between when the lock file got fudged up, and when it was deleted are nonexistant.

In what directory do I put the older log files so that awstats will include them in the update?
 
Back
Top