WWWCOUNT for VMS
 July 2002, 2.5-mgd4
WWW Count, Copyright © 1995-1999  Muhammad A. Muquit.
Permission to use, copy, modify and distribute this program is hereby granted without fee, provided that this copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. If the source code of the program is modified or enhanced, the source code must be made public and it must be clearly mentioned in the documentation what was modified.

WASD VMS Hypertext Services, Copyright © 1996-2002  Mark G. Daniel.
The WASD package (all associated programs), comes with ABSOLUTELY NO WARRANTY.
This is free software, and you are welcome to redistribute it under the conditions
of the GNU GENERAL PUBLIC LICENSE, version 2.


WWWCOUNT is a VMS port of Muhammad A. Muquit's versatile and widely used COUNT, a standard CGI program to count raw access hits in web pages. It is a graphic counter, which means it only counts if the browser support graphics. It keeps the hit count in a text file. Among many features, it can be used to show time, date and countdown to a date.

[.WWWCOUNT2_5]
[.WWWCOUNT2_2]README
[.WWWCOUNT2_5.DOCS]COUNT.HTML
[.WWWCOUNT2_5.DOCS]COUNT2_5-EX.HTML
http://www.muquit.com/

This port should support WASD, OSU, VMS Apache (CSWS 1.2), Purveyor, and possibly even other "standard" CGI environments under VMS. An original port of WWWCOUNT v2.3/2.4 was provided by Phil Ottewell (phil@pottsoft.demon.co.uk). This 2.5 version uses the basics of the original work (an OSU-only port), but supports all the above servers using WASD's CGILIB library. This OSU support is also considerably more straight-forward and efficient than Phil's. A few minor changes were made, including concurrent access locking for data files and a significant improvement for the VMS C-RTL, making the <stdout> stream not $QIO every putc() used in the software!

Phil Ottewell's port included an OSU "wrapper" DCL procedure that interfaced with the OSU server and provided some extended functionlity. If a data file was not specified with a counter query string ("df=") the procedure created an ODS-2 compatible file name from the referer URL and used that instead. This effectively eliminates clashes between page data file names and removes the need for page authors to explicitly specify data files. If "auto-file-creation" is enabled this port provides the equivalent functionality (and file name generation algorithm) for all platforms. If disabled the usual random number is displayed.

The author of this port does not pretend this is the be-all-end-all of work that could be done. It was quick (a few hours only) but hopefully not too dirty. It is not intended that these modifications be fed back to original COUNT distribution. The modifications can be found using a

 $ SEARCH [.WWWCOUNT2_5...]*.H,*.C /EXCLUDE=CGILIB.* MGD


Installation


The distribution consists of a main archive containing full source and runtime directory tree. WWWCOUNT may be built using a compile+link (build) from this using DECC 5.n->. Two additional archives containing platform-specific, pre-compiled object modules are also available. These allow a link-only (link) installation and should be suitable for VMS V6.0-> (possibly even V5.5-2 with backport library).

WASD
unzip the archive:
  $ SET DEFAULT HT_ROOT:[SRC]
  $ UNZIP "-V" dev:[dir]WWWCOUNT_yymmdd.ZIP
make executable:
(link-only OR compile+link)
  $ SET DEFAULT [.WWWCOUNT2_5.SRC]
  $ @BUILD_COUNT link|build
copy executable:
  $ COPY /PROT=W:RE [.OBJ_axp|vax]COUNT.EXE HT_EXE:

OSU
unzip the archive:
  $ SET DEFAULT WWW_ROOT:[SCRIPT_CODE]
  $ UNZIP "-V" dev:[dir]WWWCOUNT_yymmdd.ZIP
make executable:
(link-only OR compile+link)
  $ SET DEFAULT [.WWWCOUNT2_5.SRC]
  $ @BUILD_COUNT link|build
copy executable:
  $ COPY /PROT=W:RE [.OBJ_axp|vax]COUNT.EXE WWW_ROOT:[BIN]

VMS Apache  (CSWS V1.0)
unzip the archive:
  $ SET DEFAULT APACHE$SHARE:[SRC]
  $ UNZIP "-V" dev:[dir]WWWCOUNT_yymmdd.ZIP
make executable:
(link-only OR compile+link)
  $ SET DEFAULT [.WWWCOUNT2_5.SRC]
  $ @BUILD_COUNT link|build
