Summarizer
Summarizer Summarizer - Support Docs  

  Part of Home site:
  http://akakul.co.uk/

  Scripts Home

Summarizer Summarizer
RAQ RAQ File Convertor
FAQ
Useful Links
db.cache (DNS)
CPU Temp Alert
Resolving NS Check
OverQuota Check

Summarizer Summarizer Home
Summarizer Demonstration
Summarizer Downloads
Summarizer Installing
Summarizer Support Docs
Summarizer Version History
Summarizer Copyright & Licence
Summarizer Contact Me/Bugs


Summarizer

Current Version: 1.4.2
Modified on: 10th January 2003


Topics:


Accessing Summarizer

Accessing the sumamrizer reports is simple, you need to just enter http://www.site-you-installed-in.com/dir-installed-in/summarizer.cgi
For RaQ3 & RaQ4 owners that have used the '.pkg' format to isntall the Summarizer script is the MAIN sites (home) stats directory. i.e. http://www.mainsite.com/stats/summarizer.cgi
Dont forget that the directory is normally password protected, so enter your normal username/password if you have password protection.


Requirements for Summarizer

Summarizer is written in perl, and has been test with perl 5. It may work on earlier versions but this has not been tested.
The following perl modules are required:

  • strict - standard to perl - raq3/4 has by default
  • CGI - standard to perl - raq3/4 has by default
  • Fcntl - standard to perl - raq3/4 has by default
  • optional:   LWP::UserAgent - probably standard to most systems - raq3/4 has by default


PKGMasters version

