AWStats Plugin for DA [version 3.0+]

The plugin reads in the /var/log/httpd/domains/*.log file for the corresponding domain. You'll need to merge teh backups from the /home/user/domains/domain.com/logs back into that file if you want it to take in previous logs...or modify the conf file.
 
I get a "Page Not Found" after I follow your install instructions (CentOS 4.2). mylittleteashop.com/awstats/ Does it matter that it's under the admin user?

I also don't recall seeing any errors.

However, I did notice that when I install it to a domain that has no site setup yet, it works. Must be something to do with my shopping carts htaccess file?
 
Last edited:
Ok..gonna say this one more time people...

You will NOT see any stats..You WILL get a "page not found" or other such error when you FIRST activate the stats for a domain.

WHY? Because there ARE NO STATS to show. You need to wait at least 24 hours or until the next update depending how how you setup the crontab in setup process.
 
I understand that. That's why I manually ran the command to update the stats.

I think it's a .htaccess issue, but I don't know enough about it to fix the problem.
 
Yup..wordpress and other apps that subvert your site if installed at the webroot level (bad bad bad bad design methodolgy) will keep you from getting to the directory.

Since I don't know what shopping cart software you are using or what the .htaccess code is..not much anyone can do the help. ;)
 
I use the oscommerce spin-off zen cart.

Here is the root level .htaccess file:

Options +FollowSymLinks
RewriteEngine On
RewriteBase /

# From Ultimate SEO URLs
RewriteRule ^(.*)-p-(.*).html$ index\.php?main_page=product_info&products_id=$2&%{QUERY_STRING} [L]
RewriteRule ^(.*)-c-(.*).html$ index\.php?main_page=index&cPath=$2&%{QUERY_STRING} [L]
RewriteRule ^(.*)-m-([0-9]+).html$ index\.php?main_page=index&manufacturers_id=$2&%{QUERY_STRING} [L]
RewriteRule ^(.*)-pi-([0-9]+).html$ index\.php?main_page=popup_image&pID=$2&%{QUERY_STRING} [L]
RewriteRule ^(.*)-pr-([0-9]+).html$ index\.php?main_page=product_reviews&products_id=$2&%{QUERY_STRING} [L]
RewriteRule ^(.*)-pri-([0-9]+).html$ index\.php?main_page=product_reviews_info&products_id=$2&%{QUERY_STRING} [L]

# For Open Operations Info Manager
RewriteRule ^(.*)-i-([0-9]+).html$ index\.php?main_page=info_manager&pages_id=$2&%{QUERY_STRING} [L]

# For dreamscape's News & Articles Manager
RewriteRule ^news/?$ index\.php?main_page=news&%{QUERY_STRING} [L]
RewriteRule ^news/rss.xml$ index\.php?main_page=news_rss&%{QUERY_STRING} [L]
RewriteRule ^news/archive/?$ index\.php?main_page=news_archive&%{QUERY_STRING} [L]
RewriteRule ^news/([0-9]{4})-([0-9]{2})-([0-9]{2}).html$ index\.php?main_page=news&date=$1-$2-$3&%{QUERY_STRING} [L]
RewriteRule ^news/archive/([0-9]{4})-([0-9]{2}).html$ index\.php?main_page=news_archive&date=$1-$2&%{QUERY_STRING} [L]
RewriteRule ^news/(.*)-a-([0-9]+)-comments.html$ index\.php?main_page=news_comments&article_id=$2&%{QUERY_STRING} [L]
RewriteRule ^news/(.*)-a-([0-9]+).html$ index\.php?main_page=news_article&article_id=$2&%{QUERY_STRING} [L]

# All other pages
# Don't rewrite real files or directories
RewriteCond %{REQUEST_FILENAME} !-f [NC]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*).html$ index\.php?main_page=$1&%{QUERY_STRING} [L]


Then this is the .htaccess in the awstats dir:

Options +ExecCGI
AddHandler cgi-script pl
DirectoryIndex awstats.pl

AuthUserFile /home/admin/domains/mylittleteashop.com/public_html/awstats/.htpasswd
AuthType Basic
AuthName "AwStats Protection"

<LIMIT GET POST>
require valid-user
</LIMIT>
 
# All other pages
# Don't rewrite real files or directories
RewriteCond %{REQUEST_FILENAME} !-f [NC]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*).html$ index\.php?main_page=$1&%{QUERY_STRING} [L]


That should allow it to work. Page not found would not show up anyway if it was teh .htaccess file..it would simply show the default index page (like Wordpress does).

But you can test it real quick by renaming the .htaccess file and trying to access the stats.

Make sure that there ARE stats...just because your manually updated does not mean there are stats. Stats should be in the domains/domain.tld/stats folder. Also make sure that all the files, including the .htaccess and .htpasswd files are owned by user and not by root in /awstats.
 
Yes, when I rename the htaccess file the stats do work. Putting the .htaccess file back, brings a page not found error.
 
upgrade form fusion plugin

I guess the answer is somewhere in this 200+ replies but i have only one question: how easy is it for a user of the original fusion plugin to upgrade to this one?
 
To fix it add any lines in /usr/local/directadmin/plugins/awstats/user

First off, great plugin.

When trying to view AWSTATS for a domain, I get the following error...

The reason for this error... the /awstats directory WAS NOT created in each of the domain directories. If I manually create the directory in the root of the domain directory, and chown it to the username, AWSTATS works fine.

I did run the alldomains.php command, and AWSTATS is activated for the domain.

Any clues as to why the /awstats directory was not created for all of the domains? Is there a way to create all of these directories without having to do it manually?

Thanks in advance.

To fix problem i add any lines in /usr/local/directadmin/plugins/awstats/user/index.html file

Search this fragment:
----------------begin--------------------------------------------
$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']);
}
----------------end--------------------------------------------
and replace he:
----------------begin--------------------------------------------
$location=$_SERVER["HOME"]."/domains/$domains[$awdomain]/public_html/awstats";
$locationd=$_SERVER["HOME"]."/domains/$domains[$awdomain]/stats";
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']);
echo "Creating AwStats data dir on domain<BR>";
mkdir($locationd);
echo "Setting Directory Permissions on data dir";
chgrp($locationd,$_SERVER['USER']);
}

----------------end--------------------------------------------

And fix this error.
Thanks all.
 
In alldomains.php i've replaced:

Code:
chown ("$location/.htaccess",$_SERVER['USER']);
chown ("$location/.htpasswd",$_SERVER['USER']);

With:

Code:
chown ("$location/.htaccess",$users[$x]);
chgrp ("$location/.htaccess",$users[$x]);
chown ("$location/.htpasswd",$users[$x]);
chgrp ("$location/.htpasswd",$users[$x]);

Now permissions are set right for .htaccess & .htpasswd.

I also get an error that "chmod -L" isn't supported, but that doesn't seem to affect anything.
 
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request www.sgoxygen.com

this is what i see AFTER entering the user and password
 
sorry this internal server error is my bad.

Warning: fopen(/etc/awstats/awstats.sgoxygen.com.conf): failed to open stream: Permission denied in /usr/local/directadmin/plugins/awstats/user/options.php on line 45 Warning: fwrite(): supplied argument is not a valid stream resource in /usr/local/directadmin/plugins/awstats/user/options.php on line 53 Warning: fclose(): supplied argument is not a valid stream resource in /usr/local/directadmin/plugins/awstats/user/options.php on line 54 Password protected!

this is the main problem now :(
 
Strange

I've got a webserver: Centos with DA, installed this awstats as root.

I do not had errors during install. All permissions are correct (even tried 777 for those files).
However, when i push the refresh button in www.domains.nl/awstats (Here you see firts a nice page with every count on 0), i get this message:
Code:
Error: Couldn't open server log file "/var/log/httpd/domains/domain.nl.log" : Permission denied

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

i've searched google, many have the same problem, but none has an answer...

Maybe you?

Help.. :(
 
Awstats suddenly disappeared from my DirectAdmin...i've tried to reinstall it several times but it still doesn't appear there...any solution?

My OS is Redhat CentOS 5 (Final)

EDIT: I noticed AwStats show in the admin panel in the Default skin. But i get this error when trying to disable AwStats for accounts:
Warning: Variable passed to each() is not an array or object in /usr/local/directadmin/plugins/awstats/admin/index.html on line 33
 
Last edited:
direct answer

probably already responded this but I don't find the answer...
with this new version of AWSTATS... if i do this...

open the file: /home/YOUUSER/domains/YOUDOMAIN.com/public_html/awstats/.htaccess
and remove this part
-----------------------
AuthUserFile /home/YOUUSER/domains/YOUDOMAIN.com/public_html/awstats/.htpasswd
AuthType Basic
AuthName "AwStats Protection"

<LIMIT GET POST>
require valid-user
</LIMIT>
-----------------------

open the file: /etc/awstats/awstats.YOUDOMAIN.com.conf
and change this options
-----------------------
AllowToUpdateStatsFromBrowser=0
AllowFullYearView=3
AllowAccessFromWebToAuthenticatedUsersOnly=0
-----------------------
still can happen this...

or the probleam was already fixed???
Sorry for my basic english.. and greetings from Argentina...


'
 
AllowAccessFromWebToAuthenticatedUsersOnly=0

That is the only option you need to change if you remove the .htaccess code.

I would not suggest changing the AllowToUpdateStatsFromBrowser to anything but 0. Huge security risk IMHO.
 
OK.. but if i remove the password... so anyone can see the stats...
they still can use the awstats.pl to do the things that articulate says...?
or that issue was fixed on this new version...?
 
AllowAccessFromWebToAuthenticatedUsersOnly=0
I would not suggest changing the AllowToUpdateStatsFromBrowser to anything but 0. Huge security risk IMHO.

that optionis with "0" is for disable the "update now" link?
 
hey guys,

installed the version that was on page 1.

followed the install steps.

have a centOS 64bit OS.

when installing i get:

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(/etc/awstats/awstats.domain.net.conf): failed to open stream: Permission denied in /usr/local/directadmin/plugins/awstats/user/index.html on line 109 Warning: fwrite(): supplied argument is not a valid stream resource in /usr/local/directadmin/plugins/awstats/user/index.html on line 117 Warning: fclose(): supplied argument is not a valid stream resource in /usr/local/directadmin/plugins/awstats/user/index.html on line 118 Warning: fopen(/home/username/domains/domain.net/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

this amount of errors on install normal?

and when I try to run tune awstats to change/set username and password i get:

Warning: fopen(/home/domain/domains/domain.net/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!

any ideas - if i have to change somthing, please advise.
 
Last edited:
Back
Top