• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Plesk 8.2.1 Linux - AWSTATS

L

lib99

Guest
I had been advised early Aug/2007 by Plesk support that limitations of AWSTATS would be corrected with Plesk v8.2.1. (Common feature requests by users.)

Has anyone noticed any improvements with the stats? Specifically previous months stats are expected to be enabled with this version.

(can't yet verify myself, my update hasn't worked yet)
 
I recognized this missing feature in my version 8.2.1 today! So it still seems not to be avaible yet...
 
Originally posted by lib99
I had been advised early Aug/2007 by Plesk support that limitations of AWSTATS would be corrected with Plesk v8.2.1.
Hi,
Could you detail the limitations of AWStats support in Plesk?

We're planning to migrate all domains from Webalizer to AWStats (we're running Plesk 8.1.1 on RHEL4), but after reading your message before doing that, we want to make sure we won't lose any functionality with the switch.

Thanks.
 
Haven't really tried webalizer with Plesk. It's an either/or option for statistics and personally I prefer AWStats. Essentially, Plesk doesn't run AWStats in CGI mode for security reasons. This limits some of the reporting features. I'd say the most common one requested by users here in the forums is the ability to view past months data.

Originally I was informed that Plesk v8.2.1 would resolve AWStats issues. The latest information from SWsoft is v8.3.

Presumably there are workarounds including installing AWStats on your own. Like many, I'm waiting patiently for SWsoft so as to keep all things Plesk.
 
Originally posted by lib99
I'd say the most common one requested by users here in the forums is the ability to view past months data.
Does that mean that with AWStats from Plesk you cannot access your previous months statitistics at all?

Thanks.
 
Yes. The only history available is the Monthly History SUMMARY. These are the basic statistics showing monthly totals (unique visits, hits, bandwidth, ...).

AFAIK, the previous months details are purged at the start of a new month. At least I haven't found any archive of the data. If you search the forums on the subject you'll find many related postings. SWsoft is aware of the issue and they've indicated plans to release a Plesk version where these concerns should be resolved.

I understand where it is not a top priority, but it is an unfortunate omission in the usability of domain/site statistics.
 
Hi,

I don't know if this theme is dead...

I have the same problem (plesk 8.2.1 + Suse 10.1). The statistics of each month are deleted and only the current month has a detailed html page.