The Webalizer version from PKGMaster.com seems to place the STATS in a special directory '/home/sites/*/users/stats/web', this is a NON-CGI enabled directory, and I recommend you do NOT attempt to install the CGI (summarizer.cgi) in this directory, but rather you create a directory in the ~admin users 'web' directory - i.e. '/home/sites/home/users/admin/web/summarizer' and place the summarizer.cgi and summarizer.ico files in there (as well as password protecting it.
Also you will need to alter the CGI script (see Configuration of 'summarizer.cgi').
A known 'good' configuration change for this situation is as follows: (you will need to edit summarizer.cgi for this)

my $httpd_inside_site_dir = q(users/stats); 
my $webalizer_stats_dir = q(web);


Cobalt/Sun RaQ3 & RaQ4 - Minor Modification required

On the Cobalt/Sun RaQ3 & RaQ4, Front Page is typically installed, and Webalizer can cause problems accessing the 'stats' directory. This has been circumvented by a patch I wrote quite some time back FAQ/99 (UK2RaQ.com). Also the Webalizer version from PKGMaster.com does a similar alteration to webalizer as my patch does (my patch was out first - by months ;-P).

  • 1.3 - PKGMaster.com's RaQ3 & RaQ4 Webalizer version 1.3 packages does NOT need the alteration, unless you have followed FAQ/99 and fixed it so it allows FrontPage to work.

  • 2.x - PKGMaster.com's RaQ4 Webalizer version 2.x packages Requires the alteration.

  • 2.x - FaQ/29 (UK2Raq.com)RaQ3 & RaQ4 Webalizer version 2.x packages Requires the alteration.

What happens when Webalizer is run every night is that the two above patches change the ownership of the stats directory to 'nobody', and you can not run a CGI script like 'Summarizer' as the user 'nobody'.

  • PKGMaster.com's RaQ4 Webalizer version 2.x - The following alterations need to be made to the 'webalizer.pl' perl script:
    pico -w /etc/cron.daily/webalizer.pl

    Scroll down until you find these lines (near the end):

    if (!-d $webpath . "/_vti_bin") {
        $messages .= `echo "Frontpage NOT ENABLED on $webpath"`;
        $messages .= `chown -R httpd:$name $thepath`;
    } else {
        $messages .= `echo "Frontpage ENABLED on $webpath"`;
        $messages .= `chown -R nobody:$name $thepath`;
    }

    Now IMMEDIATLY after the above, insert these lines: - its probably best to paste these, due to the number of ( and ).

    foreach (qw(/home/sites/home/web/stats/summarizer.cgi
      /home/sites/home/web/stats/summarizer.ico)) {
        chown ((getpwnam('admin'))[2], -1, $_)
        if ((-e)  and  ((lstat($_))[4]  ne  (getpwnam('admin'))[2]));
    }
  • UK2Raq.com RaQ3 & RaQ4 Webalizer version 2.x - The following alterations need to be made to the 'webalizer2.pl' perl script:
    pico -w /usr/bin/webalizer2.pl

    Scroll down until you find these lines (near the end):

    foreach (@stats_dir_contents_before) {
        next	if (/\/\.+$/);
        push @stats_dir_contents, $_;
    }

    Now insert this ONE line before the line that says push

    next	if (/\/summarizer\./);

    So it should look like this:

    foreach (@stats_dir_contents_before) {
        next	if (/\/\.+$/);
        next	if (/\/summarizer\./);
        push @stats_dir_contents, $_;
    }

    Now insert this ONE line before the line that says push

If webalizer has already run and altered the ownership of the summarizer.cgi file, you can correct this now quickly, so it will execute as it is supposed to do:

chown admin /home/sites/home/web/stats/summarizer.*

Configuration of 'summarizer.cgi'

Summarizer comes preconfigured for use on a Cobalt/Sun RaQ3 & RaQ4.
However there are some changes you may wish to make, so the FULL configuration is explained here for ALL server types (not just RaQ3/4)

The following variables can be found close to the top of the script, and are abe to be customised


my $auto_check_for_updates  = q(yes);
my $allstats_username       = q();
my $allstats_password       = q();
my $months_to_show          = 12;
my $webalizer_conf_file     = q(/etc/webalizer.conf);
my $httpd_groups_dir        = q(/home/sites);
my $httpd_inside_site_dir   = q(web);
my $webalizer_stats_dir     = q(stats);
my $webalizer_numbers_file  = q(index.html);
my $re_cache_time           = 3600;
my $summarizer_cache        = qq($ENV{'DOCUMENT_ROOT'}/../summarizer.cache);
my $summarizer_cache_perms  = 0600;
my $html_start_tag          = q(<html>);
my $body_start_tag          = q(<body>);
my $html_finish_tag         = q(</body></html>);
my $title_bgcolor           = q(c0c0c0);
		

Configuration by variable name

auto_check_for_updates
By default 'Summarizer' will check for updated software and display a message if new version exists. This is ONLY performed (the check) when the cache is refreshed - either naturally or by forcing a cache refresh. You can find out the new version details by clicking the 'update' option in 'Summarizer'. Set to nothing q() if you wish to disable this useful feature.

allstats_username
'System-wide' username you use to access the 'stats/' directories - (See Webalizer Allstats for information on setting this up)

allstats_password
'System-wide' username's password you use to access the 'stats/' directories - (See Webalizer Allstats for information on setting this up)

months_to_show
Number of months to show/total in the Summarizer reports. Typicaly this would be 12.

webalizer_conf_file
Webalizers conf file and location ('absolute' from the / directory)

httpd_groups_dir
The common base directory of ALL sites. ('absolute' from the / directory) Typically /home/sites

httpd_inside_site_dir
The dir('s) inside the site (ie web - /home/sites/site99/web) do NOT include leading or trailing '/'s. This is the LAST directory that signifys the websites Dcoument Root !! This 'dir' is added to above /home/sites/*/web

webalizer_stats_dir
The actual stats dir where webalizer stores all its statistics in site. this is appended to /home/sites/*/web/stats, do NOT include leading or trailing '/'s.

webalizer_numbers_file
The name within each site of the main page. This is typically the 'index.html' pages that Webalizer write to during each execution. (This should NOT be absolute, it is appended to the /home/sites/*/web/stats/index.html directory after the site's directory as been added)

re_cache_time
Time (seconds) that the cache is to be concidered up-to-date. Anything after this time the cache is automatically regenerated the next time Summarizer is asked to show a stats page.

summarizer_cache
Name and location of the temporary cache we create/use. Try to keep this below the Sites 'Document Root' - so it is never visible to prying eyes on the web.

summarizer_cache_perms
Permissions for the cache (I think 0600 is more than enough). Increase these permissions only if you need to, then the next time Summarizer updates the cache these permissions will be set. (Number is in OCTAL)

html_start_tag
The html start tag - This will be overriddten if /etc/webalizer.conf is found. (Webalizer tag name: #HTMLBody)

html_finish_tag
The html end tag - This will be overriddten if /etc/webalizer.conf is found. (Webalizer tag name: #HTMLEnd)

title_bgcolor
Table title's colour (just like webalizers c0c0c0) - you should include the #, and this may not be left blank.


 © akaKul.co.uk