Re: AWstats for SWS on OpenVMS working - here's how



Carl,

Firstly, many thanks this is a great effort.
I've managed to get things up & running however all my stats are '0' and the
Last Update always shows 'Never Updated'.

I've created the static pages and also tried it on the fly to no avail. I've
peeked inside the .tmp files and they definitely have data in them.

I feel I may have misunderstood your mods to the awstats.pl file. Sorry to
be thick but could yo be more precise about where the new lines should be;
failing that perhaps you could email me a working copy.

Thanks.


"Carl Karcher" <wolf351@xxxxxxxxx> wrote in message
news:1154639124.070105.209660@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
There was a previous thread on this titled:

Is there a port of AWStats on OpenVMS?

<http://groups.google.com/group/comp.os.vms/browse_frm/thread/d7b55bf1c1140c26/>

The answer now is YES, with only one minor change to AWstats.pl. These
instructions have been tested with the following versions of software:

OpenVMS 7.3-2 (alpha), CSWS 2.1, CSWS_PERL 2.1, PERL V5.8-6, AWstats
6.5 and 6.6-beta

1. Follow the very good installation instructions for AWstats at:

<http://awstats.sourceforge.net/docs/index.html>

You can use gnutar (from HP's GNV) to expand the files. Be sure to
allow read access for apache to the created files (if you plan to run
awstats under apache). One way would be to allow world RE access (if
that fits your security requirements) by setting your default
protection before using gnutar (set prot=w:re/def).

The awstats_configure.pl script won't work on VMS but that's ok because
they tell you the manual steps required. One thing to note is DO NOT
place the perl scripts in a directory tree containing ODS-5 extended
file names! E.g. Make sure the directory names (for the entire path) do
not contain any ^ characters. This is a bug in perl that's been
submited to HP.

2. The installation instructions don't explain how to configure
apache/mod_perl to execute perl scripts. Here are two ways to to that:

a. In mod_perl.conf, add the following lines to the end of the file to
allow any file ending in .pl to be handled by modperl's perlrun (this
may not meet your security requirements).

#
# Let any file with a .pl extension execute under ModPerl::PerlRun.
# PerlRun is one of the several modperl 'handlers' to compile and run
# perl scripts in a non-shared environment on the fly.
#
<files *.pl>
sethandler perl-script
PerlHandler ModPerl::PerlRun
PerlSendHeader On
Options ExecCGI
</files>

OR

b. Add the following to mod_perl.conf (or in httpd.conf where you
define the awstats scriptalias) to allow perl scripts to be run from
the directory aliased to awstats:

<Location /awstats>
SetHandler perl-script
PerlHandler ModPerl::PerlRun
Allow from your.domain.only
Options ExecCGI
PerlSendHeader On
</Location>

Before you go on, you should test that you can run perl scripts from
the awstats alias by copying a sample script (say from
apache$common:[perl]perl_rules.pl) to that directory.

3. Now you need to apply a minor modification (4 lines) to awstats.pl.
Following is a comment I've put in awstats.pl explaining the change
required (watch for line wrap - all the lines begin with the # comment
character):

# When running under mod_perl, override exit function with return with
# a return statement (it's not a function) adding the following 2 lines
# immediately after this comment section:
#
# use constant IS_MODPERL => $ENV{MOD_PERL};
# *CORE::GLOBAL::exit = IS_MODPERL ? sub {goto Return_NOT_exit} : sub {
CORE::exit };
#
# AND add the following two lines to the bottom of this file:
#
# Return_NOT_exit:
# return;
#
# Then an exit will jump to the label Return_NOT_exit and do a return.
Ugly
# but I don't know of a better way.
#
# Exit kills the child process running mod_perl. The exit routine is
# supposed to be overridden by mod_perl. Submitted to hp
# as case 3215622699. To be fixed in an ECO to MOD_PERL targeted
# august 2006.

That's the only code change required. I've not submitted it as a bug
since it's only necessary as a work around to bug in HP's mod_perl that
should be fixed soon.

4. Almost ready to run it. Before running you must:

$ define DECC$EFS_CHARSET ENABLE

Otherwise when files of the form *.tmp.nnnnnn (where nnnnnn is the
decimal process ID) are created you will receive "error in version
number" since RMS thinks the version number is > 32K. Note that this
logical is already defined for the VMS apache environment (though it's
not required for awstats to run as a cgi) and is only required when
doing an -update (reading the log files).

If you are planning to specify awstats read the active log file you
also will need to:

$ define DECC$FILE_SHARING ENABLE

5. Now, you can try to run it. Set your default directory to
..wwwroot.cgi-bin and:

$ perl awstats.pl -update -config=yourconfig

You will of course need READ access to the log file you are analyzing.
The result are files of the form awstats*^.yourconfig.txt. Keep in mind
you must use -update on log files from the oldest to the newest.

There have been some performance improvements since the version
mentioned in Alan Winston's book - it now takes under two minutes to
process a 40 MB log file on an ES47/1000. If you have a cluster, be
sure to check out logresolvemerge.

6. While you can produce a static report (.html file) as mentioned
under "III. Run reports: Building and reading reports" in the
installation guide you can also create them dynamically (the whole
point of this excersise) by specifying a url like:

http://your.site/awstats/awstats.pl?config=yourconfig

which should work fine (after a little pause) if you've done everyting
correctly.

In doing this I found two bugs in awstats that have been submitted to
the bug list. Both of them have to do with OS detection an result in
VMS not being correctly detected. See the bug report:

https://sourceforge.net/tracker/?func=detail&atid=113764&aid=1532637&group_id=13764

--
-- Carl Karcher, Waisman Computing Services, Waisman Center, UW-Madison
-- karcher+n0morespam@xxxxxxxxxxxxxxxx



.