On the other hand, things like AllowToUpdateStatsFromBrowser=1
in configuration files seems to have no effect (it doesn't appear any button at html statistics pages)

:(
 
Hi,

Since my last post on the topic, I did actually find the files with past months statistics. Each is a .txt file in the following respective directories.

/var/www/vhosts/DOMAIN/statistics/anon_ftpstat
/var/www/vhosts/DOMAIN/statistics/ftpstat
/var/www/vhosts/DOMAIN/statistics/webstat
/var/www/vhosts/DOMAIN/statistics/webstat-ssl

file name resembles: awstats112007.DOMAIN-http.txt where DOMAIN = name of each domain.

I found a handy and excellent tool that parses these files into an Excel spreadsheet. www_dot_internetofficer_dot_com/awstats/

Currently released versions of Plesk do not allow AWSTATS to be used in cgi mode. Maybe this affects your setting for AllowToUpdateStatsFromBrowser??
 
I think that the only solution is to uninstall AWSTATS and then reinstall it outside from PLESK...

Somebody knows how awstat can be "extracted" from PLESK claws?

:D
 
Solution?

I have found this procedure to allow to awstats to be executed as cgi...
http://pstree.org/news/show/28

The method works if I change the owner of statistics directory to USER : psaserv

I don't know if this change of owner can be a security hole... :(

On the other hand, it will be convenient to have the .pl in a directory outside from users ftp space... (the user can delete and modify the awstats.pl with this configuration)

Some ideas to improve it?
 
Solution

I have found a solution...
I post the complete explanation here. Sorry for my BAD english


THIS PROCEDURE IS BASE ON THE DESCRIBED AT http://pstree.org/news/show/28


=======================================================
Objective
=======================================================

Implement dynamic awstats satistics in order to have access to previous
moth stats.

The actual static statistics are accessible at
https://domain.ltd/plesk-stat
and protected with user/pass (the same FTP user/pass for the domain)

The new dynamic statistics will be accessible at
https://domain.ltd/dyn-stat
and protected with user/pass (the same FTP user/pass for the domain)

The dynamic statistics also will can be accessed directly to
https://domain.ltd/awstats/awstats.pl?config=domain.ltd-httpd
but you can create a nice HTML page with the menu, instructions and
links to different statistics (web, ssh web, ftp and anon_ftp) and locate
it to dyn-stat directory. Of course https://domain.ltd/awstats/ is
also protected with the same user/pass

=======================================================
I assume that:
=======================================================

A.- The domain for wich the dynamic statistics will be activated is domain.ltd

B.- It is hosted at /srv/www/vhosts/domain.ltd

C.- statistics are generated every night by plesk at
/srv/www/vhosts/domain.ltd/statistics/webstat
/srv/www/vhosts/domain.ltd/statistics/webstat-ssl
/srv/www/vhosts/domain.ltd/statistics/ftpstat
(I avoid anon_ftpstat because I have disabled it)

D.- Their apache configuration files are stored at /srv/www/vhosts/domain.ltd/conf

E.- The user of this domain is userdomain (group psacln & psaserv)

F.- The awstats configuration files are stored at /usr/local/psa/etc/awstats/
and the files are of the form
awstats.domain.ltd-http.conf (web stats config file)
awstats.domain.ltd-https.conf (web ssl stats config file)
awstats.domain.ltd-ftp.conf (ftp stats config file)
I have them with options AllowFullYearView=0 and
ShowFlagLinks = "es ca en gl fr en" (these are the only
options that I have changed from estandar file)

G.- CGI files of awstat are locaetd at /srv/www/cgi-bin
(awstats.pl, lib directory and plugins directory)

H.- Username/password for the user of the domain is stored
by plesk at /srv/www/vhosts/domain.ltd/pd/d..httpsdocs@plesk-stat

I.- Apache (Apache2) can be reloaded nicely executing
/etc/init.d/apache2 reload

J.- websrvmng is located at /usr/local/psa/admin/sbin/websrvmng

=======================================================
Procedure:
=======================================================

1.- Make accessible the directories named at point C for the user userdomain
In my case I needed to change the permissions of /srv/www/vhosts/domain.ltd/statistics
directory to 755 (it has 550). This directory owns to root:psaserv. The user
can not change or add anything here, he/she only can explore it by ftp (nevertheless
this directory is accessible by protected URL https://domain.ltd/plesk-stat then, nothing
new is discovered to the user)

2.- Create a new directory in which locate awstats CGI. This new directory is
/srv/www/vhosts/awstats
awstats: drwxr-xr-x root root
inside awstats:
domain.ltd: drwxr-xr-x userdomain psaserv
inside domain.ltd:
awstats: drwxr-xr-x userdomain psaserv

/srv/www/vhosts/awstats -> Will contain all domain.ltd
/srv/www/vhosts/awstats/domain.ltd -> Here I put the hml pages that allow
to the user to change the language and the kind of stat to view (ftp, ssl, web).
these pages are pages that I have created to my customers and they show my company logo, etc
/srv/www/vhosts/awstats/domain.ltd/awstats -> Here I copy the awstats perl,
libraries, plugins and symlinks to configuration files (see next point)

3.- Copy awstats cgi to /srv/www/vhosts/awstats/domain.ltd/awstats
from /srv/www/cgi-bin
cp -a /srv/www/cgi-bin/* /srv/www/vhosts/awstats/domain.ltd/awstats
(in my case I have also php5 in this directory, then I remove it from
destination)

4.- Change the owner of these files
cd /srv/www/vhosts/awstats/domain.ltd/awstats
chown -R userdomain:psacln *

5.- Create symbolic "soft" lynks to the awstats confguration files
ln -s /usr/local/psa/etc/awstats/awstats.domain.ltd-ftp.conf awstats.domain.ltd-ftp.conf
ln -s /usr/local/psa/etc/awstats/awstats.domain.ltd-http.conf awstats.domain.ltd-http.conf
ln -s /usr/local/psa/etc/awstats/awstats.domain.ltd-https.conf awstats.domain.ltd-https.conf

6.- Create (or modify) configuration files vconf.conf and vconf_ssl.conf.
cd /srv/www/vhosts/domain.ltd/conf
ls
look if vconf.conf and vconf_ssl.conf exists. If they don't exist create
them, otherwise modify them. The content (or added content) is:

----------------------------------
vhost.conf
----------------------------------
Redirect permanent /dyn-stat https://domain.ltd/dyn-stat
----------------------------------

----------------------------------
vhost_ssl.conf
----------------------------------
Alias /dyn-stat/ /srv/www/vhosts/awstats/domain.ltd/
Alias /dyn-stat /srv/www/vhosts/awstats/domain.ltd/
<Directory "/srv/www/vhosts/awstats/domain.ltd/">
AuthType Basic
AuthName "Dyn-Stat"
AuthUserFile /srv/www/vhosts/domain.ltd/pd/d..httpsdocs@plesk-stat
require valid-user
</Directory>
ScriptAlias /awstats/ /srv/www/vhosts/awstats/domain.ltd/awstats/
<Directory "/srv/www/vhosts/awstats/domain.ltd/awstats/">
Options +ExecCGI
</Directory>
----------------------------------

7.- Reconfigure conf files and reload apache. If you wish to reconfigure the
apache configuration files for all domains
/usr/local/psa/admin/sbin/websrvmng -av

If you wish to reconfigure the apache conf file for one domain
/usr/local/psa/admin/sbin/websrvmng --reconfigure-vhost --vhost-name=domain.ltd
/etc/init.d/apache2 reload


8.- Create an index.html file located at
/srv/www/vhosts/awstats/domain.ltd
to link to
Web Stats -> /awstats/awstats.pl?config=domain.ltd-http
Web SSL Stats -> /awstats/awstats.pl?config=domain.ltd-https
FTP Stats -> /awstats/awstats.pl?config=domain.ltd-ftp


Optional: create directories
/srv/www/vhosts/domain.ltd/httpsdocs/dyn-stat: drwxr-xr-x root:root
/srv/www/vhosts/domain.ltd/httpdocs/dyn-stat: drwxr-xr-x root:root
To avoid that the user will create one directory with the same name because any directory with
this name will not be accessible from web (in some sense vhosts.conf and vhosts_ssl.conf
has more "privileges" that the user)


Note: To cancel the access to this dynamic stats to a domain, simply
rename vhosts.conf and vhosts_ssl.conf and execute point 7


===========================================================
FUTURE IMPROVEMENTS
===========================================================
Automatize the process for new domains...
 
Typo?

First off, this is a GREAT tutorial, thanks.

In my setup using Plesk 8.2.1 "/srv" is actually "/var".

On step 3:
cp -a /srv/www/cgi-bin/* /srv/www/vhosts/awstats/domain.ltd/awstats

Inside my cgi-bin dir is a dir called awstats so this command wound up creating
/srv/www/vhosts/awstats/domain.ltd/awstats/awstats/
with all the files in it.

I don't think that's what you intended. I think it should be either:
cp -a /srv/www/cgi-bin/* /srv/www/vhosts/awstats/domain.ltd
or
cp -a /srv/www/cgi-bin/awstats/* /srv/www/vhosts/awstats/domain.ltd/awstats

On step 5:
Create symbolic links where? You should say "in this same directory, i.e., /srv/www/vhosts/awstats/domain.ltd/awstats" just to be clear.
 
Thanks...

In my system I have at /srv/www/cgi-bin the following files and dirs
drwxr-xr-x 4 root root 4096 2008-02-07 15:05 .
drwxr-xr-x 7 root root 4096 2006-04-23 03:51 ..
-rwxr-xr-x 1 root root 546293 2006-06-16 16:15 awstats.pl
drwxr-xr-x 2 root root 4096 2007-11-17 19:55 lib
-rwxr-xr-x 1 root root 2404224 2007-03-03 17:52 php5
drwxr-xr-x 3 root root 4096 2007-11-17 19:55 plugins

I don't have awstats directory here...

All those files and dirs must be copied at
/srv/www/vhosts/awstats/domain.ltd/awstats

Probably it would be more "logical" to have the files located at /srv/www/cgi-bin/awstats
(as in your system), but I don't have this directory...

Nevertheless, since the last update of plesk-awstats the procedure described here is not extremelly necessary
:)
 
Perl execution

After doing all the above, when I browsed to the directory I got just a display of the awstats.pl file. It did not run. I had to add the following to the vhost_ssl.conf file within the directory tags where you had "Options +ExecCGI":

<IfModule mod_perl.c>
<Files ~ (\.pl$)>
SetHandler perl-script
PerlHandler ModPerl::Registry
Options ExecCGI
allow from all
PerlSendHeader On
</Files>
</IfModule>

P.S. What is the Plesk update that made all this "not extremelly necessary"?
 
On of the lasts plesk updates allows to maintain the historic for all statistics... Every night the statistics process runs and generates the html files of the current month. The update allows to preserve the statistics of previous months.

Now I have installed
Plesk 8.3 (psa v8.3.0_build83080131.20 os_SuSE 10.1)
and Base packages of Plesk from 2008 31 Jan
And I have deleted the procedure proposed here...
 
Solution to this problem

Hi guys yesterday i had to resolve this in one server my solution is based on the scripts posted but it run without any modification to the software of the system.
The first script makes the statistics of the last month and the html files to see the drop down list of months in the statistics page also it saves the last 12 months of statistics only.
The syntax is "awstats_makemonth.sh domain.com".
The second script makes the same to all the domains you have to put the absolute path to the first script in the var AMAKEMONTH. this in my server is executed by cron every month.
If you want another month or year you only have to modify the vars YEAR,MONTH in the first script.


I hope this help to resolve this to anyone regards.

Mauro Rossi.
 

Attachments

  • awstats_makemonth.txt
    10.4 KB · Views: 28
  • awstats_updateall.txt
    377 bytes · Views: 18
Back
Top