copy executable:
  $ COPY /PROT=W:RE [.OBJ_axp|vax]COUNT.EXE APACHE$SHARE:[CGI-BIN]


Configuration


Users of the previous 2.3 VMS port will notice that the 2.4/2.5 configuration organization has changed and that this 2.5 VMS port has undertaken VMSifying this in it's own inimitable fashion.  (i.e. this is not a drop-in replacement, some reorganization will be necessary ;^)

WASD users ... no CGIplus version has been made (the reworked structure of the original makes this difficult).

OSU users ... this port requires no DCL procedure to "wrap" the script. The CGILIB routines of the executable provide a native OSU-dialog with the server for establishing the environment variables and output stream format. Any existing [BIN]COUNT.COM must be removed.

For Web-server independence the VMS configuration header file, [.WWWCOUNT2_2.SRC]CONFIGVMS.H, locates the various run-time components using the concealed device WWWCOUNT_ETC:[000000]. This may be defined using the following DCL (where dev: is the physical disk the count directory tree is located on, and dir.dir is whatever physical directories it is located below).

  $ DEFINE /SYSTEM /TRANS=CONCEALED WWWCOUNT_ETC dev:[dir.dir.WWWCOUNT2_5.DATA.]

This should be placed in the system or Web-environment startup files so that is is available with each system or server startup.

If you cannot do a

  $ DIR WWWCOUNT_ETC:[CONF]COUNT.CFG
then the logical is not defined correctly.

Of course the [.DATA] directory tree may be reproduced anywhere else the server has access to and the logical WWWCOUNT_ETC defined for that location. In this way the run-time data does not have to be located in the build area.

Ensure the WWWCOUNT_ETC:[000000] directory tree is read+execute accessable by the server account.

  $ SET FILE /OWN=<server-account> /PROT=O:RE <wwwcount_etc-directory>.DIR
  $ SET FILE /OWN=<server-account> /PROT=O:RE WWWCOUNT_ETC:[000000...]*.*

Ensure the WWWCOUNT_ETC:[DATA] directory and it's contents allow write access.

  $ SET FILE /PROT=O:RWED WWWCOUNT_ETC:[000000]DATA.DIR
  $ SET FILE /PROT=O:RWED WWWCOUNT_ETC:[DATA]*.*

The COUNT program is configured using the WWWCOUNT_ETC:[CONF]COUNT.CFG configuration file. Detail on the configuration directives available for this file can be found in the
[.WWWCOUNT2_5.DOCS]COUNT.HTML document. Note that the counter examples in this do not necessarily work until the counter is installed and configured (and then not with OSU's /htbin/count). [.WWWCOUNT2_5.DOCS]COUNT2_5-EX.HTML provides static examples of some counter images.

Additional digit images and strips may be obtained from http://www.digitmania.holowww.com/

You're now on your own!  Please note that the author of this port is in no position to provide answers to general COUNT configuration or other usage questions. He will consider queries regarding the VMS port or it's configuration.


Testing


WASD & Apache
clock: /cgi-bin/count?display=clock&cache=F
counter: /cgi-bin/count?display=counter&df=sample.dat&cache=F
auto-create counter: /cgi-bin/count?display=counter&cache=F

OSU
clock: /htbin/count?display=clock&cache=F
counter: /htbin/count?display=counter&df=sample.dat&cache=F
auto-create counter: /htbin/count?display=counter&cache=F

Other
clock: /cgi-bin/count.exe?display=clock&cache=F
counter: /cgi-bin/count.exe?display=counter&df=sample.dat&cache=F
auto-create counter: /cgi-bin/count.exe?display=counter&cache=F


Utilities


The MKSTRIP and EXTDGTS utilities are also available for use under VMS (the former being a bit of a hack, but never-mind). The executables are built into the [.WWWCOUNT2_5.SRC.OBJ_axp|vax] directory. For use they need to be assigned as foreign verbs or otherwise made accessable as CLI programs.

Basic instruction on usage is available. Note that VMS MKSTRIP does not use pipes. Two arguments are required, a text file for image file name input (one per line), and an image file name for output.


Mark G. Daniel
Mark.Daniel@wasd.vsm.com.au
Mark.Daniel@dsto.defence.gov.au

Demonstration & Download
http://wasd.vsm.com.au/
http://wasd.vsm.com.au/wasd/
ftp://wasd.vsm.com.au/wasd/index.html