                                     ?                                         WASD Hypertext Services <                                         - Technical Overview      %                    21st November 1998   I                    Version 5.3 release of the WASD VMS Hypertext Services /                    HTTP server (November 1998).                       Supercedes:  .                      5th September 1998 (v5.2)*                      23rd July 1998 (v5.1)+                      30th March 1998 (v5.0) .                      15th November 1997 (v4.5),                      1st October 1997 (v4.4)+                      1st August 1997 (v4.3) )                      1st July 1997 (v4.2) )                      1st June 1997 (v4.1) ,                      1st October 1996 (v3.4)G                      1st December 1995 (initial freeware release, v3.1) +                      9th August 1995 (v2.3) (                      1st May 1995 (v2.1)                      Please Note  G                    As of July 1997 High Frequency Radar Division (HFRD) F                    underwent a change of role and name. It is now WideF                    Area Surveillance Division (WASD). This package has8                    been renamed in accordance with that.                                     Abstract   I                    This document is a technical overview of the implemen- H                    tation of the WASD VMS HyperText Transport Daemon. ItH                    contains information on server startup, configurationG                    and CGI scripting. Previous versions contained brief H                    descriptions of the major code modules of the server,I                    these have now been removed to a document of their own                     (see below).   H                    Also see "WASD Hypertext Environment" for informationE                    on using the WASD VMS Hypertext Services and "WASD F                    Nuts and Bolts" for technical information on server-                    design and implementation.   H                    It is strongly suggested those using printed versionsI                    of this document also access the Hypertext version. It @                    provides online access to some examples, etc.                      Author   !                    Mark G. Daniel 8                    Senior Information Technology Officer2                    Wide Area Surveillance Division>                    Defence Science and Technology Organisation  2                    Mark.Daniel@dsto.defence.gov.au  )                    +61 (8) 82596031 (bus) )                    +61 (8) 82596673 (fax)                       PO Box 1500                    Salisbury'                    South Australia 5108                       Printed Copy   ?                    This book may be available for printing to a F                    PostScript printer. Use a browser to access a print.                    menu in this same location.  E                    Some of the online demonstrations may not work due C                    to the local organisation of the Web environment G                    differing from WASD where it was originally written.                          ii                 .                    WASD VMS Hypertext Services  8                    Copyright  1996-1998 Mark G. Daniel.  I                    This package is free software; you can redistribute it F                    and/or modify it under the terms of the GNU GeneralC                    Public License as published by the Free Software E                    Foundation; version 2 of the License, or any later                     version.   G                    This package is distributed in the hope that it will H                    be useful, but WITHOUT ANY WARRANTY; without even theG                    implied warranty of MERCHANTABILITY or FITNESS FOR A I                    PARTICULAR PURPOSE. See the GNU General Public License $                    for more details.  E                    You should have received a copy of the GNU General H                    Public License along with this package; if not, writeG                    to the Free Software Foundation, Inc., 675 Mass Ave, ,                    Cambridge, MA 02139, USA.                       Eric A. Young  B                    This package can include cryptographic softwareI                    (SSLeay) copyright by Eric Young (eric@CryptSoft.com):   ]                       This library is free for commercial and non-commercial use provided ... N                       Eric Young should be given attribution as the author ...2                       copyright notice is retained  #                    MadGoat Software   H                    For supporting non-Digital-TCP/IP (UCX) this software>                    uses the NETLIB package by Matthew Madison:  H                       permission is granted to copy and redistribute ...,                       for no commercial gain  (                    Ohio State University  G                    This package contains software provided with the OSU F                    (DECthreads) HTTP server package, authored by David                    Jones:   D                       Copyright 1994,1997 The Ohio State University.V                       The Ohio State University will not assert copyright with respectT                       to reproduction, distribution, performance and/or modificationS                       of this program by any person or entity that ensures that all U                       copies made, controlled or distributed by or for him or it bear S                       appropriate acknowlegement of the developers of this program.   N                                                                            iii                 $                    RSA Data Security  G                    This software contains code derived in part from RSA &                    Data Security, Inc:  \                       permission granted to make and use derivative works provided that suchW                       works are identified as "derived from the RSA Data Security, Inc. ]                       MD5 Message-Digest Algorithm" in all material mentioning or referencing '                       the derived work.   #                    Bailey Brown Jr.   G                    LZW compression is implemented using code derived in I                    part from the PBM suite. This code is copyright by the #                    original author:   X                       * GIF Image compression - LZW algorithm implemented with Tree type:                       *                         structure.L                       *                         Written by Bailey Brown, Jr.H                       *                         last change May 24, 1990?                       *                         file: compgif.c                        * \                       *  You may use or modify this code as you wish, as long as you mention7                       *  my name in your documentation.                       Other  G                    OpenVMS, Digital TCP/IP Services for OpenVMS, VAX C, %                    DEC C, VAX and AXP A                    are registered trademarks of Digital Equipment                     Corporation.   G                    MultiNet is a registered trademark of Cisco Systems,                     Inc.   H                    Pathway is a registered trademark of Attachmate, Inc.  H                    TCPware is a registered trademark of Process Software                    Corporation.                                    iv                       P                Contents_________________________________________________________  P                Chapter_1__Introduction__________________________________________      P                Chapter_2__HyperText_Transport_Protocol_Daemon_-_Overview________  P                2.1    Server Features........................................2-1  P                2.2    Server Behaviour.......................................2-2  P                2.3    TCP/IP Packages........................................2-3  P                2.4    International Features.................................2-4  P                2.5    HTTP Methods Usage.....................................2-6  P                       2.5.1     GET..........................................2-6  P                       2.5.2     POST & PUT...................................2-6  P                       2.5.3     DELETE.......................................2-8  P                Chapter_3__New_to_WASD?_Start_Here!______________________________  P                Chapter_4__Installation_and_Update_______________________________  P                4.1    Installation DCL Procedure.............................4-3  P                4.2    Update DCL Procedure...................................4-4  P                4.3    Quick-Check............................................4-5  P                4.4    Re-Linking.............................................4-5  P                4.5    Local Setup Suggestions................................4-6  P                4.6    Organizing Documents...................................4-6  P                4.7    Reporting Problems.....................................4-8  P                Chapter_5__Server_Account_and_Environment________________________  P                5.1    VMS Account............................................5-1  P                5.2    Account Support Files..................................5-2  P                5.3    HTTPd Command Line.....................................5-7  P                       5.3.1     Server Startup...............................5-7  1                                               iii                  M                    5.3.2     Server Command Line Control..................5-9   M                      5.3.2.1       Accounting.............................5-9   M                      5.3.2.2       Authentication.........................5-9   M                      5.3.2.3       Cache.................................5-10   M                      5.3.2.4       DCL/Scripting Subprocesses............5-10   M                      5.3.2.5       DECnet Scripting Connections..........5-10   M                      5.3.2.6       Logging...............................5-10   M                      5.3.2.7       Mapping...............................5-11   M                      5.3.2.8       Shutdown and Restart..................5-11   M             5.4    Multi-Homed Hosts With Digital TCP/IP.................5-12   M             Chapter_6__Server_Configuration__________________________________   M             6.1    Content-Type Configuration.............................6-1   M             6.2    Virtual Services.......................................6-3   M             6.3    Error Reporting........................................6-5   M             6.4    Access Logging.........................................6-7   M                    6.4.1     Log Format...................................6-8   M                    6.4.2     Log Period..................................6-10   M                    6.4.3     Log Per-Service.............................6-11   M                    6.4.4     Log Naming..................................6-11   M             6.5    Directives............................................6-11   M             Chapter_7__Message_Configuration_________________________________   M             7.1    Behaviour..............................................7-1   M             7.2    Message File Format....................................7-2   M             7.3    Supplied Message Files.................................7-4   M             Chapter_8__Mapping_Rules_________________________________________   M             8.1    VMS File System Specifications.........................8-2   M             8.2    Rules..................................................8-3   M                    8.2.1     MAP, PASS, FAIL Rules........................8-3   M                    8.2.2     REDIRECT Rule................................8-4   M                    8.2.3     EXEC and SCRIPT, Script Mapping Rules........8-4   M                    8.2.4     SET Rule.....................................8-6   M             8.3    Rule Interpretation....................................8-7   M             8.4    Mapping Examples.......................................8-8   M             8.5    Virtual Servers.......................................8-10   M             8.6    Conditional Mapping...................................8-11   .                                             iv                 M             8.7    Mapping User Directories (tilde character ("~"))......8-15     M             Chapter_9__Authentication_and_Authorization______________________   M             9.1    Permissions, Path and User.............................9-3   M             9.2    Authorization Configuration File.......................9-4   M             9.3    Virtual Servers........................................9-7   M             9.4    Authorization Configuration Examples...................9-8   M                    9.4.1     KISS........................................9-10   M             9.5    Databases, Authentication and Group...................9-11   M             9.6    Server Authorization Administration...................9-12   M             9.7    SYSUAF-Authenticated Users............................9-13   M                    9.7.1     Authentication Identifiers..................9-13   M                    9.7.2     Nil-Access VMS Accounts.....................9-15   M                    9.7.3     SYSUAF and SSL..............................9-15   M                    9.7.4     Security Profile............................9-16   M             9.8    Controlling Server Write Access.......................9-17   M             9.9    User Password Modification............................9-18   M             Chapter_10__Secure_Sockets_Layer_________________________________   M             10.1   SSL Configuration.....................................10-4   M             10.2   Certificate Management................................10-6   M             10.3   SSLeay................................................10-8   M             10.4   SSL References........................................10-9   M             Chapter_11__Server_Administration________________________________   M             11.1   Breaking-in To The Server!............................11-2   M             11.2   HTTPd Server Reports..................................11-3   M                    11.2.1    Statistics..................................11-3   M                    11.2.2    Configuration...............................11-3   M                    11.2.3    Message.....................................11-4   M                    11.2.4    Mapping.....................................11-4   M                    11.2.5    Path Authorization..........................11-4   M                    11.2.6    User Authentication.........................11-4   M                    11.2.7    Cache.......................................11-4   M                    11.2.8    DCL Scripting...............................11-4   M                    11.2.9    DECnet Scripting............................11-5   M                    11.2.10   Memory......................................11-6   M                    11.2.11   Request.....................................11-6   .                                              v                 M                    11.2.12   SSL.........................................11-6   M                    11.2.13   Activity....................................11-6   M                    11.2.14   WATCH.......................................11-7   M             11.3   HTTPd Server Revise...................................11-8   M             11.4   HTTPd Server Action...................................11-9   M             Chapter_12__WATCH_Facility_______________________________________   M             12.1   Event Categories......................................12-1   M             12.2   Request Filtering.....................................12-3   M             12.3   Report Format.........................................12-4e  M             12.4   Usage Suggestions.....................................12-6   M             12.5   Command-Line Use......................................12-7D  M             Chapter_13__Scripting____________________________________________   M             13.1   Caution!..............................................13-1   M             13.2   Scripting Environment.................................13-20  M             13.3   Script Run-Time.......................................13-3b  M             13.4   CGI Compliance........................................13-4   M                    13.4.1    Example DCL Scripts.........................13-8   M             13.5   Raw HTTP Output.......................................13-9r  M             13.6   Raw HTTP Input.......................................13-11   M             13.7   CGIplus Scripting....................................13-11   M             13.8   DECnet Scripting.....................................13-17r  M                    13.8.1    Script System Environment..................13-19n  M                      13.8.1.1      Proxy Access.........................13-20c  M                      13.8.1.2      DECnet Objects.......................13-20   M                      13.8.1.3      Reducing Script Latency..............13-21t  M                      13.8.1.4      DECnet/OSU Startup...................13-22n  M                    13.8.2    CGI........................................13-22   M                    13.8.3    OSU (DECthreads) Emulation.................13-23c  M                    13.8.4    User Scripts...............................13-26o  M             13.9   Java Scripts.........................................13-28   M             13.10  HTTP Persistant-State Cookies........................13-29   .                                             vi                 M             Chapter_14__Cache________________________________________________n  M             14.1   Cache Suitability Considerations......................14-3o  M             14.2   Cache Content Validation..............................14-5   M             14.3   Cache Configuration...................................14-5   M             14.4   Cache Control.........................................14-6m  M             Chapter_15__Server_Performance___________________________________   M             15.1   Simple File Request Turn-Around.......................15-2M  M             15.2   Scripting.............................................15-4   M             15.3   SSL...................................................15-7   M             15.4   Suggestions...........................................15-8   M             Chapter_16__HTTPd_Web_Update_____________________________________   M             Chapter_17__Utilities____________________________________________   M             17.1   Echo Facility.........................................17-1   M             17.2   Where Facility........................................17-1   M             17.3   Xray Facility.........................................17-2l  M             17.4   StreamLF Utility......................................17-2W  M             17.5   HTTPd Monitor.........................................17-2n  M             17.6   Server Workout (stress-test)..........................17-4                               /                                             vii                      M             Chapter__1_______________________________________________________2               Introduction    M                As of July 1997 High Frequency Radar Division (HFRD) underwentiJ                a change of role and name. It is now Wide Area SurveillanceK                Division (WASD). This package has been renamed in accordanceY                with that.   K                This document provides an technical overview of the WASD VMS L                HTTP server. It is primarily written for use internal to WASDK                and assumes that perpsective without apology. Any additionalgM                usage is subordinate to its role within WASD. The software has L                been written expressly for supporting an intra-organisationalG                hypertext environment on a VMS platform (June 1997 note:iL                since first writing this the industry has settled on the termJ                intranet). It too, is unreservedly tailored to this purposeL                and the requirements of WASD. All programs were designed onlyL                to specifically comply with the requirements of VAX C and DECC                C, within a DEC TCP/IP Services for VMS environment.F  J                The document assumes a basic understanding of the hypertextH                technologies and uses terms without explaining them (e.g.H                HTTP, HTML, URL, CGI, SSI, etc.) The reader is refered toK                documents specifically on these topics (these are often best 7                consulted on-line, on the Internet WWW).   M                Also see "WASD Hypertext Environment" for information on using 1                the WASD VMS hypertext facilities.9  L                It is strongly suggested those using printed versions of thisM                document also access the Hypertext version. It provides onlineo/                demonstrations of some concepts.                   Objectives   M                The primary impetus for an internal Web environment was a 1993iJ                decision by Division management to make as much informationH                as possible, both administrative and research, internallyM                available on-line (to use the current term . . . an intranet). K                Early experimentation with a Gopher implementation soon made M                way for the obvious advantages of the emerging Web technology.   I                It then became the objective of this author to make all ofrH                our systems' VMS-related resources available via HTTP andL                HTML, regardless of the underlying data or storage format. AnL                examination of the WASD package will show that this objective)                is substantially achieved.   N                                                              Introduction  1-1    e            (                Reasons For a Local HTTPd  E                Reasons for developing a local HTTP server are few but                 compelling:  H                o  The WASD (then HFRD) Web implementation began mid-1994&                   (October 1997 note).  K                o  It was prefered to support the hypertext environment on a,M                   VMS platform. This is currently (1995) the most widely used 9                   and accessable environment within WASD.i  M                o  Existing servers (and there are quite a few variations) areiJ                   largely Unix based, although it is being supported (to aM                   greater or lesses extent) across a wide range of platforms.VM                   Ports to VMS, if they exist, are often in progress or half- M                   baked, employing Unixisms that don't translate elegantly to &                   the VMS environment.  J                o  The VMS version of the CERN server (3.0-6) was evaluated"                   during mid-1994:  L                   -  It is not multi-threaded under VMS (i.e. cannot supportK                      concurrent clients). For example, a lengthy search mayaB                      delay other clients for unacceptable periods.  J                   -  Its performance was good with document transfers, but7                      became poor when running a script._  J                   -  It is acknowleged in the release notes that it cannotG                      handle a client cancelling a data transfer (a not-rI                      uncommon action). This was confirmed experimentally.   E                o  An early version of the OSU (DECthreads) server was G                   evaluated via documentation mid-1994. 1998 . . . I am I                   reticent to make comments on now such a widely deployed.                   package :^)T  G                o  HyperText Transport Protocol, in its current form, is I                   relatively simple to implement to the level required to 8                   support intra-Divisional requirements.  J                o  As of December 1995 the server has worked extremely wellE                   and has a number of facilities tailored for the VMSrI                   environment. It can continue to be utilized until thereaK                   are overwhelming reasons for implementing something else.n  H                o  As of June 1997 the server and its associated softwareL                   continues to evolve and provide a stable and effective VMSL                   Web environment, even with the advent of a small number of.                   commercial VMS Web products.               1-2  Introduction  4                   M             Chapter__2_______________________________________________________g  :             HyperText Transport Protocol Daemon - Overview    G                The most fundamental component of the WASD VMS Hypertext G                Services environment is the HTTPd, or HyperText Protocol_I                Transport Daemon, or HTTP server. It has a single-process,.7                multi-threaded, asynchronous I/O design..                 2.1 Server Features   H                The package provides a complete implementation of a basic*                HTTP/1.0 server, including:  ;                o  concurrent, multi-threaded client support   E                o  "GET", "HEAD", "POST" and "PUT" HTTP method support   ,                o  virtual services (servers)  L                o  optional enhanced privacy using Secure Sockets Layer (SSL)E                   technology (USA domestic, full-strength encryption).  I                o  "If-Modified-Since:" / "304 Not Modified" functionality.L                   (document is only sent if modified since time specified by                   client).  G                o  HTTP/1.0 de-facto persistent connections (i.e. "Keep-.K                   Alive:", reducing the number of TCP/IP connects required).  E                o  versatile directory listing (generic and VMS-style).  H                o  CGI-compliant subprocess scripting (with configurable,D                   automatic, MIME content-type initiated activation)  J                o  "CGIplus" scripting (offering reduced latency, increasedF                   throughput and reduced system impact when scripting)  D                o  DECnet-based CGI scripting (with connection reuse)  L                o  user account scripting (provided using the DECnet environ-                   ment).  K                o  OSU (DECthreads server) scripting emulation, with connec-.L                   tion reuse (as per OSU 3.3a), allowing many OSU scripts to(                   be employed unmodified  H                o  script processor (e.g. PERL) configurable on file type                   (extension)   <                o  Server-Side Includes (HTML pre-processing)  N                            HyperText Transport Protocol Daemon - Overview  2-1                 D                o  configurable cache, with time-based and forced re-%                   validation (reload)_  F                o  clickable-image support (both NCSA and CERN formats)  8                o  smart rule mapping (conditional rules)  J                o  "Basic" and "Digest" user authentication and path/group-%                   based authorization.  K                o  SYSUAF-authentication and VMS user security profile based_%                   file access control   J                o  Web-standard, "common" and "combined" access log formatsI                   (allowing processing by most log-analysis tools), along G                   with a user-definition capability allowing custom log.                   formats   L                o  logging periods, where log files automatically change on aM                   daily, weekly or monthly basis (keeps log files ordered and &                   at a managable size)  F                o  host-level access control, on per-host or per-domain)                   acceptance or rejection   G                o  single server can support multi-homed (host name) and (                   multiple port services  K                o  customizable message database (capable of supporting non-.=                   English and concurrent, multiple languages)   H                o  on-line server configuration, including reports on re-L                   quests, loaded configuration, mapping rules, authorization=                   information and graphical activity displays   F                o  on-line, live server processing event report (WATCH)                2.2 Server Behaviour  K                The HTTPd executes permanently on the server host, listeningsM                for client connection requests on TCP/IP port 80 (by default).nM                It provides concurrent services for a (technically) unlimittedKL                number of clients (constrained only by the server resources).G                When a client connects the server performs the following                 tasks:d  3                1. creates a thread for this request   ;                2. reads and analyzes the HTTP request sent, >                   depending on the nature of the request . . .  =                   o  transfer of a file (possibly from cache)c  3                   o  processing of an SSI HTML file9  A                   o  processing of a clickable-image mapping file   ?             2-2  HyperText Transport Protocol Daemon - Overview1                 &                   o  directory listing  1                   o  file/directory create/updatea  *                   o  server administration  +                   o  web file-system updates  2                   o  interpretation of a menu file  E                   o  spawn a subprocess to to provide a CGI scripting !                      environment:m  #                     -  standard CGI   #                     -  WASD CGIplus.  G                   o  connects to a DECnet object to provide a scriptingn!                      environment:.  #                     -  standard CGI_  0                     -  OSU (DECthreads) emulated  I                3. closes the connection to the client and disposes of the.(                   thread data structures  L                For I/O intensive activities like file transfer and directoryI                listing, the AST-driven code provides an efficient, multi-.J                threaded environment for the concurrent serving of multiple                clients..  J                For scripts, the technique of using multi-threaded, concur-K                rent, spawned subprocesses or network processes, attached touJ                standard input/output streams, provides a versatile, exten-J                sible, powerful scripting environment. Any DCL procedure orK                image executing within the process can behave essentially as1K                an HTTP server. This capability is employed to easily extend K                the basic services provided by the core daemon code. An HTTP J                script/server for this environment does not need to concernI                itself with network activities, it merely reads and writes -                from the standard I/O streams.                2.3 TCP/IP Packages   L                The WASD server supports Digital TCP/IP Services (UCX) with a                native image.  D                The "UCX" version is also known to work under TCPwareG                v5.n (UCX compatibility emulation) from Process SoftwareS                Corporation..  G                Using the excellent freeware NETLIB package from MadGoat.M                Software (Matthew Madison), this server can also (potentially)_                support  9                o  Cisco MultiNet for OpenVMS, any version.  N                            HyperText Transport Protocol Daemon - Overview  2-3 .  .            ;                o  PathWay from Attachmate Inc., any version.  H                o  TCPware from Process Software Corporation, any version  L                o  CMU TCP/IP (VAX only) v6.5 or later is not supported! (too=                   much variation from mainstream IP packages)c  K                NETLIB requires VAX/VMS v5.2 or later, or OpenVMS Alpha v1.5i                or later.  L                NETLIB must be obtained and installed separately. This is notI                a difficult undertaking for there is a familiar VMSINSTAL-.5                driven installation and configuration.4  M                The WASD NETLIB support was developed using v2.1, which may be                 obtained from  1                http://www.madgoat.com/netlib.html   -                ftp://ftp.madgoat.com/madgoat/.  M                NETLIB support within the WASD server is tested in-house using.M                the Digital TCP/IP Services package. Other TCP/IP packages may.,                or may not perform as tested.  &             2.4 International Features  H                As of version 4.4 the HTTP server has undergone a limitedC                degree of internationalization. The impetus for this.F                development was the use of the package in some EuropeanA                countries where English is not the first language.   M                As this was not within the original critera while building the M                server it has meant an extensive rewrite of some functionality I                within the code (I hope it's appreciated ;^) The objective.I                is to provide users of the server with a more familiar and H                therefore more comfortable environment. Unfortunately theH                server administrators are still confronted by an English-I                language interface and documentation, but then the package2<                doesn't pretend to be international software!                  Aspects  G                The international features only apply to the server, not *                necessarily to any scripts!  !                o  Server Messages   H                   The server uses an administrator-customizable databaseJ                   of messages that can contain multiple language instancesJ                   of some or all messages, using the Latin-1 character setH                   (ISO8859-1). Although the base English messages can beM                   completely changed and/or translated to provide any message.  ?             2-4  HyperText Transport Protocol Daemon - Overview. .  .            L                   text required or desired, a more convenient approach is toH                   supplement this base set with a language-specific one.  H                   One language is designated the prefered language. ThisH                   would most commonly be the language appropriate to theG                   geographical location and/or clientele of the server..H                   Another language is designated the base language. ThisM                   must have a complete set of messages and is a fall-back for J                   any messages not configured for the additional language.I                   Of course this base language would most commonly be the +                   original English version..  G                   More than just two languages can be supported. If the.L                   browser has prefered languages set the server will attemptM                   to match a message with a language in this preference list._M                   If not, then the server-prefered and then the base languagenH                   message would be issued, in that order. In this way itJ                   would be possible to simultaneously provide for English,I                   French, German and Swedish audiences, just for example.n  F                   For message configuration information see Chapter 7.                  o  Server Dates  I                   Dates appearing in server-generated, non-administrativeeL                   content (e.g. directory listings, not META-tags, which useJ                   Web-standard time formats) will use the natural languageI                   specified by any SYS$LANGUAGE environment in use on then@                   system or specifically created for the server.  "                o  Virtual Services  F                   Virtual-server-associated mapping, authorization andE                   character-sets allow for easy multiple language and I                   environment sites. Further per-request tailoring may be J                   deployed using conditional rule mapping described below.  A                   For virtual services information see Chapter 6.F  *                o  Conditional Rule Mapping  L                   Mapping rules map requested URL paths to physical or otherK                   paths (see Chapter 8). Conditional rules are only appliedhL                   if the request matches criteria such as prefered language,H                   host address (hence geographical location to a certainJ                   extent), etc. This allows requests for generic documentsE                   (e.g. home pages) to be mapped to language versions 4                   appropriate to the above criteria.  F                   For conditional mapping information see Section 8.6.                   o  Character Sets  N                            HyperText Transport Protocol Daemon - Overview  2-5    e            F                   Generally the default character set for documents onH                   the Web is ISO-8859-1 (Latin-1). The server allows theJ                   specification of any character set as a default for textH                   document responses (plain and HTML). In addition, textH                   document file types may be modified or additional onesJ                   specified that have a different character set associatedJ                   with that type. Furthermore, specific character sets mayH                   be associated with mapping paths. A site can thereforeK                   relatively easily support multiple character set document                    resources.  J                   Major WASD scripts also use the server default characterH                   set and/or any request determined character set (basedI                   on request path with conditional mapping to language ordG                   character set preferences) via CGI variable contents.   L                   For further information see [CharsetDefault] and [AddType]4                   in Section 6.5, and Section 8.2.4.  "             2.5 HTTP Methods Usage  J                This section describes WASD-specific characteristics of the2                available HTTP/1.0 request methods.               2.5.1 GET   M                Of course, the GET method is used to access documents suppliedhI                by the server. There is nothing WASD server-specific about                 this method.d               2.5.2 POST & PUT  I                The WASD HTTPd does not differentiate between POST and PUTt5                methods, both are handled identically.                   Script Handling  M                The "normal" usage of the POST method is to return data from amK                <FORM>..</FORM> construct to a script running on the server.uK                In this regard WASD is no different to other any web server;lM                the form data is delivered to the script's standard input as ae7                stream of URL-encoded text. For example:   Y                   name=Fred+Nurk&address=Fred%27s+House%0D%0A0+Nowhere+Lane&submit=Submits  J                Note that WWW_CONTENT_LENGTH will be the length of the form<                data. See Chapter 13 for further information.      ?             2-6  HyperText Transport Protocol Daemon - Overviewn l               #                File Creation/Uploadc  K                If the client sends data back to the server using either theyK                POST or the PUT methods, without a script being mapped to be L                executed in response to that data, the WASD HTTPd will createJ                a file corresponding to the specified path. The data stream%                may be text or binary.t  L                Of course, for the server to accept POST and PUT data in thisK                manner, authentication and authorization must be enabled ande5                allow such access to the request path.v  K                The data stream is processed according to MIME content-type:t  3                o  application/x-www-form-urlencoded   D                   The server specially processes "application/x-www-A                   form-urlencoded" POSTS (i.e. those generated by I                   <FORM>...</FORM>, allowing files to be created directlyoL                   from HTML forms. The processing eliminates any field namesM                   from the URL-encoded data stream, placing only field valuesmK                   into the file. This capability can be quite useful and is 9                   demonstrated in the Update HTTPd module_  *                   <online hypertext link>.  %                o  multipart/form-data   J                   This server can process a request body according to RFC-L                   1867, "Form-based File Upload in HTML". As yet it is not aL                   full implementation. It will not process "multipart/mixed"G                   subsections. The implementation is basic, providing aeH                   facility to allow the upload of a file into the serverH                   administered file system. The ACTION= parameter of theJ                   <FORM> tag must specify the directory (as a URL path) in:                   which the uploaded file will be created.  J                   The following example HTML illustrates how a form may beJ                   used to upload a file from the browser host file system:  ^                      <FORM METHOD=POST ACTION="/web/directory/" ENCTYPE="multipart/form-data">F                      <INPUT TYPE=submit VALUE=" Upload document ... ">>                      <INPUT TYPE=file SIZE=50 NAME=uploadfile>                      </FORM>  )                   <online hypertext link>   M                   NOTE: This capability has only been tested against NetscapeoJ                   Navigator versions 2 and 3. VMS Netscape Navigator 3.0b5H                   hangs if an upload of a variable-record format file isM                   attempted. Stick to STREAM-LF or fixed, or convert the files                   to STREAM-LF.e                  o  text/html                    text/plain  N                            HyperText Transport Protocol Daemon - Overview  2-7 t               M                   Text file created according to the path, VMS record type is                    STREAM-LF.                  o  image/gifv*                   application/octet-stream"                   etc., etc., etc.  J                   Any other MIME type is considered binary and the created8                   file is made an UNDEFINED record type.  !                Directory Creation   K                A directory will be created by the HTTPd if a directory path E                is provided with the POST or PUT methods. For example:e  /                   /dir1/dir2/dir-to-be-created/g                  File Deletion  J                A file will be deleted by the HTTPd if the file path endingM                with a wildard version specification is provided with the POSTe+                or PUT methods. For example:   1                   /dir1/dir2/file-to-be.deleted;*/  !                Directory Deletionr  K                A directory will be deleted by the HTTPd if a directory pathlK                ending with a wildard version specification is provided withn4                the POST or PUT methods. For example:  1                   /dir1/dir2/dir-to-be-deleted/;*i               2.5.3 DELETE  D                The DELETE method should delete the file or directory2                corresponding to the supplied path.                          ?             2-8  HyperText Transport Protocol Daemon - Overviewb s  e                M             Chapter__3_______________________________________________________v  $             New to WASD? Start Here!    G                This chapter provides a quick guide to getting your WASDsE                package installed, configured and serving. This coverspM                initial installation. As of v5.1 an installation DCL procedure ,                simplifies the initial setup.                  1. Unzip Package   J                   Install the files following the guidelines in Chapter 4.  !                2. INSTALL Packageu  L                   Server installation is performed using the INSTALL.COM DCL-                   procedure, see Section 4.1.n  !                   o  Link Packaget  N                      Link the supplied object files to produce VMS executables5                      for the system's version of VMS.   "                   o  Check Package  L                      Using the installation procedure check the operation ofE                      the basic package as recommended in Section 4.3.i  *                   o  Directory Protections  L                      This section checks for correct directory protection inJ                      the HT_ROOT:[000000] tree and prompts to change it to6                      WORLD:RE if it appears incorrect.  *                   o  Create Server Account  G                      Using the installation procedure create the servereF                      account. For further information see Section 5.1.                     o  Disk Quotae  L                      Check if quotas are enabled on the target disk. ProvideL                      an ambit allocation for the server account. Review this#                      at some stage.u  @                   o  Copy Server Support and Configuration Files  F                      Using the installation procedure copy the exampleK                      server support and configuration files as discussed inc!                      Section 5.2.r  #                3. Configure Packaged  N                                                  New to WASD? Start Here!  3-1 a  C            J                   Following the execution of the INSTALL.COM procedure theK                   package should require only minor, further configuration.   =                   Initially two files may require alteration.s  J                   1. The startup file, possibly to set the local HTTPD$GMTK                      logical. Consider using the STARTUP_LOCAL.COM file for N                      other site-specific requirements. Information is provided$                      in Section 5.2.  I                   2. The only configuration that should require immediateuK                      attention will be to the mapping rules, see Chapter 8.   J                   More generally server runtime configuration involves theH                   considerations discussed in Section 4.6 along with the$                   following aspects:  N                   o  Configuring the HTTP server run-time characteristics, see                      Chapter 6.a  I                   o  Mapping request paths to the VMS file system, and todA                      other things such as scripts, see Chapter 8.f  N                   o  Customizing some messages (or all if non-English language1                      environment), see Chapter 7.   E                   o  Establishing an authentication and authorization 0                      environment, see Chapter 9.                  4. Start Server  E                   Execute the startup procedure. Get your browser andt                   connect!  +                5. Find Out What's Wrong :^(m  H                   Of course something will not be right! This can happenL                   with the initial configuration and sometimes when changingL                   configuration. The server provides information messages inA                   it's run-time log, look in HT_ROOT:[LOG.SERVER]   I                   Remember, the basic installation's integrity can always I                   be checked as described in Chapter 4, Section 4.3. This.L                   uses the configuration files from the [EXAMPLE] directory,K                   so provided these have not been altered the server shouldo:                   execute in demonstration mode correctly.  4                   Can't resolve it? See Section 4.7.    )             3-2  New to WASD? Start Here!  e                   M             Chapter__4_______________________________________________________a  #             Installation and Updatea    M                The WASD package and updates will always be distributed as ZIP                 archives.  L                The ZIP archive will contain brief installation instructions.C                Use the following command to read this and any otherf$                information provided.  4                   $ UNZIP -z device:[dir]archive.ZIP  J                For complete package distributions the archive will containM                the complete directory tree. Hence to install or do a complete G                update it is necessary to SET DEFAULT into the top-level G                directory of the disk the package is to be installed on.t  /                   $ SET DEFAULT device:[000000]e  I                For updates to portions of the package only the tree beloweI                HT_ROOT:[000000] is provided, hence it is necessary to SETi<                DEFAULT to HT_ROOT:[000000] before UNZIPping.  0                   $ SET DEFAULT HT_ROOT:[000000]  J                In either case it is recommended to check the integrity of,L                then list the contents of, the archive before UNZIPping. This&                may be done as follows:  4                   $ UNZIP -t device:[dir]archive.ZIP4                   $ UNZIP -l device:[dir]archive.ZIP  H                A complete installation/update (the former) will have the                structure:p  <                    Archive:  HT_ROOT:[000000]HTROOT430.ZIP;1  ^                     WASD (HFRD) VMS Hypertext Services, Copyright (c) 1996,1997 Mark G.Daniel.^                     This package (all associated programs), comes with ABSOLUTELY NO WARRANTY.Q                     This is free software, and you are welcome to redistribute itaV                     under the conditions of the GNU GENERAL PUBLIC LICENSE, version 2.  0                      *  Complete v4.3.0 package.5                      *  $ SET DEFAULT device:[000000] >                      *  $ UNZIP "-V" device:[dir]HTROOT430.ZIP  K                     VMS file attributes saved ... use UnZip 5.n+ on OpenVMS   .                     Archive created 1-AUG-1997  N                                                   Installation and Update  4-1    a            2                     Length    Date    Time    Name2                     ------    ----    ----    ----A                          0  07-30-97  14:15   ht_root/$_read_1st/ ?                          0  07-30-97  14:15   ht_root/aacrt060/ ;                          0  07-30-97  14:15   ht_root/auth/e:                          0  07-30-97  14:15   ht_root/axp/B                       5360  07-30-97  13:23   ht_root/changes.html:                          0  07-30-97  14:15   ht_root/doc/                    .                    .                    .F                      16896  07-30-97  09:23   ht_root/vax/wwwrkout.exeM                      16384  07-30-97  09:21   ht_root/vax/wwwrkout_netlib.exeu5                     ------                    -------m7                   19109754                    996 files   >                An update (the latter) will have the structure:  C                    Archive:  HT_ROOT:[000000]HTROOT430_UPD_01.ZIP;1   ^                     WASD (HFRD) VMS Hypertext Services, Copyright (c) 1996,1997 Mark G.Daniel.^                     This package (all associated programs), comes with ABSOLUTELY NO WARRANTY.Q                     This is free software, and you are welcome to redistribute it V                     under the conditions of the GNU GENERAL PUBLIC LICENSE, version 2.  ]                      *  Mostly minor updates to scripts and utilities for the v4.3.0 package.tS                      *  A couple nuisance-value-bugs have also been fixed in these.NV                      *  SDM2HTM can now generate <FRAMESET> documents (see [DOC]*.COM)  K                     VMS file attributes saved ... use UnZip 5.n+ on OpenVMSe  .                     Archive created 6-AUG-1997  2                     Length    Date    Time    Name2                     ------    ----    ----    ----B                      42957  08-04-97  07:57   src/utils/wwwrkout.cL                      59664  08-04-97  07:57   src/utils/obj_axp/wwwrkout.objL                      19674  08-04-97  07:57   src/utils/obj_vax/wwwrkout.obj>                      26624  08-04-97  07:57   axp/wwwrkout.exeE                      27136  07-30-97  09:21   axp/wwwrkout_netlib.exel                    .                    .                    .=                      45056  08-05-97  11:02   vax/sdm2htm.exedE                        617  08-05-97  09:23   doc/all_docs_framed.comtI                         44  08-05-97  09:23   doc/all_docs_not_framed.com =                        544  08-05-97  09:22   doc/readme.html 5                     ------                    ------- 6                    2773107                    90 files  (             4-2  Installation and Update                 H                The archive may then be UNZIPped. If this is a completelyK                new installation a new directory tree will be created. If an J                update to an existing installation the tree will be created8                "over-the-top" of the existing structure.                  When updating:e  H                o  Some insurance on the directory tree is recommended inI                   case the update should fail or otherwise be unusable or L                   problematic (of course, this is good advice whenever aboutH                   to make major changes to anything!) This may be in theM                   format of a regular site backup, special pre-update backup,lJ                   or special pre-update ZIP archive of the directory tree.M                   The latter two could be accomplished using commands similar #                   to the following:d  Q                      $ BACKUP HT_ROOT:[000000...] location:HTROOT.BCK/SAVE/VERIFYp  J                      $ ZIP "-V" location:HTROOT.ZIP device:[HT_ROOT...]*.*3                      $ ZIP "-T" location:HTROOT.ZIPo  I                   If using ZIP then ensure that a previous version of the I                   target ZIP file does not already exist. If it does thenTH                   that version is updated, a new version is not created.  8                o  New files and directories are created.  M                o  For existing files a new version is created (the first timeeK                   this is about to occur the UNZIPper requests permission - I                   either "A" for all, or "y" or "n" or a per-file basis).   *             4.1 Installation DCL Procedure  L                The INSTALL.COM procedure assists with the first installationG                of WASD. It provides a vanilla setup, using the standardPD                directories and account environment described in thisI                document. All sections prompt before performing any action #                and default to "no".   /                It performs the following tasks:   F                1. Link Executables -  Links the package object code to>                   produce images for the local version of VMS.  M                2. Server Quick-Check -  Executes a procedure that runs up theWL                   HTTPd in demonstration mode. Allows evaluation/checking of5                   the basic package. See Section 4.3.H  J                3. Directory Protections -  This section checks for correctG                   directory protection in the HT_ROOT:[000000] tree andkK                   prompts to change it to WORLD:RE if it appears incorrect.h  N                                                   Installation and Update  4-3 h  A            J                4. Create Server Account -  Creates an unprivileged accountL                   for the HTTP server to execute within. Sets permissions onL                   files and directories allowing appropriate access for this                   account.  I                5. Disk Quota -  Check if quotas are enabled on the targetvK                   disk. Provide an ambit allocation for the server account.e,                   Review this at some stage.  K                6. Server Support/Configuration Files -  Copies example HTTP-K                   server configuration and support files from the [EXAMPLE] L                   directory to the [HTTP$SERVER] and [LOCAL] directories. No@                   copy is made without prompting for permission.  <                After UNZIPping the package do the following:  0                   $ SET DEFAULT device:[HT_ROOT]                   $ @INSTALL  F                NOTE: The installation procedure provides a reasonable,E                vanilla, single-node set-up. If something different isuI                required a little time and thought may be required furthero(                configuring startup, etc.  L                Support files to consider when customizing startup, etc. (see/                Section 5.2 for further detail):i                  o  STARTUP.COMn  #                o  STARTUP_LOCAL.COMn  $                o  STARTUP_SERVER.COM  $             4.2 Update DCL Procedure  G                The UPDATE.COM procedure assists with subsequent updates F                of WASD. It assumes a vanilla setup, using the standardD                directories and account environment described in thisI                document. All sections prompt before performing any action #                and default to "no".m  3                It provides the following functions:<  F                1. Link Executables -  Links the package object code to>                   produce images for the local version of VMS.  M                2. Server Quick-Check -  Executes a procedure that runs up the L                   HTTPd in demonstration mode. Allows evaluation/checking of5                   the basic package. See Section 4.3.n  (             4-4  Installation and Update o  2            F                3. Server Support/Configuration Files -  Copies changedJ                   example HTTP server configuration and support files fromJ                   the [EXAMPLE] directory to the [HTTP$SERVER] and [LOCAL]F                   directories. This copy is made without prompting for                   permission.o  J                4. Post-Update Cleanup -  Prompts for permission to execute<                   the post-update procedure described below.  K                5. Purge Files -  Prompts for permission to purge the entireo+                   HT_ROOT:[000000...] tree.   D                After UNZIPping the updated package do the following:  0                   $ SET DEFAULT HT_ROOT:[000000]                   $ @UPDATE                   Post-Update  H                When confident regarding the success of the update (theseC                activities can be part of the update DCL procedure).e  H                o  The procedure UPDATEAFTER.COM should be executed. ThisM                   will remove files known to exist from previous versions and 2                   relocated or no longer required.  3                      $ SET DEFAULT HT_ROOT:[000000]U#                      $ @UPDATEAFTER   6                o  The directory tree should be purged.               4.3 Quick-Check   J                Once installed or updated it is possible to check the basicL                package at any time using the FREEWARE_DEMO.COM procedure. ItK                should detect the TCP/IP agent in use (if not specify UCX ordI                NETLIB as a parameter). Follow the displayed instructions.T  0                   @device:[HT_ROOT]FREEWARE_DEMO  ?                Problem? SYSTEM-F-SHRIDMISMAT? See next section!                4.4 Re-Linking  M                After an update to the operating system the package may refusee2                to start, reporting a message like:  C                   %DCL-W-ACTIMAGE, error activating image WHAT$EVERi\                   -CLI-E-IMGNAME, image file DKA0:[SYS0.SYSCOMMON.][SYSLIB]WHAT$EVER_SHR.EXEL                   -SYSTEM-F-SHRIDMISMAT, ident mismatch with shareable image  N                                                   Installation and Update  4-5                 G                This implies the executables require re-linking for yourlH                particular version of VMS. This can be accomplished quiteI                simply, perform the linking section only of the update DCL &                procedure, Section 4.2.    '             4.5 Local Setup Suggestions   I                Package updates will never contain anything in these three                 directories:   '                o  HT_ROOT:[HTTP$SERVER]e  !                o  HT_ROOT:[LOCAL]i  (                o  HT_ROOT:[SCRIPT_LOCAL]  L                To prevent the overwriting of local configuration files it isJ                suggested these be placed in the HT_ROOT:[LOCAL] directory.H                Startup files will most probably be placed where-ever theG                local site manages system startup. These could be placed H                in the HT_ROOT:[LOCAL] directory if there is nowhere moreI                appropriate. Authentication databases could also be placedsK                in the [LOCAL] directory. The server account's support files.I                (LOGIN.COM, etc.) may be copied from the HT_ROOT:[EXAMPLE]sE                directory into HT_ROOT:[HTTP$SERVER] and customized as                 necessary.c  D                In like manner, local DCL scripts or DCL wrappers forM                executable scripts should be placed in HT_ROOT:[SCRIPT_LOCAL].iB                Executables should continue to be placed in HT_EXE:  J                Changes that are made in package configuration files, etc.,H                can then be propagated to the local areas as appropriate.  $             4.6 Organizing Documents  J                It is recommended that the server distribution tree and anyJ                document and other Web-specific data areas be kept separateJ                and distinct. The former in HT_ROOT:[000000], the latter inH                something like WEB:[000000]. This logical device could beI                provided with the following DCL introduced into the serverr"                startup procedures:  K                   $ DEFINE /SYSTEM /TRANSLATION=CONCEALED WEB DSA811:[WEB.]d  L                The logical organisation of served data is largely hierarchi-M                cal, organised under the Web-server path root, and is achievedt"                via two mechanisms.  L                1. The natural tree structure provided by a hierarchical file                   system.t  (             4-6  Installation and Update                 G                2. The logical hierarchy possible using rules within thenG                   mapping file to place disparate physical areas into a ;                   single logical structure (see Chapter 8).t  H                WASD has a single section of the file system for the coreI                Web files, such as the Division home page, help areas, WebeH                documentation, etc., it can be accessed using the logicalD                device WEB:[000000]. Incorporated with this are otherK                subdirectories providing storage for specific collections of M                data, such as committee minutes, administration announcements,                 etc.   K                Physically distinct areas are used for good physical reasonsiG                (e.g. the area can best be hosted on a task-local disk),iK                for historical reasons (e.g. the area existed before any WebrL                environment existed) or for reasons of convenience (e.g. letsK                put this where access controls already allow the maintainersi                to manage it).   L                Reasons for an area being physically integrated with the coreL                Web data area can be legitimate (e.g. there is really nowhereK                else it reasonably belongs), convenience (e.g. let's quickly L                put it here) or by logical necessity (it really does below asK                part of the core Web enviroment, e.g. documentation on HTML,                 etc.)                  Guidelines_  E                In general, only Web-related files need to go into theaJ                core physical Web file area. All other groupings should, ifM                possible, be decentralised into the portion of the file systemcM                they represent and logically placed in the server's path usingoH                rules in the mapping file. That is, a given project's WebH                files should be located in the project's part of the fileL                system. If it doesn't have any then it may be a candidate for)                location in the core area.s  H                When locating a Web area in a physically distinct area itI                is possible the maintainers of that data will already haveoF                the correct access controls. If locating an area in theF                core hypertext environment it will be necessary to giveJ                the mantainer ownership of the directory area (and possiblyK                disk quota), or provide ACL access if multiple maintains are                 involved.  I                When locating Web-accessable data in a physically distincteJ                area it will be necessary to update the mapping file with aL                new rule (see Chapter 8). If located within the core Web area4                the rules do not need to be adjusted.  N                                                   Installation and Update  4-7 t  f            "             4.7 Reporting Problems  G                This package, as is generally the case with freeware, is E                mainly developed and supported outside of the author's E                main occupation and working hours. Reports of problemsmF                and bugs (while not necessarily welcome :^), as well asG                general queries, are responded to as soon a practicable.nG                If the documentation is inaccurate or could benefit from I                clarification in some area please advise of this also (theEJ                better the documentation the less queries you have to field7                personally . . . or so the theory goes).e  K                With all reports please include the version of the server or9M                script, and the hardware platform, operating system and TCP/IP *                package and version in use.  J                If a server error message is being generated please examineM                the HTML source of the error page. The "<META...>" information K                contains version information as well as valuable source code I                module and line information. Include this with the report.7  M                If the server is exiting with a server-generated error messageoJ                this information also contains module and line information.3                Please include this with the report.   M                Image crash dumps may also be generated, although these are ofe<                less value than the case of the previous two.  I                Reports may be e-mailed to Mark.Daniel@dsto.defence.gov.au                                           (             4-8  Installation and Update    t                M             Chapter__5_______________________________________________________I  *             Server Account and Environment    D                The HTTP server account should be a standard account,K                preferably in a group of its own (definitely at least a non-.L                system, non-user group), with sufficient quotas to handle the                 expected traffic.                 5.1 VMS Account   H                NOTE: Server process quotas must be sufficient to supportK                the expected traffic load. In particlular PRCLM must supportoK                expected script usage. BYTLM, BIOLM, DIOL, FILLM and PGFLQUO K                are all significant considerations. Symptoms of insufficient &                process quotas include:  J                o  Textual pages OK, but pages with a significant number of5                   images having some or all "broken".   M                o  Scripts failing mysteriously, particularly when multiple in8#                   use concurrently.   L                A general rule is more is better, after all, it will only use#                as much as it needs!7  =                The following provides a_guide to the account:   U                   Username: HTTP$SERVER                      Owner:  HyperText Daemonrd                   Account:  HTTPD                            UIC:    [377,377] ([HTTPD,HTTP$SERVER])N                   CLI:      DCL                              Tables: DCLTABLES1                   Default:  HT_ROOT:[HTTP$SERVER] !                   LGICMD:   LOGIN//                   Flags:  Restricted DisNewMail55                   Primary days:   Mon Tue Wed Thu Fri =                   Secondary days:                     Sat Sun1X                   Primary   000000000011111111112222  Secondary 000000000011111111112222X                   Day Hours 012345678901234567890123  Day Hours 012345678901234567890123X                   Network:  ##### Full access ######            ##### Full access ######X                   Batch:    ##### Full access ######            ##### Full access ######E                   Local:    -----  No access  ------            -----              No access  ------tE                   Dialup:   -----  No access  ------            -----i             No access  ------ E                   Remote:   -----  No access  ------            -----a  N                                            Server Account and Environment  5-1                              No access  ------eV                   Expiration:            (none)    Pwdminimum:  6   Login Fails:     0H                   Pwdlifetime:         90 00:00    Pwdchange:      (pre-             expired)F                   Last Login:            (none) (interactive), 11-MAY-(             1995 08:44 (non-interactive)K                   Maxjobs:         0  Fillm:       300  Bytlm:       300000.K                   Maxacctjobs:     0  Shrfillm:      0  Pbytlm:           0 K                   Maxdetach:       0  BIOlm:       512  JTquota:       1024 K                   Prclm:         100  DIOlm:       512  WSdef:         1000 K                   Prio:            4  ASTlm:       600  WSquo:         2000eK                   Queprio:         0  TQElm:       100  WSextent:     20000aK                   CPU:        (none)  Enqlm:       256  Pgflquo:     200000o(                   Authorized Privileges:$                     NETMBX    TMPMBX%                   Default Privileges: $                     NETMBX    TMPMBX    %             5.2 Account Support Filese  L                NOTE: Support procedures often change between versions. It isJ                always advisable to check the versions documentation before&                installing or updating.  :                Examples may be found in HT_ROOT:[EXAMPLE].  &                <online hypertext link>                   HTTPd Executables  ?                Two server executables are built by the package.a  G                o  HTTPD.EXE -  This provides native support for Digitaln(                   TCP/IP services (UCX).  F                o  HTTPD_NETLIB.EXE -  This provides NETLIB support for*                   packages other than UCX.  K                Two additional executables are built by the SSL package (see                 Chapter 10).   G                o  HTTPD_SSL.EXE -  This provides SSL for Digital TCP/IP !                   services (UCX).   L                o  HTTPD_SSL_NETLIB.EXE -  This provides SSL based on NETLIB,.                   for packages other than UCX.      /             5-2  Server Account and Environment     4                            Privileged Imagel  L                As this image is to be installed with privileges unauthorizedH                use should be prevented by applying an ACL similar to the6                following against the executable image:  3                   $ SET SECURITY HT_EXE:HTTPD.EXE -eO                     /ACL=((IDENT=HTTP$SERVER,ACCESS=R+E),(IDENT=*,ACCESS=NONE))u  K                This can be done once, at installation, or for peace-of-mindS@                (a.k.a. VMS-ish paranoia) at each server startup.  L                As the HTTP$SERVER account should be completely unprivileged,K                and the HTTPd image requires NETMBX, TMPMBX, PRMMBX, PSWAPM, E                SYSNAM and SYSPRV privileges (see the "Nuts and Bolts"rH                document for a description of how and why the server usesF                these privileges). It must be installed using a command(                similar to the following:  @                   $ INSTALL = "$SYS$SYSTEM:INSTALL/COMMAND_MODE"`                   $ INSTALL ADD HT_EXE:HTTPD.EXE /PRIVILEGE=(ALTPRI,PRMMBX,PSWAPM,SYSPRV,SYSNAM)                  Logical Names  M                The following logical names are essential for the operation of C                the HTTPd server and must be defined before startup:   L                o  HTTPD$AUTH -  location of the authentication/authorizationH                   configuration file (defined system-wide, or in the job+                   table if server-specific)   M                o  HTTPD$CONFIG -  location of the configuration file (defined F                   system-wide, or in the job table if server-specific)  I                o  HTTPD$MAP -  location of the mapping rule file (defined F                   system-wide, or in the job table if server-specific)  L                o  HTTPD$MSG -  location of the message file (defined system-?                   wide, or in the job table if server-specific)n  M                o  HTTPD$GMT -  offset from GMT (e.g. "+10:30", "-01:15"). ForsM                   systems supporting DTSS (e.g. DECnet-Plus) this logical maykL                   be left undefined, with server time being calculated using8                   the SYS$TIMEZONE_DIFFERENTIAL logical.  I                o  HTTPD$LOG -  if logging is enabled and no log file name M                   specified on the command line, this logical must be defined J                   to locate the file. When a logging period is in use thisK                   logical need only contain the directory used to store thes                   logs.4  F                o  HTTPD$SSL_CERT -  when using the SSL executable this:                   logical locates the default certificate.  N                                            Server Account and Environment  5-3    R            M                o  HTTPD$STARTUP_SERVER . . . - can be used to pass parametersn#                   to HTTPd startup.   K                o  CGI-BIN -  system logical defining a search list with the I                   architecture-specific executable directory first, local L                   script directory second, then the common script directory,(                   as a concealed device.  N                o  HT_AUTH -  directory containing authentication/authorization#                   databases (files)   F                o  HT_EXE -  directory containing the executable images  I                o  HT_LOGS -  optional definition, for convenient log fileh                   specification.  G                o  HT_SERVER_LOGS -  optional definition, for convenientd@                   detached server process log file specification  J                The following logical name is created by the executing HTTPB                server and defines the name of the control mailbox:  #                o  HTTPDport$CONTROL   L                The following logical names are created by the executing HTTP>                server if the HTTPd monitor utility is enabled:  "                o  HTTPDport$COUNT1  "                o  HTTPDport$COUNT2                  o  HTTPDport$PID   #                o  HTTPDport$REQUESTk  /                Server Process Logging Directoryv  M                The server process log directory (output for the detached HTTPYM                server processes) may require explicit access controls for theeL                HTTPd account. This can be done by applying an ACL similar to                the following:   :                   $ SET SECURITY HT_ROOT:[LOG]SERVER.DIR -N                     /ACL=((IDENT=HTTP$SERVER,ACCESS=R+W+E, OPTIONS=DEFAULT), -=                           (IDENT=HTTP$SERVER,ACCESS=R+W+E), -tC                           (IDENT=*,ACCESS=NONE, OPTIONS=DEFAULT), - 0                           (IDENT=*,ACCESS=NONE))  H                As with the ACL on the server executable this can be doneH                once, at installation (or, if right over the top, at eachK                server startup). Appropriate disk quotas may also need to be:1                applied. Also see Section 5.3.2.6.r  /             5-4  Server Account and Environment     s                            STARTUP.COM  J                Putting all this together the HTTP server startup procedureK                becomes something similar to the supplied example. It should I                be called from SYSTARTUP_VMS.COM or the site's equivalent.h  J                This procedure will support simple and quite complex sites.J                It works closely with STARTUP_SERVER.COM (see below). It isH                designed to accept parameters from the command-line or asJ                pre-assigned symbols. Operating in this fashion should meanJ                that no modifications will need to be made to the procedureI                itself. Startup characteristics are essentially determined I                by DCL symbol values. Some symbols are booleans, switchingnK                functionality off and on, others require string values. When L                relevant startup values are not assigned a reasonable default;                will be applied. See the following examples.s  L                Startup characteristics can be determined by supplying symbolL                assignment values as command-line parameters when calling the                procedure.T  Q                   $ @$1$DKA0:[HT_ROOT.LOCAL]STARTUP WASD_NETLIB=1 WASD_DECNET=1 -0N                     WASD_SSL=1 WASD_SSL_CERTIFICATE="HT_ROOT:[LOCAL]ALPHA.PEM"  J                Startup characteristics can also be determined by assigningE                the symbol values before calling the procedure itself.   #                   $ WASD_NETLIB = 1f#                   $ WASD_DECNET = 1                     $ WASD_SSL = 1E                   $ WASD_SSL_CERTIFICATE = "HT_ROOT:[LOCAL]ALPHA.PEM"a3                   $ @$1$DKA0:[HT_ROOT.LOCAL]STARTUPe  H                Check the procedure itself for detail on symbol names and                functionality.   /                See HT_ROOT:[EXAMPLE]STARTUP.COMr                   STARTUP_LOCAL.COM  E                This file is automatically executed by the STARTUP.COM K                procedure immediately before the server is actually started. G                It is provided to supply all the local site's additional K                startup requirements. Place site-specific server environment D                startup in here, leaving STARTUP.COM alone as much as                possible.  5                See HT_ROOT:[EXAMPLE]STARTUP_LOCAL.COMe    N                                            Server Account and Environment  5-5 m  t            !                STARTUP_SERVER.COM   4                This procedure serves a dual purpose.  I                1. In a simple site setup it is submitted to the SYS$BATCHeL                   queue during startup. The batch portion creates a detachedI                   process, which then again uses this procedure as input,r1                   supporting the executing HTTPd.   M                2. For a site that wishes to support different services acrosstK                   multiple nodes in a cluster, or to support multiple HTTPdtI                   processes on the one system (each by implication havingeK                   differing services, see Section 6.2), this procedure actseM                   as a template for supporting these (and then is used in thelB                   same batch and detached manner described above).  M                   After deciding on the organisation of nodes and/or services E                   copy this procedure, locating the files in the same M                   directory as STARTUP.COM, and having destination file names I                   representing the nodes and/or ports desired. Ensure any M                   copies have read and execute permission for the HTTP$SERVER                    account!  L                   o  If multiple nodes in a cluster are to provide differentL                      services then create a file for each system as with the+                      destination name being   3                         STARTUP_SERVER_nodename.COMW  M                   o  If a single system is to provide multiple services usingbK                      multiple processes then the target file name must alsotJ                      include the identifying port number (the first in the.                      service list), as follows  8                         STARTUP_SERVER_nodename_port.COM  M                   For any given system, STARTUP.COM searches for these, based L                   on the node name, and will execute any found, one per nodeJ                   and/or node-port. If none of these are found it executesJ                   the basic STARTUP_SERVER.COM, which itself should not be                   modified.r  A                   Backward-compatibility is provided for pre-v5.3 ?                   installations, with STARTUP.COM executing HT_4X                   ROOT:[HTTP$SERVER]HTTPD_BATCH.COM and HT_ROOT:[HTTP$SERVER]HTTPD80.COM1                   if none of the above are found.   E                To pass parameters to the HTTPd executable for startup K                configuration (e.g. /SERVICE, /SYSUAF, etc.) two methods are 8                available, the second is the recommended.  F                1. "Hard-wire" them by modifying the procedure's HTTPD_$                   PARAMETERS symbol.  /             5-6  Server Account and Environmentc i  a            L                2. Define a system logical containing the required parametersM                   in the site's STARTUP_LOCAL.COM procedure. The logical name I                   should be begin "HTTPD$" and then be continued with then+                   procedure's name, that isd  )                      HTTPD$STARTUP_SERVERT2                      HTTPD$STARTUP_SERVER_nodename7                      HTTPD$STARTUP_SERVER_nodename_porta'             as in the following exampleM  B                      $ DEFINE /SYSTEM HTTPD$STARTUP_SERVER_ALPHA -_                               "/SYSUAF /SERVICE=""http://alpha.wasd.dsto.defence.gov.au:8000"""i  6                See HT_ROOT:[EXAMPLE]STARTUP_SERVER.COM                  LOGIN.COM  M                This procedure provides the HTTP server account login control.a  -                See HT_ROOT:[EXAMPLE]LOGIN.COMP  "             5.3 HTTPd Command Line  M                Command-line qualifiers provide some server startup control as .                well as server runtime control.                5.3.1 Server Startup  I                When starting up the server several characteristics of the F                server may be specified using qualifiers on the commandL                line. If not specified appropriate defaults are employed. ForM                recommended methods of passing parameters to the executable at 5                server startup see STARTUP_SERVER.COM.   K                o  /ACCEPT= comma-separated list of hosts/domains allowed to '                   connect to the serverh  M                o  /AUTHORIZATION=SSL the "SSL" parameter causes all authenti- L                   cation (both SYSUAF and HTA database) to be available only8                   via "https:" requests (see Chapter 10)  I                o  /CGI_PREFIX= the prefix to the CGI symbol names createdYK                   for a script (defaults to "WWW_", similar to the CERN VMSi(                   HTTPd, see Chapter 13)  K                o  /DO= command to be performed by the executing server (seea                    Section 5.3.2)  G                o  /FILBUF= number of bytes in the read buffer for files E                   open for processing (i.e. menu files, image mapping J                   configuration files, pre-processed HTML files, etc., not(                   direct file transfers)  L                o  /FORMAT= overrides the configuration parameter [LogFormat]  N                                            Server Account and Environment  5-7 H  r            L                o  /REJECT= comma-separated list of hosts/domains not allowed*                   to connect to the server  D                o  /[NO]LOG[=name] either disables logging (overridesM                   configuration directive), or enables logging and optionally G                   specifies the log file name (also see section Logical E                   Names, logging is disabled by default). If the file M                   specification is "SYS$OUTPUT" the server issues log entriesoM                   to <stdout>, allowing user-defined log formats to be easily9&                   checked and refined.  M                o  /NETBUF= minimum number of bytes in the network read buffers  K                o  /OUTBUF= number of bytes in the output buffer (for direct K                   file transfers, buffered output from menu interpretation, +                   HTML-preprocessing, etc.)   L                o  /PERIOD= overrides the configuration parameter [LogPeriod]  L                o  /PORT= overrides the configuration parameter [Port] BUT isM                   in turn overridden by the [Service] configuration parameter M                   and /SERVICE= qualifier (is really only useful for use with &                   the /DO= qualifier).  C                o  /PRIORITY= server process priority (default is 4)   L                o  /[NO]PROFILE allows SYSUAF-authenticated username securityF                   profiles to be used for file access (see Section 9.7  L                o  /PROMISCUOUS[=password] server will accept any authentica-K                   tion username/password pair (used for testing, demonstra-                    tions, etc.)  D                o  /SERVICE= comma-separated, list of server servicesC                   (overrides the [Service] configuration parameter)0  K                o  /[NO]SSL[=version] controls Secure Sockets Layer protocoleG                   behaviour. The version can be any of "2", "3" or "23"0K                   (i.e. both 2 and 3, and the default) specifying which SSL0;                   protocol version the server will service.   J                o  /SUBBUF= number bytes in a subprocess' SYS$OUTPUT buffer  F                o  /[NO]SWAP controls whether the server process may beE                   swapped out of the balance set (default is swappings                   disabled)a  G                o  /[NO]SYSUAF[=ID,SSL] allows or disallows (D) usernamerF                   authentication using the server system's SYSUAF (seeI                   Section 9.7, the optional "SSL" parameter causes SYSUAFlK                   authentication to be available only via "https:" requests I                   (see Chapter 10), and the optional "ID" parameter makes L                   SYSUAF authentication only available to account possessing9                   a specific identifier. See Section 9.7.o  /             5-8  Server Account and Environmentc b               J                o  /VERSION merely displays the executable's version string*                   and the copyright notice  E                o  /[NO]WATCH= controls the use of the WATCH reportingS?                   facility. See Chapter 12 for further details.   M                Note:  buffer sizes apply on a per-request (thread) basis, andoK                may be tailored for specific environments at server startup.   -             5.3.2 Server Command Line Control   I                A foreign command for the HTTPD control functionality willaM                need to be assigned in the adminstration users' LOGIN.COM, for                 example:X  *                   HTTPD == "$HT_EXE:HTTPD"2                   !HTTPD == "$HT_EXE:HTTPD_NETLIB"  I                Some control of the executing server is available from theSL                DCL command line on the system on which it is executing. ThisI                functionality, via the /DO= qualifier, is available to the I                privileged user. If a non-default server port, or multiple H                servers on the one system are being used, then it will beL                necessary to provide a /PORT= qualifier with any command, andJ                possibly issue it multiple times. Of course, these commandsF                are available from batch jobs as well as interactively.               5.3.2.1 Accounting  F                Server counters may be zeroed. These counters are thoseH                visible from the statistics admininstration menu item and/                when using the HTTPDMON utility.o  "                   $ HTTPD /DO=ZERO  "             5.3.2.2 Authentication                  See Chapter 9.o  G                The authorization rule file (HTTP$AUTH) may be reloaded.   '                   $ HTTPD /DO=AUTH=LOAD   G                The authentication cache may be purged, resulting in re-GI                authentication for all subsequent authorization-controlledwK                accesses. This may be useful when disabling authorization or M                if a user has been locked-out due to too many invalid password                 attempts.  (                   $ HTTPD /DO=AUTH=PURGE  N                                            Server Account and Environment  5-9    l                         5.3.2.3 Cache   I                Server cache control may also be exercised from the server G                administration menu, see Chapter 11. The file cache (see J                Chapter 14) may be enabled, disabled and have it's contents;                purged (declared invalid and reloaded) using   &                   $ HTTPD /DO=CACHE=ON'                   $ HTTPD /DO=CACHE=OFF )                   $ HTTPD /DO=CACHE=PURGEi  .             5.3.2.4 DCL/Scripting Subprocesses  F                These commands can be useful for flushing any currentlyI                executing CGIplus applications from the server, enabling a4M                new version to be loaded with the next access. See Chapter 13.   M                All scripting subprocesses, busy with a request or not, can be @                deleted (this may cause the client to lose data).  (                   $ HTTPD /DO=DCL=DELETE  L                A gentler alternative is to delete idle subprocesses and mark@                busy ones for deletion when completed processing.  '                   $ HTTPD /DO=DCL=PURGEc  0             5.3.2.5 DECnet Scripting Connections  I                All DECnet connections, busy with a request or not, can be E                disconnected (this may cause the client to lose data).d  /                   $ HTTPD /DO=DECNET=DISCONNECT   L                Purging is a better alternative, disconnecting idle tasks andA                marking busy ones for disconnection when complete.a  *                   $ HTTPD /DO=DECNET=PURGE               5.3.2.6 Logging   K                Server logging control may also be exercised from the server 3                administration menu, see Chapter 11.i                  Open a log file.l  &                   $ HTTPD /DO=LOG=OPEN  J                Optionally open and specify a log file name. This overridesC                any /LOG=file-name or HTTPD$LOG specified file name.c  0                   $ HTTPD /DO=LOG=OPEN=file-name  M                The log file may be closed and reopened using a different namepJ                (allowing continuous operation but, for example, with dailyI                log files). This overrides any /LOG=file-name or HTTPD$LOGr#                specified file name.   0             5-10  Server Account and Environment e  h            2                   $ HTTPD /DO=LOG=REOPEN=file-name  "                Close the log file.  '                   $ HTTPD /DO=LOG=CLOSEi  @                Unwritten log records may be flushed to the file.  '                   $ HTTPD /DO=LOG=FLUSHR  L                The format and period specification of the log may be changedL                (only takes effect after the next log file open/reopen) using  /                   $ HTTPD /DO=LOG=FORMAT=stringL/                   $ HTTPD /DO=LOG=PERIOD=string=               5.3.2.7 Mappingh                  See Chapter 8.   @                The mapping rule file (HTTP$MAP) may be reloaded.  !                   $ HTTPD /DO=MAP   (             5.3.2.8 Shutdown and Restart  D                Server shutdown may also be exercised from the server3                administration menu, see Chapter 11.   K                The server may be shut down, without loss of existing client J                requests. Connection acceptance is stopped and any existingB                requests continue to be processed until conclusion.  "                   $ HTTPD /DO=EXIT  K                The server may be immediately and unconditionally shut down.o  &                   $ HTTPD /DO=EXIT=NOW  K                The server may be restarted, without loss of existing clientpJ                requests. Connection acceptance is stopped and any existingG                requests continue to be processed until conclusion. ThistI                effectively causes the server to exit normally and the DCLc/                wrapper procedure to restart it.   %                   $ HTTPD /DO=RESTARTl  I                This variant restarts the server immediately regardless ofe$                existing connections.  )                   $ HTTPD /DO=RESTART=NOW   N                                           Server Account and Environment  5-11                 5             5.4 Multi-Homed Hosts With Digital TCP/IPy  G                A multi-homed host responds to connections for more thaniI                one network address. Details on configuring Digital TCP/IP.J                (UCX) for this behaviour may be found in the Digital TCP/IPH                Management manual, section on "Subnetwork Routing" (3.4.8J                in the November 1995 edition) and Digital TCP/IP ManagementF                Command Reference, section on "SET INTERFACE" (NovemberJ                1995 edition). The server configuration parameter [Service]L                allows for the processing of requests for multiple host-namesI                and/or ports (see Section 6.5), supporting virtual servers L                (see Section 6.2) while conditional mapping rules can further?                enhance this basic capability (see Section 8.6).r  L                Assuming an alternate, unused host name exists (for example):                     $ UCXOc                   UCX> SET HOST "second.host.name" /ADDRESS=131.185.30.2 /ALIAS=("second","SECOND")s                   UCX> [EXIT]a                   $   L                The system IP interface can be determined as follows (in thisF                example it is SE0, the LO0 is the localhost interface):  %                   UCX> SHOW INTERFACEeT                                                                              Packetsa                   Interface   IP_Addr         Network mask          Receive          Send     MTU   a                    SE0        131.185.30.1    255.255.0.0            595567        262764    1500id                    LO0        127.0.0.1       255.0.0.0                   1           573   65535  ?/                   UCX> SHOW INTERFACE SE0 /FULLt                    Interface: SE0`                     IP_Addr: 131.185.30.1      NETWRK: 255.255.0.0       BRDCST: 131.185.255.255V                                         Ethernet_Addr: AA-00-04-00-59-04    MTU:  1500                   .                    .e                   .e:                     Restarting attempts                  0:                     Successful restarts                  0  K                Note the network and broadcast masks of the interface above. L                The basic procedure then is to create a pseudo-interface (theA                "A" added to the hardware device name) as follows:   `                   UCX> SET INTERFACE SEA0 /HOST="second" /NET=255.255.0.0 /BROAD=131.185.255.255/                   UCX> SET PROTOCOL IP /FORWARD   M                After the above commands the interfaces should appear as shown                 below:d  0             5-12  Server Account and Environment                 %                   UCX> SHOW INTERFACEiT                                                                              Packetsa                   Interface   IP_Addr         Network mask          Receive          Send     MTU   a                    SE0        131.185.30.1    255.255.0.0            595567        262764    1500ia                    SEA0       131.185.30.2    255.255.0.0               169            99    1500 d                    LO0        127.0.0.1       255.0.0.0                   0          2263   65535  ?  M                These commands can be done interactively, during each startup, M                or placed in the permanent UCX configuration database once, as                 follows:e  g                   UCX> SET CONFIG INTERFACE SEA0 /HOST="second" /NET=255.255.0.0 /BROAD=131.185.255.255i6                   UCX> SET CONFIG PROTOCOL IP /FORWARD  -                Note: Originating Host Address   J                Digital TCP/IP Services v4.1 at least, appears to determineI                an outgoing connection's originating host address from the L                IP address of the "highest" pseudo-interface defined (in thisM                case from the SEA0, resulting in an apparent source address ofaK                131.185.30.2). This can cause some confusion on remote hostsiK                as to the origin of a connection, and otherwise be generally                 undesirable..  L                A solution appears to be to assign the primary address to theM                last defined interface. This means the original interface mustm!                be removed using a   1                   UCX> SET CONFIG NOINTERFACE SE0e  H                then explicitly redefining it and then the new interface,K                ensuring the first is the non-primary address and the secondi                the primary.                                 N                                           Server Account and Environment  5-13 R  _                M             Chapter__6_______________________________________________________w                Server Configuration    F                Server configuration basically concerns itself the veryM                fundamental behaviour of the server process. Requirements such K                as buffer and cache sizes, timeout values, scripting limits, J                content-types, icons, number and type of services offerted,C                etc., are determined from configuration information..  E                By default, the system-table logical name HTTPD$CONFIGmH                locates a common configuration file, unless an individualH                configuration file is specified using a job-table logicalK                name. Simple editing of this file changes the configuration.iL                Comment lines may be included by prefixing them with the hashI                "#" character. Configuration file directives are not case- K                sensitive. Any changes to the configuration file can only beTJ                enabled by restarting the HTTPd process using the following,                command on the server system.  %                   $ HTTPD /DO=RESTARTA  M                A server's currently loaded configuration can be interrogated.i6                See Chapter 11 for further information.  *             6.1 Content-Type Configuration  D                HTTP uses a quasi-standard implementation of the MIMEI                (Multi-purpose Internet Mail Extensions) specification foraJ                identifying the type of data returned in a response. A MIMEJ                content-type consists of a plain text string describing theL                data as a type and slash-separated subtype, as illustrated in&                the following examples:                     text/htmlf                   text/plain                   image/gif,                   image/jpeg*                   application/octet-stream  M                The content-type is returned to the client as part of the HTTPaL                response, the client then using this information to correctlyG                process and present the data contained in that response.s  G                In common with most HTTP servers WASD uses a file's type L                (extension, suffix, e.g. ".HTML", ".TXT", ".GIF") to identifyJ                the data type within the file. The [AddType] directive (seeL                below) is used in configuration to bind a file type to a MIME  N                                                      Server Configuration  6-1 p  f            M                content-type. To make the server recognise and return specificwK                content-types the [AddType] directives matches file types toi                content-types.U  J                NOTE: When adding a totally new content-type to the config-J                uration be sure also to bind an icon to that type using theK                [AddIcon] directive (see below). When this is not done a di- ?                rectory listing shows "[?]" in place of an icon.s  M                With the VMS file system there is no effective file character-eM                istic or algorithm for identifying a file's content without an L                exhaustive examination of the data contained there-in . . . aI                very expensive process (and probably still inconclusive ini@                many cases), hence the reliance on the file type.  I                If a file type is not recognised (i.e. no [AddType] corre-nI                sponding to the file type) then by default WASD identifiescI                its data as application/octet-stream (i.e. essentially bi-yL                nary data). Most browsers respond to this content-type with aM                download dialog, allowing the data to be saved as a file. MostmL                commonly these unknown types manifest themselves when authorsK                use "interesting" file names to indicate their purpose. Here <                are some examples the author has encountered:                     README.VMS                   README.1ST                   READ-ME.FIRSTl$                   BUILD.INSTRUCTIONS,                   MANUAL.PT1 (.PT2,  . . . )  E                If the site administrator would prefer another default J                content-type, perhaps "text/plain" so that any unidentifiedG                files default to plain text, then this may be configurednH                by specifying that content-type as the description of the@                catch-all file type entry. Examples (use one of):                     [AddType]S*                   *  internal/x-unknown  -D                   *  internal/x-unknown  -  application/octet-stream6                   *  internal/x-unknown  -  text/plainC                   *  internal/x-unknown  -  something/else-entirely   M                It is the author's opinion that unidentified file types should K                remain as binary downloads, not "text" documents, which theyrJ                are probably more often not, but it's there if it's wanted.          %             6-2  Server Configuration                  1                Explicitly Specifying Content-TypeT  H                When accessing files it is possible to explicitly specifyI                the identifying content-type to be returned to the browserpJ                in the HTTP response header. Of course this does not changeG                the actual content of the file, just the header content-mM                type! This is primarily provided to allow access to plain-textnL                documents that have obscure, non-"standard" or non-configured                file extensions.   F                It could also be used for other purposes, "forcing" theK                browser to accept a particular file as a particular content-uJ                type. This can be useful if the extension is not configuredJ                (as mentioned above) or in the case where the file containsM                data of a known content-type but with an extension conflictingdH                with an already configured extension specifying data of a&                different content-type.  M                Enter the file path into the browser's URL specification field J                ("Location:", "Address:"). Then, for plain-text, append the&                following query string:  0                   ?httpd=content&type=text/plain  H                For another content-type substitute it appropriately. ForF                example, to retrieve a text file in binary (why I can't                imagine :^) use  >                   ?httpd=content&type=application/octet-stream  "                This is an example:  /                <online hypertext demonstration>t  M                It is posssible to "force" the content-type for all files in aDM                particular directory. Enter the path to the directory and theng                add  .                   ?httpd=index&type=text/plain  L                (or what-ever type is desired). Links to files in the listingE                will contain the appropriate "?httpd=content&type=..."a*                appended as a query string.  "                This is an example:                6.2 Virtual Services  J                By default the server is defined by the local host name andK                port specified by either [port] or /PORT. The WASD server isxI                capable of concurrently supporting a number of services on1L                different port numbers and, if the system is configured to beK                multi-homed (see Section 5.4), more than one host name. ThissI                capability is generally known as a virtual server. VirtualD  N                                                      Server Configuration  6-3 c  t            L                services offer versatile and powerful multi-site capabilities7                using the one system and server process.s  K                The same mechanism also effectively allows a single instancesD                of the configuration files to support multiple serverF                processes (using the /SERVICE qualifier), either on theE                one system or across multiple systems, as in a cluster I                (i.e. supports "virtual" and "real" servers.) See STARTUP_kH                SERVER.COM for further information on startup support for$                these configurations.  J                Using the [Service] configuration parameter or the /SERVICED                qualifier the server creates an HTTP service for eachH                specified. If the host name is omitted it defaults to theI                local host name. If the port is omitted it defaults to 80.aG                The first port specified in the service list becomes thedH                "administration" port of the server, using the local hostJ                name, appearing in administration reports, menus, etc. ThisL                port is also that specified when sending control commands via6                the /DO= qualifier (see Section 5.3.2).  H                This rather contrived example show a server configured to9                provide four services over two host names.O                     [Service]i0                   alpha.wasd.dsto.defence.gov.au                   8080/                   beta.wasd.dsto.defence.gov.aud4                   beta.wasd.dsto.defence.gov.au:8000  G                WASD provides server process run-time parameters via theTJ                HTTPD$CONFIG configuration file. These provide settings forM                logging, scripting, timeouts, file content-type mappings, etc. H                The HTTPD$MSG file provides configurable system messages.  M                The essential profile of a site however is established by it'swM                mapped resources and any authorization controls, the HTTPD$MAP=M                and HTTPD$AUTH configuration files respectively, and these two L                files support directives that allow configuration rules to beL                applied to all virtual services (i.e. a default) or only to a(                single specified service.  H                To restrict rules to a specified server (virtual or real)J                add a line containing the server host name and port betweenJ                double-square brackets. All following rules will be appliedM                only to that service. To resume applying rules to all servicestH                use a single asterisk instead of a host name. In this wayE                default (all service) and server-specific rules may becL                interleaved to build a composite environment, server-specificI                yet with defaults. Note that service-specific and service- K                common rules may be mixed in any order allowing common rules   %             6-4  Server Configuration                  K                to be shared. This descriptive example shows a file with oneC                rule per line.   #                   # just an examplet3                   this rule applies to all services                    so does this                   and this one7                   [[alpha.wasd.dsto.defence.gov.au:80]] 8                   this one however applies only to ALPHA%                   as indeed does thise8                   [[beta.wasd.dsto.defence.gov.au:8000]]3                   now we switch to the BETA service 3                   another one only applying to BETAt                   and a third                    [[*]].4                   now we have a couple default rules1                   that again apply to all servers   I                Both the mapping and authorization modules report if ruleslH                are provided for services that are not configured for theL                particular server process (i.e. not in the server's [Service]I                or /SERVICE parameter list). This provides feedback to theaG                site administrator about any configuration problems thateF                exist, but may also appear if a set of rules are sharedF                between multiple processes on a system or cluster whereH                processes deliver differing services. In this latter caseI                the reports can be considered informational, but should begL                checked initially and then occasionally for misconfiguration.               6.3 Error Reportingn  E                By default the server provides it's own internal error D                reporting facility. In addition the [ErrorReportPath]F                configuration directive allows a redirection path to beM                specified for error reporting, allowing the site administratoraF                to tailor both the nature and format of the informationK                provided. A Server Side Include document, CGI script or even I                standard HTML file(s) may be specified. An SSI document is ?                recommended for it's simplicity yet versatility.e  K                Site-specific error reporting works by internal redirection..J                When an error is reported the original request is concludedH                and the request reconstructed using the error report pathM                before internally being reprocessed. Error information becomes:J                available via a specially-built query string, and from thatL                as CGI variables in the error report context. One implicationJ                is the original request path and query string are no longerI                available. All error information must be obtained from the 9                error information in the new query string.   N                                                      Server Configuration  6-5 o               $                Using an SSI Document  I                Three example SSI error report documents are provided. See H                HT_ROOT:[EXAMPLE]REPORTERROR*.SHTML The first providing aM                report identical with those internally generated, the second aOL                small variation on this, and the third considerably differentH                and with much less specific error information (which some:                administrator's may consider advantageous).  J                It is suggested with any use of this facility the reportingC                document(s) be located somewhere local, probably HT_ H                ROOT:[LOCAL], and then enabled by placing the appropriateJ                path into the [ErrorReportPath] configuration directive, as*                shown for the examples here  G                   [ErrorReportPath] /ht_root/example/reporterror1.shtml   I                Note that virtual services can subsequently have this path2J                mapped to other documents (or even scripts) so that some or:                all services may have custom error reports.  I                The following SSI variables are available specifically for K                generating error reports. The <!-#printenv -> statement nearAM                the top of the file may be uncommented to view all SSI and CGI #                variables available.d  I                o  ERROR_LINE -  The HTTPd source code line from where thet&                   error was generated.  L                o  ERROR_MODULE -  The HTTPd source code module corresponding.                   to the line described above.  K                o  ERROR_REPORT -  A single HTML string providing a detailed                     error message.  G                o  ERROR_REPORT2 -  A single HTML comment providing morec@                   detailed VMS error information (if available).  M                o  ERROR_REPORT3 -  A server-generated HTML string providing ae@                   brief explanation of the error (if available).  D                o  ERROR_STATUS_CODE -  The HTTP response status code4                   representing the error (e.g. 404).  M                o  ERROR_STATUS_CLASS -  Essentially the single hundreds digith0                   from the status code (e.g. 4).  J                o  ERROR_STATUS_TEXT -  The human-readable statement repre-=                   senting the status code (e.g. "not found").3  I                o  FORM_ERROR_ . . . - A series of CGI variables providing_K                   the sources for the above SSI variables, as well as other 2                   general environment information.  %             6-6  Server Configurationv r                               Using a Script   I                It is also possible to report using a script. This is dis- D                couraged dues to it's relative complexity, and shouldF                only be undertaken for verify specific reasons of limi-H                tation within the SSI implementation. The source code HT_K                ROOT:[SRC.MISC]REPORTERROR.C provides such an implementation                 example.f  #                Using HTML Documentsc  L                SSI documents are the obvious choice for reporting errors butJ                they do take time and CPU for processing, and this may be aK                significant consideration on busy sites. If prefered, static I                HTML documents may be used to report errors. Generally onebH                per possible response error status code is required. WhenM                providing a error report path including a "!UL" introduces the J                response status code into the file path, providing a reportG                path that includes a three digit number representing the.L                error. A file for each possible number must then be provided.  F                   [ErrorReportPath] /ht_root/local/reporterror!UL.html  J                This mapping will generate paths such as the following, andC                require at least these to respond to general errors.   4                   /ht_root/local/reporterror400.html4                   /ht_root/local/reporterror401.html4                   /ht_root/local/reporterror403.html4                   /ht_root/local/reporterror404.html4                   /ht_root/local/reporterror500.html4                   /ht_root/local/reporterror501.html4                   /ht_root/local/reporterror502.html4                   /ht_root/local/reporterror503.html               6.4 Access Logging  H                WASD provides a versatile access log, allowing data to beH                collected in Web-standard common and combined formats, asJ                well as allowing customization of the log record format. ItH                is also possible to specify a log period. If this is doneJ                log files are automatically changed according to the periodI                specified. Exclude requests from specified hosts using the 9                [LogExcludeHosts] configuration parameter.             N                                                      Server Configuration  6-7 e  t                         6.4.1 Log Format  E                The configuration parameter [LogFormat] and the serverdL                qualifier /FORMAT specifies one of three pre-defined formats,F                or a user-definable format. Most log analysis tools canF                process the three pre-defined formats. There is a smallH                performance impost when using the user-defined format, asJ                the log entry must be specially formatted for each request.  K                1. COMMON - This is the most common, base logging format fort@                   Web servers. COMMON is the default log format.  K                2. COMMON_SERVER - This is an optional format used, for one, H                   by the NCSA server. It is basically the common format,J                   with the server host name appended to the line (used for8                   multi-homed servers, see Section 6.2).  L                3. COMBINED - This is an optional format used, for one again,L                   by the NCSA server. It too is basically the common format,@                   with the HTTP referer and user agent appended.                  User-Defined   J                The user-defined format allows customised log formats to beI                specified using a selection of commonly required data. ThemJ                specification must begin with a character that is used as aK                substitute when a particular field is empty (use "\0" for no I                substitute, as in the "windows log format" example below).   H                Two different "escape" characters introduce the following                parameters:                   A "!" followed by  4                o  AR - authentication realm (if any)  7                o  AU - authenticated user name (if any)-  ?                o  BB - bytes in body (excludes response header)e  :                o  BY - bytes in response (includes header)  K                o  CN - client host name (or address if DNS lookup disabled)n  %                o  CA - client address   ;                o  EM - request elapsed time in milliseconds   A                o  ES - request elapsed time in fractional seconds   %                o  ME - request methodf  B                o  PA - request path (not to be confused with "RQ")  4                o  QS - request query string (if any)  '                o  RF - referer (if any)w  %             6-8  Server Configuration  f  r            :                o  RQ - complete request string (see below)  +                o  RS - response status codet  '                o  SN - server host name   +                o  SC - script name (if any)n  7                o  SM - request scheme (http: or https:)d  "                o  SP - server port  7                o  TC - request time (common log format)r  )                o  TG - request time (GMT)a  0                o  TV - request time (VMS format)  !                o  UA - user agent                    A "\" followed by  F                o  0 - a null character (used to define the empty field                   character)  #                o  ! - insert an "!"r  "                o  \ - insert a "\"  &                o  n - insert a newline  J                o  q - insert a quote (so that in DCL the quotes won't need                   escaping!)  "                o  t - insert a TAB  K                Any other character is directly inserted into the log entry.n  $                Note on "PA" and "RQ"  I                The "PA" and "RQ" have distinct roles. In general the "RQ"iJ                (request) directive will always be used as this is the fullI                request string; script component (if any), path string andsL                query string component (if any). The "PA" directive is merelyK                the path string after any script and query string componentsp!                have been removed.r                  Examples   =                1. The equivalent of the common log format is:c  5                      -!CN - !AU [!TC] \q!RQ\q !RS !BY   @                2. The combined log format could be specified as:  E                      -!CN - !AU [!TC] \q!RQ\q !RS !BY \q!RF\q \q!UA\q   N                                                      Server Configuration  6-9    d            L                3. The O'Reilly WebSite "windows log format" would be created                   by:e  S                      \0!TC\t!CA\t!SN\t!AR\t!AU\t!ME\t!PA\t!RQ\t!EM\t!UA\t!RS\t!BB\ta  I                4. The common log format with appended request duration inm2                   seconds could be provided using:  9                      -!CN - !AU [!TC] \q!RQ\q !RS !BY !ESe               6.4.2 Log Period  J                The access log file may have a period specified against it,J                producing an automatic generation of log file based on thatK                period. This allows logs to be systematically named, ordereddL                and kept to a managable size. The period specified can be one                ofa                  o  DAILYD  !                o  weekly as . . .                    MONDAY                   TUESDAY                    WEDNESDAYr                   THURSDAY                   FRIDAY                   SATURDAY                   SUNDAY                  o  MONTHLYe  J                The log file changes on the first request after midnight ofJ                the new period. When using a weekly period the new log fileK                comes into effect on the first request following midnight ona!                the specified day.s  I                When using a periodic log file, the file name specified byPH                HTTPD$LOG or the configuration parameter [LogFileName] isF                partially ignored, only partially because the directoryJ                component of it is used to located the generated file name.=                The periodic log file name generated comprisesi  "                o  server host name                  o  server portl                  o  year (YYYY)d                  o  month (MM)                  o  day (DD)  *                as in the following example  5                   HT_LOGS:WASD_80_19971013_ACCESS.LOGo  &             6-10  Server Configuration t  i            M                For the daily period the date represents the request date. ForoL                the weekly period it is the date of the previous (or current)M                day specified. That is, if the request occurs on the Wednesday L                for a weekly period specified by Monday the log date show theG                last Monday's. For the monthly period it uses the first.0  !             6.4.3 Log Per-Serviced  K                By default a single access log file is created for each HTTP F                server process. Using the [LogPerService] configurationJ                directive a log file for each service provided by the HTTPd.                is generated (see Section 6.2).               6.4.4 Log Naming  K                When per-period or per-service logging is enabled the access M                log file has a name generated. Part of this name is the host's L                name or IP address. By default the host name is used, howeverJ                if the host IP address is specified the dot-numeric addressK                is used, hyphens being substituted for the periods. Accepted F                values for the [LogNaming] configuration directive are:                   o  NAME (default)                  o  ADDRESSe  L                Examples of generated per-service (non-per-period) log names:  ,                   HT_LOGS:WASD_80_ACCESS.LOG7                   HT_LOGS:131-185-250-202_80_ACCESS.LOGl  J                Examples of generated per-period (with/without per-service)                log names:   5                   HT_LOGS:WASD_80_19971013_ACCESS.LOG @                   HT_LOGS:131-185-250-202_80_19971013_ACCESS.LOG  /                <online hypertext demonstration>                6.5 Directives  J                NOTE: The format of the configuration file has been changedK                between version 3 and version 4. This was to support on-lineoL                server configuration and administration (see Chapter 11). TheM                version 3 format will still be read by the HTTPd but the first K                time the configuration is updated on-line it is saved in the 1                version 4 format, described below.   M                The example configuration file for the WASD HTTP server can bed                viewed.  &                <online hypertext link>  N                                                     Server Configuration  6-11 w  .            K                Some directives take a single parameter, such as an integer, F                string or boolean value. Other directives can/must haveL                multiple parameters. The version 4 configuration requires theK                directive to be placed on a line by itself and each separateBM                parameter on a separate line following it. All parameter linesp@                apply to the most recently encountered directive.  E                Note that all boolean directives are disabled (OFF) by L                default. This is done so that there can be no confusion aboutH                what is enabled and disabled by default. To use directiveA                controlled facility it must be explicitly enabled.   :                1. [Accept] host/domain name (default: all)  L                   One or more (comma-separated if on the same line) internetL                   host/domain names, with "*" wildcarding for host/subdomainJ                   matching, to be explicitly allowed access. If DNS lookupF                   is not enabled hosts must be expressed using numericE                   addresses (see [DNSLookup] directive). Also see theIG                   [Reject] directive. Reject directives have precedenceaJ                   over Accept directives. The Accept directive may be used!                   multiple times.                      Examples:h                        [Accept]a/                      *.wasd.dsto.defence.gov.auu"                      131.185.250.*  5                2. [ActivityDays] integer (default: 0)S  M                   Specifies the number of days to record activity statistics, I                   available in report form from the server administrationnJ                   menu (see Section 11.2). Zero disables this data collec-H                   tion. The maximum is 28 days. 11520 bytes per day, andK                   80640 per week, is required to store the per-minute data.o  D                3. [AddIcon] icon-URL ALT-text template  (no default)  M                   Specifies a directory listing icon and alternative text foraB                   the mime content type specified in the template.                     Examples:a                        [AddIcon]8                      /icon/-/doc.gif    [HTM]  text/html9                      /icon/-/text.gif   [TXT]  text/plain 8                      /icon/-/image.gif  [IMG]  image/gif  )                4. [AddBlankIcon] icon-URLt0                   [AddDirIcon] icon-URL ALT-text3                   [AddParentIcon] icon-URL ALT-text[B                   [AddUnknownIcon] icon-URL ALT-text (no defaults)  &             6-12  Server Configuration ,  e            K                   Specifies a directory listing icon for these non-content- ,                   type parts of the listing.                     Examples:   8                      [AddBlankIcon]    /icon/-/blank.gifA                      [AddDirIcon]      /icon/-/dir.gif      [DIR]rA                      [AddParentIcon]   /icon/-/back.gif     [<--]lA                      [AddUnknownIcon]  /icon/-/unknown.gif  [???]e  M                5. [AddType] .suffix content-type script-name description  (noi                   default)  I                   Binds a file suffix (extension, type) to a mime contenteH                   type. The script name is used to auto-script against aI                   specified file type. Use a hyphen as a place-holder and H                   to indicate no auto-script. The description is used as7                   documentation for directory listings.a                        [AddType]N                      .html  text/html        -       HyperText Markup Language?                      .txt   text/plain       -       plain text @                      .gif   image/gif        -       image (GIF)B                      .hlb   text/x-script /Conan  VMS Help libraryQ                      .decw$book   text/x-script   /HyperReader    Bookreader bookeH                      *  internal/x-unknown   -  application/octet-stream:                      #*  internal/x-unknown  -  text/plain  J                   The content-type string may include a specific characterJ                   set. In this way non-default sets (which is usually ISO-I                   8859-1) can be specified for any particular site or anyTL                   particular file type. Enclose the content-type string with)                   double-quotation marks.                         [AddType]T                      .html    "text/html; charset=ISO-8859-1"   -  HTML (ISO-8859-1)]                      .html_5  "text/html; charset=ISO-8859-5"   -  Cyrillic HTML (ISO-8859-5) Y                      .html_r  "text/html; charset=KOI8-R"       -  Cyrillic HTML (KOI8-R)aZ                      .txt     "text/plain; charset=ISO-8859-1"  -  plain text (ISO-8859-1)]                      .txt_5   "text/plain; charset=ISO-8859-5"  -  Cyrillic text (ISO-8859-5)oY                      .txt_r   "text/plain; charset=KOI8-R"      -  Cyrillic text (KOI8-R)   J                   (Versions prior to 3.2 used this configuration directiveK                   for the MIME content-type to determine whether a file wasuM                   transfered record-by-record or in binary. This is no longerpL                   required and should be removed from existing configuration                   files.)   B                6. [AuthBasic] ENABLED|DISABLED (default: DISABLED)  H                   Enables or disables BASIC username authentication. See                   Chapter 9.  :                7. [AuthCacheMinutes] integer (default: 60)  N                                                     Server Configuration  6-13 U  r            E                   The number of minutes authentication information istI                   cached before being revalidated from the authenticationrK                   source. Zero disables caching (with a resultant impact onoI                   performance as each request requiring authentication isg6                   validated directly from the source).  C                8. [AuthDigest] ENABLED|DISABLED (default: DISABLED)i  I                   Enables or disables Digest username authentication. Seef                   Chapter 9.  :                9. [AuthDigestGetLife] integer (default: 0)  H                   The number of seconds a digest nonce for a GET request;                   (read) can be used before becoming stale.s  :               10. [AuthDigestPutLife] integer (default: 0)  @                   The number of seconds a digest nonce for a PUTI                   (/POST/DELETE ... write) request can be used before be-                    coming stale.p  :               11. [AuthFailureLimit] integer (default: 10)  G                   The number of unsuccessful attempts at authentication D                   before the username is disabled. Once disabled anyM                   subsequent attempt is automatically refused without furtherSM                   reference to the authentication source. A disabled usernamed?                   can be reenabled by simply purging the cache.w  C               12. [AuthRevalidateUserMinutes] integer (default: 60)   K                   The number of minutes between authenticated requests thatgM                   user authentication remains valid before the user is forcediH                   to reenter the authentication information (via browserJ                   dialog). Zero disables the requirement for revalidation.                 13. [AuthVMS]r  K                   (Retired in v4.4, server /SYSUAF qualifier provides this)   .               14. [Busy] integer (default: 10)  L                   The maximum number of concurrent client connections beforeK                   a "server too busy right now ... try again shortly" errort,                   is returned to the client.  >               15. [Cache] ENABLED|DISABLED (default: DISABLED)  9               16. [CacheChunkKBytes] integer (default: 0)e  I                   Granularity of memory blocks allocated to file data, in                    kilobytes.  8               17. [CacheEntriesMax] integer (default: 0)  &             6-14  Server Configuration                 F                   Maximum number of files loaded into the cache beforeH                   entries are reused removing the original contents from                   the cache.  ;               18. [CacheFileKBytesMax] integer (default: 0)r  I                   Maximum size of a file before it is not a candidate fora-                   being cached, in kilobytes.e  :               19. [CacheFrequentHits] integer (default: 0)  L                   Minimum, total number of hits an entry must sustain beforeJ                   being a candidate for [CacheFrequentSeconds] assessment.  =               20. [CacheFrequentSeconds] integer (default: 0)y  K                   If a file has been hit at least [CacheFrequentHits] timestH                   in total and the last was within the number of secondsJ                   here specified it will not be a candidate for reuse. See                   Chapter 14.   >               21. [CacheHashTableEntries] integer (default: 0)  )                   Size of the hash table.A  <               22. [CacheTotalKBytesMax] integer (default: 0)  F                   Maximum memory allocated to the cache, in kilobytes.  =               23. [CacheValidateSeconds] integer (default: 0)   L                   The interval after which a cache entry's original, contentI                   revision time is revalidated against the file's current J                   revision time. If not the same the contents are declared'                   invalid and reloaded.q  9               24. [CharsetDefault] string (default: none)   K                   The default character set sent in the response header for I                   text documents (plain and HTML). English language sites H                   should specify ISO-8859-1, other Latin alphabet sites,J                   ISO-8859-2, 3, etc. Cyrillic sites might wish to specify2                   ISO-8859-5 or KOI8-R, and so on.  F               25. [CommentedInfo] ENABLED|DISABLED (default: DISABLED)  G                   Includes, as META information, the software ID of thepD                   server and any relevant VMS file specification for*                   directory listings, etc.  ;               26. [DclCgiPlusLifeTime] integer (default: 0)q  I                   This value represents time in minutes. If this value is M                   zero CGIplus subprocess may persist indefinitely (excludingeI                   explicit and proactive server purging). If non-zero theaG                   CGIplus subprocess is terminated the specified numbereJ                   of minutes after it last processed a request. This helps  N                                                     Server Configuration  6-15                 F                   prevent sporadically used scripts from clogging up a                   system."  G               27. [DclFullRequest] ENABLED|DISABLED (default: DISABLED)Q  G                   Versions of the server prior to 4.3 supplied the fulluH                   request (header then body) to the script. This was notM                   fully CGI-compliant. Versions 4.3 and following supply onlyeM                   the body, although the previous behaviour may be explicitlypD                   selected by enabling this configuration parameter.  5               28. [DclHardLimit] integer (default: 0)s  I                   The maximum number of DCL/CGI script processing subpro- L                   cesses that may ever exist concurrently (works in conjunc-+                   tion with [DclSoftLimit].   ;               29. [DclScriptRunTime] string (default: none)   E                   One or more file type (extension) specification andb9                   scripting verb pairs. See Section 13.3.   5               30. [DclSoftLimit] integer (default: 0)t  F                   The number of DCL/CGI script processing subprocessesH                   after which idle subprocesses are deleted to make roomJ                   for new ones. The [DclHardLimit] should be approximatelyH                   25% more than the [DclSoftLimit]. The margin exists toI                   allow for occasional slow run-down of deleted/finishingaL                   subprocesses. If these limits are not set (i.e. zero) theyL                   are calculated with [Busy] using "[DclSoftLimit] = [Busy]"M                   and "[DclHardLimit] = [DclSoftLimit] + [DclSoftLimit] / 4".o  I               31. [DclSpawnAuthPriv] ENABLED|DISABLED (default: DISABLED)   K                   By default, when a DCL/scripting subprocess is spawned itYK                   inherits the server's currently enabled privileges, whichDK                   are none, not even TMPMBX or NETMBX. If this parameter iseM                   enabled the subprocess is created with the server account'seK                   SYSUAF-authorized privileges (which should never be othere<                   than NETMBX and TMPMBX). Use with caution.  :               32. [DclZombieLifeTime] integer (default: 0)  I                   This value represents time in minutes. If this value isLM                   zero the use of persistant DCL subprocesses is disabled. IfrL                   non-zero the zombie subprocess is terminated the specifiedK                   number of minutes after it last processed a request. This K                   helps prevent zombie processes from clogging up a system. !                   See Chapter 13.   <               33. [DECnetReuseLifeTime] integer (default: 0)  H                   The number of minutes a DECnet scripting connection isL                   maintained with the network task. Zero disables connection                   reuse.  &             6-16  Server Configuration o               =               34. [DECnetConnectListMax] integer (default: 0)   L                   The size of the list used to manage connections for DECnetI                   scripting. Zero effectively allows the server to use ase@                   many DECnet scripting connections as demanded.  B               35. [DirAccess] ON|OFF|SELECTIVE (default: DISABLED)  K                   Controls directory listings. SELECTIVE allows access only H                   to those directories containing a file .WWW_BROWSABLE.I                   The WASD HTTPd directory access facility always ignoresaK                   directories containing a file named .WWW_HIDDEN. Also see .                   the [DirWildcard] directive.  =               36. [DirDescription] ON|OFF (default: DISABLED)h  D                   Retired in v5.0, replaced by [DirDescriptionLines]  <               37. [DirDescriptionLines] integer (default: 0)  J                   Non-Zero enables HTML file descriptions during listings.I                   Generating HTML descriptions involves opening each HTMLgL                   file and searching for <TITLE>...</TITLE> and <H1>...</H1>H                   text to generate the description. This is an obviouslyL                   resource-intensive activity and on busy servers or systemsK                   may be disabled. Any non-zero number specifies the numberEM                   of lines to be searched before quitting. Set to a very highnH                   number to search all of files' contents (e.g. 999999).  =               38. [DirLayout] string (default: I__L__R__S__D)   L                   Allows specification of the directory listing layout. ThisH                   is a short, case-insensitive string that specifies theH                   included fields, relative placement and optionally theK                   width of the fields in a directory listing. Each field iseL                   controlled by a single letter and optional leading decimalJ                   number specifying its width. If a width is not specifiedJ                   an appropriate default applies. An underscore is used toL                   indicate a single space and is used to separate the fields/                   (two consecutive works well).>  &                   o  C - creation date  D                   o  D - description (generally best specified last)  J                     o  D:L - for files, make a link out of the description                        text   >                   o  I - icon (takes no field-width attribute)  M                   o  L - link (highlighted anchor using the name of the file)   ?                   o  N - name (no link, why bother? who knows!)   0                   o  O - owner (can be disabled)  &                   o  R - revision date  N                                                     Server Configuration  6-17 d  F                               o  S - sizee  7                     o  S:B - in bytes (comma-formatted)a  6                     o  S:D - decimal kilos (see below)  M                     o  S:F - kilo and mega are displayed to one decimal place   B                     o  S:K - in kilo-bytes (and fractions thereof)  B                     o  S:M - in mega-bytes (and fractions thereof)  I                   o  U - upper-case file and directory names (must be the %                      first character)a  4                   The following shows some examples:  4                      [DirLayout]       I__L__R__S__D6                      [DirLayout]       I__L__R__S:b__D3                      [DirLayout]       I__15L__S__D 4                      [DirLayout]       UI__15L__S__D1                      [DirLayout]       15L__9R__S 2                      [DirLayout]       15N_9C_9R_S6                      [DirLayout]       I__L__R__S:d__D7                      [DirLayout]       25D:l__S:b__C__R1  H                   The size of files is displayed by default as 1024 byteM                   kilos. When using the "S:k", "S:m" and "S:f" size modifiers M                   the size is displayed as 1000 byte kilos. If it is prefered M                   to have the default display in 1000 byte kilos then set the 1                   directory listing layout using:a  6                      [DirLayout]       I__L__R__S:d__D  K                   If unsure of the kilo value being used check the "<META>"p7                   information in the directory listing.t  D               39. [DirNoImpliedWildcard] ON|OFF  (default: DISABLED)  E                   When a directory is accessed having no file or type D                   component and there is no welcome page available aF                   directory listing is generated. By default any otherF                   directory accessed from this listing has the impliedG                   wildcards "*.*" added, consequently forcing directoryoK                   listings. If enabled, this directive ensures no wildcards L                   are added, so subsequent directories accessed with welcome@                   pages display the pages, not a forced listing.  ?               40. [DirNoPrivIgnore] ON|OFF  (default: DISABLED)   I                   To prevent browsing through directories (perhaps due to J                   inadvertant mapping) that have file permissions allowingJ                   no WORLD access the server stops listing and reports theJ                   error the first time a protection violation occurs. ThisK                   behaviour may be changed to ignore the violation, listingr:                   only those files to which it has access.  &             6-18  Server Configuration n  y            8               41. [DirOwner] ON|OFF  (default: DISABLED)  H                   Allows specification and display of the RMS file owner                   information.  G               42. [DirPreExpired] ENABLED|DISABLED  (default: DISABLED)   K                   Directory listings and trees may be pre-expired. That is,TK                   the listing is reloaded each time the page is referenced.aI                   This is convenient in some environments where directory I                   contents change frequently, but adds considerable over- J                   head and so is disabled by default. Individual directoryK                   listings may have the default behaviour over-ridden using ;                   syntax similar to the following examples:   ;                      /dir1/dir2/*.*?httpd=index?expired=yes :                      /dir1/dir2/*.*?httpd=index?expired=no8                      /tree/dir2/?httpd=index?expired=yes<                      /tree/dir1/dir2/?httpd=index?expired=no  B               43. [DirReadme] TOP|BOTTOM | OFF (default: DISABLED)  H                   If any of the files provided using the [DirReadMeFile]I                   directive are located in the directory the contents are.I                   included at the top or bottom of the listing (or not at G                   all). Plain-text are included as plain-text, HTML are-G                   included as HTML allowing markup tags to be employed.   :               44. [DirReadMeFile] FILE.SUFFIX (no default)  G                   Specifies the names and order in which a directory is L                   checked for read-me files. This can be enabled or disabledM                   using the [DirReadme] directive. Plain-text are included astL                   plain-text, HTML are included as HTML allowing markup tags!                   to be employed.h                     Examples:e  $                      [DirReadMeFile]                       readme.html                      readme.htm                       readme.                      readme.txtu                      readme.1st   :               45. [DirWildcard] OFF|ON (default: DISABLED)  J                   This enables the facility to force the server to provideK                   a directory listing by providing a wildcard file specifi-iK                   cation, even if there is a home (welcome) document in theeM                   directory. This should not be confused with the [DirAccess]iD                   directive which controls directory listing itself.  B               46. [DNSLookup] ENABLED|DISABLED (default: DISABLED)  N                                                     Server Configuration  6-19 e               J                   Enables or disables connection request host name resolu-H                   tion. This functionality may be expensive (in terms ofK                   processing overhead) and make serving granularity coarsereL                   if DNS is involved. If not enabled and logging is, the en-L                   try is logged against the numeric internet address. If notI                   enabled any [Accept], [Reject] directive, etc., must bes1                   expressed as numeric addresses.d  L                   This functionality significantly slows request processing.!                   See Chapter 15.   K                   NOTE: From version 4.4 the HTTPd processes initial client I                   connection at AST delivery level. Some NETLIB-supported M                   TCP/IP packages cannot perform host name resolution at thiseI                   level and will "hang". If using NETLIB with [DNSlookup]aD                   enabled and this seems to occur disable it (NETLIBE                   DNSlookup certainly does work with Digital TCP/IP).   :               47. [ErrorReportPath] string (default: none)  E                   Specifies the URL-format path to an optional, error D                   reporting SSI document or script. See Section 6.3.G                   This path can subsequently be remapped during requestr                   processing.t  G               48. [ErrorRecommend] ENABLED|DISABLED (default: DISABLED)Z  M                   Provides a short message recommending action when reporting L                   an error to a client. For example, if a document cannot be#                   found it may say:e  ?                      (document, or bookmark, requires revision)i  H               49. [ErrorSourceInfo] ENABLED|DISABLED (default: DISABLED)  H                   When an error message is generated META information isM                   included showing the server version with source code module6J                   and line reporting the error. This is useful informationG                   during development and often during general use. Only./                   disable if this concerns you.d                 50. [ErrorInfo]e  H                   (Retired in v4.4, message configuration provides this)  !               51. [ErrorSysAdmin]   H                   (Retired in v4.4, message configuration provides this)  5               52. [InputTimeout] integer (default: 2)B  G                   Number of minutes to allow a connection request to bebJ                   in progress without submitting a complete request header(                   before terminating it.  @               53. [Logging] ENABLED|DISABLED (default: DISABLED)  &             6-20  Server Configuration                 L                   Enables or disables the request log. Logging can slow downI                   request processing and adds overhead. The log file nameeI                   must be specified using the /LOG qualifier or HTTPD$LOGt2                   logical name (see Logical Names.  :               54. [LogExcludeHosts] string (default: none)  L                   One or more (comma-separated if on the same line) internetL                   host/domain names, with "*" wildcarding for host/subdomainI                   matching, requests from which are not placed in any logaM                   files. If DNS lookup is not enabled hosts must be expressedaJ                   using numeric addresses (see [DNSLookup] directive). UseI                   for excluding local or web-maintainer's host from logs.s                     Example:  &                      [LogExcludeHosts]/                      *.wasd.dsto.defence.gov.au "                      131.185.250.*  6               55. [LogFormat] string (default: COMMON)  H                   Specifies one of three pre-defined formats, or a user-6                   definable format. See Section 6.4.1.  4               56. [LogNaming] string (default: none)  L                   When [LogPeriod] or [LogPerService] directives are used toK                   generate multiple log files this directive may be used toOC                   modify the naming of the file. See Section 6.4.4.D  4               57. [LogPeriod] string (default: none)  J                   Specifies a period at which the log file is changed. See                    Section 6.4.2.  F               58. [LogPerService] ENABLED|DISABLED (default: DISABLED)  H                   When multiple services are specified (see Section 6.2)I                   a separate log file will be created for each if this iss-                   enabled. See Section 6.4.3.   @               59. [Monitor] ENABLED|DISABLED (default: DISABLED)  F                   Allows monitoring via the HTTPDMON utility (see Sec-E                   tion 17.5. Adds slight request processing overhead.l  7               60. [OutputTimeout] integer (default: 10)e  J                   Number of minutes to allow a request to be output before!                   terminating it.p  .               61. [Port] integer (default: 80)  J                   IP port number for server to bind to. For anything otherH                   than a command-line server control (see Section 5.3.2)K                   this parameter is overridden by anything supplied via thel&                   [Service] directive.  N                                                     Server Configuration  6-21 e  i            7               62. [PutMaxKBytes] integer (default: 250)a  G                   Maximum size of an HTTP POST or PUT method request in                    Kilobytes.  8               63. [PutVersionLimit] integer (default: 3)  E                   File created using the POST or PUT methods have the 2                   specified version limit applied.  ;               64. [Reject] host/domain name (default: none)   L                   One or more (comma-separated if on the same line) internetL                   host/domain names, with "*" wildcarding for host/subdomainI                   matching, to be explicitly denied access. If DNS lookupoF                   is not enabled hosts must be expressed using numericE                   addresses (see [DNSLookup] directive). Also see theaG                   [Accept] directive. Reject directives have precedencegH                   of Accept directives. The Reject directive may be used!                   multiple times.u                     Example:                        [Reject] /                      *.wasd.dsto.defence.gov.aul"                      131.185.250.*  7               65. [RequestHistory] integer (default: 0)   H                   The server can keep a list of the most recent requestsL                   accessable from the server administration menu. This valueI                   determines the number kept. Zero disables the facility.gK                   Each retained request consumes 256 bytes and adds a smallr6                   amount of extra processing overhead.  ,               66. [Search] path (no default)  K                   Specifies the URL-format path to the default query-string F                   keyword search script. This path can subsequently be5                   remapped during request processing.                      Examples:   1                      Search /ht_root/script/querye  /               67. [Service] string (no default)r  K                   This parameter allows SSL, multi-homed hosts and multiple D                   port serving to be specified, see Section 10.1 and                   Section 6.2.  <               68. [SSI] ENABLED|DISABLED (default: DISABLED)  E                   Enables or disables Server Side Includes (HTML pre-e                   processing).  D               69. [SSIaccesses] ENABLED|DISABLED (default: DISABLED)  &             6-22  Server Configuration d  b            E                   Enables or disables Server Side Includes (HTML pre- 2                   processing) file access counter.  @               70. [SSIexec] ENABLED|DISABLED (default: DISABLED)  E                   Enables or disables Server Side Includes (HTML pre-Z:                   processing) DCL execution functionality.  <               71. [StreamLF] integer (default: 0 (disabled))  M                   Enables or disables automatic conversion of VARIABLE recordtL                   format documents (files) to STREAM-LF, which are much moreH                   efficient with this server. The integer is the maximumJ                   size of a file in kilobytes that the server will attemptL                   to convert. Zero disables any conversions. See File Record                   Format.   5               72. [StreamLFpaths] string (no default)L  K                   (Retired in v5.3, mapping SET rule provides this now, see !                   Section 8.2.4).n  4               73. [Welcome] file.suffix (no default)  G                   Specifies the names and order in which a directory isgI                   checked for home page files. If no home page is found as1                   directory listing is generated.                      Examples:e                        [Welcome]                      home.html                      home.htm                       home.menu                      home.mnuz                              N                                                     Server Configuration  6-23                     M             Chapter__7_______________________________________________________a  !             Message Configuration     B                Message configuration is provided for two purposes.  J                1. Some sites would prefer to customize or extend the basicH                   information provided to clients when an error or other                   event occurs.t  L                2. Sites that do not use English as a first language may wishH                   to provide some or all of the defined messages using a$                   prefered language.  M                Not all messages provided by the WASD server are customizable,eJ                only those generated for non-administrative content. As theI                WASD server can also report using information derived from I                the standard VMS message service (via sys$getmsg())  it iseK                assumed a language-local implementation of this is in use as I                well. Unfortunately for the non-first-language-English Web-I                and system administrators, the menus and messages used forgH                administration purposes, etc., are still only in English.K                The intent of this facility is to provide non-administration F                clients only with a more familiar language environment.  K                Also note that the message database only applies to messages H                generated by the server, not to any generated by scripts,                etc.a               7.1 BehaviourD  E                When an error, or other message or string, needs to beaH                provided for the client the message database is accesssed-                using the following algorithm.   H                1. If the client request has specified a list of preferedJ                   languages using the "Accept-Language:" HTTP header fieldK                   the message database is checked for support of that/those J                   languages. If one is found then that language is used to%                   access the message.   E                2. If none is found, or the client has not specified aiG                   prefered language, the client host address is checked_H                   against any list of hosts/domains provided against theG                   language (see below). If a match occurs the specified]#                   language is used.   N                                                     Message Configuration  7-1 o  W            K                3. If neither of the above results in a message language theaM                   base language is used (the highest numbered language). ThislM                   must have a complete set of messages or the server will not                    start!    #             7.2 Message File Format:  J                By default, the system-table logical name HTTPD$MSG locatesJ                a common message file, unless an individual message file isJ                specified using a job-table logical name. Simple editing ofM                the message file changes the messages (after a server restart,oJ                of course). Comment lines may be included by prefixing themM                with the hash character ("#"), and lines continued by ensuringsG                the last character is a backslash ("\"). The server willdI                concurrently support an additional 3 languages to the basedK                English (although this can be increased by recompilation :^)q  I                Care must be taken with the message file or the server maya                refuse to start  G                As illustrated below the message file comprises a series J                of sections. Directives enclosed by square-brackets provide1                information to the message loader.i  %                   # this is a commenta                     [version] 4.4r&                   [language] 1 se *.se+                   [language] 2 de *.de,*.sus!                   [language] 3 ene                     [general]n  -                   en 01 Sanity check failure. Q                   de 01 (the same message but in German, which I cannot speak :^) W                   se 01 (the same message but in Swedish, which I also cannot speak :^)i(                   en 02 String overflow.Q                   de 02 (the same message but in German, which I cannot speak :^)L;                   se 01 (the same message but in Swedish, \n2                   which I still cannot speak :^) \I                   this has also been continued over two additional lines! /                   en 03 Heap allocation failed.t'                   en 04 calloc() failedt0                   en 05 Request calloc() failed.(                   en 06 Server too busy.-                   en 07 Server access denied. -                   en 08 Facility is disabled. /                   en 09 Wildcard not permitted.l1                   en 10 Directory layout problem.   &                   [next-section, etc.]  &             7-2  Message Configuration n  ?            G                The square-bracketed section headings have the following                 functions.=  F                1. [version] -  Ensures the correct database version isL                   available for the server version attempting to use it. TheL                   message file always needs checking for this version numberG                   being changed at server updates, although the version(F                   may remain fixed at a previous server version numberG                   if there have been no changes to the message databasebK                   during subsequent server versions. This must be the first (                   directive in the file.  H                2. [language] -  Creates space for assigning the new lan-L                   guage's messages. The number specifies an order within theL                   languages, each must be different, but only the lowest andK                   highest (prefered and base respectively) have operational K                   significance. The highest number should always be English I                   to provide a fall-back message. A short string provides H                   an identifier for the language. This identifier shouldJ                   be the same as the identifying string in the browser re-I                   quest "Accept-Language:" header field (e.g. "en", "se", K                   "de", "fr", etc.) Following the language identifier is an J                   optional host/domain list. Multiple hosts/domains may beK                   specified by separating each with a comma. The specifica- L                   tions may contain wildcards. All the [language] directivesH                   should be grouped at the start of the file immediatelyK                   following the [version] directive. Setting the language's K                   ordering number to zero disables the language completely.sG                   All messages associated with it will then be ignored.m  I                3. [group-name] -  The messages are divided into groupingsrK                   to make them easier to manage. Each group begins with thee'                   group name directive.i  L                4. en 01 message -  Each message in a group is assigned usingI                   using this format. The string identifying the language,cI                   then the message number (the leading zero just improvesqK                   the format, strictly it is not required), then the actualEI                   message itself. The message can be of arbitrary length.oM                   Long messages may be continued on following lines using theP-                   "\" continuation character.t  K                The base language (the highest numbered, which should alwayspK                be English) must have precisely the right number of messages I                required by the server, too few or too many and the server K                will not start! Additional languages do not have to reassigncM                every message! The base language will supply any not assigned.SK                A message number of zero is disabled and completely ignored.q  K                If messages contain HTML tags that markup must not interfere <                with the general HTML page it is used within.  N                                                     Message Configuration  7-3                 H                Some messages are a composite of multiple strings each ofJ                which is used on a different part of the one page (e.g. forL                the [upd] edit-page). Each of the strings is delimited by theJ                vertical bar "|". Care must be taken when customizing theseJ                strings that the overall number stays the same and that theI                length of each does not become excessive. Although it willsK                not disrupt the server it may significantly disrupt the pagea                layout.  H                All message numbers must be included. To provide an emptyL                string for any one message (not recommended) provide the line9                with nothing following the message number.r  &             7.3 Supplied Message Files  L                Any non-English message files that are provided to the authorH                will be included for general use (please take the time toJ                support this endeavour) in the HT_ROOT:[EXAMPLE] directory.  &                <online hypertext link>  G                Note that message files can become out-of-date as server F                versions change, requiring modifications to the messageM                database. Check the version information and/or comments at thesJ                top of candidate message files, however even slightly datedM                files may serve as a good starting point for a locale-specific                 message base.                                              &             7-4  Message Configuration p  t                M             Chapter__8_______________________________________________________                Mapping Rules     ;                Mapping rules are used in five primary ways.   A                1. To map a request path onto the VMS file system.s  K                2. To process a request path according to specified criteriaeJ                   resulting in an effective path that is different to that,                   supplied with the request.  I                3. To identify requests requiring script activation and to M                   parse the script from the path portion of that request. Thea?                   path portion is then independently re-mapped.n  L                4. To conditionally map to different end-results based on one2                   or more criteria of the request.  L                5. To provide differing virtual sites depending on the actual1                   service accessed by the client.h  F                Mapping is basically for server-internal purposes only.J                The only time the path information of the request itself isK                modified is when a script component is removed. At all other.<                times the path information remains unchanged.  F                Hence, path authorization is always applied to the pathH                supplied with the request, not to the results of any ruleL                mapping that may have occured! This means authorization pathsJ                may be administered without any ambiguity introduced by any+                rule mapping that may occur.m  J                By default, the system-table logical name HTTPD$MAP locatesL                a common mapping rule file, unless an individual rule file isH                specified using a job- table logical name. Simple editingG                of the mapping file changes the rules. Comment lines may I                be included by prefixing them with the hash "#" character.rM                Although, there is no fixed limit on the number of rules thereeJ                are the processing implications of scanning a large, linear                database.  J                Rules are given a basic consistency check when loaded (i.e.G                server startup, map reload, etc.) If there is an obvious G                problem (unknown rule, missing component, etc., path not G                absolute) a warning message is generated and the rule is K                not loaded into the database. This will not cause the server J                startup to fail. These warning messages may be found in the"                server process log.  N                                                             Mapping Rules  8-1                 L                The server administration facility allows realm and arbitraryI                paths to be checked against the rule database in real-timecM                using the WATCH facility. See Chapter 12. In this way the ruleeJ                database may be checked against test or even live requests.  I                Any changes to the mapping file may be (re)loaded into theeM                running HTTPd server using the following command on the serverh                system:  !                   $ HTTPD /DO=MAPm  ;                Also see Chapter 6 for daemon configuration.e  #                Server Mapping Rulesd  M                A server's currently loaded mapping rules may be interrogated.i6                See Chapter 11 for further information.  .             8.1 VMS File System Specifications  H                The VMS file system in mapping rules is always assumed toJ                begin with a device or concealed device logical. SpecifyingG                a Master File Directory (MFD) component, the [000000] ismH                completely optional, although always implied. The mappingG                functions will always insert one if required for correct-J                file system syntax. That is, if the VMS file system mappingJ                of a path results in a file in a top-level directory an MFDH                is inserted if not explicitly present in the mapping. For3                example, both of the following pathsr  %                   /dka100/example.txt ,                   /dka100/000000/example.txt  +                would result in a mapping toi  ,                   DKA100:[000000]EXAMPLE.TXT  H                The MFD is completely optional when both specifying pathsF                in mapping rules and when supplying paths in a request.G                Similarly, when supplying a path that includes directoryc                 components, as in  /                   /dka100/dir1/dir2/example.txtn6                   /dka100/000000/dir1/dir2/example.txt                  both mapping to  /                   DKA100:[DIR1.DIR2]EXAMPLE.TXTe  L                Implication: When using logical names in file system mappingsK                they must be able to be used as concealed devices and cannot L                be logical equivalents of directory specifications. ConcealedF                device logicals are created using the following syntax:               8-2  Mapping Rules c  t            ;                   $ DEFINE LOGICAL_NAME device:[dir1.dir2.] [                   $ DEFINE LOGICAL_NAME /TRANSLATION=CONCEALED physical_device:[dir1.dir2.]   M                When during rule mapping of a path to a VMS file specificationoK                an RMS-invalid character (e.g. "+") or syntax (e.g. multipleoK                periods) is encountered a dollar symbol is substituted in an I                attempt to make it acceptable. This functionality is often H                useful for document collections imported to the local webM                originating from, for instance, a Unix site that utilizes non-yI                RMS file system syntax. The default substitution characternE                may be changed on a per-path basis using the SET rule,                 Section 8.2.4.                8.2 Rules   +                There are six mapping rules.h  G                o  Rules that map paths to the file system, and to other                    paths:                     o  MAP                     o  PASSv                     o  FAIL                      o  REDIRECTp  9                o  Rules that provide access to scripting:a                     o  EXECg                     o  SCRIPTs  L                o  A rule that sets characteristics against particular paths:                     o  SET  '             8.2.1 MAP, PASS, FAIL Rulesm  %                1. map template resultr  F                   If the URL path matches the template, substitute theJ                   result string for the path and use that for further ruleM                   processing. Both template and result paths must be absoluteg(                   (i.e. begin with "/").                  2. pass templatez&                   pass template result2                   pass template "999 message text"  F                   If the URL path matches the template, substitute theL                   result if present (if not just use the original URL path),.                   processing no further rules.  N                                                             Mapping Rules  8-3 n  s            J                   The result should be a either a physical VMS file systemL                   specification in URL format or an HTTP status-code messageJ                   (see below). If there is a direct correspondance betweenD                   the template and result the result may be omitted.  I                   The PASS directive is also used to reverse-map VMS file C                   specifications to the URL path format equivalent.,  J                   An HTTP status-code message can be provided as a result.L                   The server then generates a response corresponding to thatJ                   status code containing the supplied message. Status-codeG                   results should be enclosed in one of single or double M                   quotes, or curly braces. See examples. A 3nn status resultsTL                   in a redirection response with the message text comprisingM                   the location. Codes 4nn and 5nn result in an error message. M                   Other code ranges (e.g. 0, 1nn, 2nn, etc.) simply cause the K                   connection to be immediately dropped, and can be used foru;                   that purpose (i.e. no indication of why!)g                  3. fail templatev  H                   If the URL path matches the template, prohibit access,H                   processing no further rules. The template path must be1                   absolute (i.e. begin with "/").t               8.2.2 REDIRECT Rule   *                1. redirect template result  M                   If the URL path matches the template, substitute the resultmK                   string for the path. Process no further rules. The resultsG                   must be a full URL (http://host/path), and is used toeI                   redirect requests to another server on a separate host.a  7             8.2.3 EXEC and SCRIPT, Script Mapping Rules   #                Also see Chapter 13.   I                The EXEC and SCRIPT directives have the variants EXEC+ and K                SCRIPT+. These behave in exactly the same fashion and simply J                mark the rule as representing a CGIplus script environment.                 See Section 13.7.  6                The EXEC rules maps script directories.  K                The SCRIPT rules maps script file names. It behaves a littleuG                differently to the EXEC rule, essentially supplying in agA                single rule the effect of a MAP then an EXEC rule.   L                Both rules must have a template and result, and both must endM                in a wildcard asterisk. The placement of the wildcards and themK                subsequent functionality is slightly different however. BothrJ                template and result paths must be absolute (i.e. begin with                "/").               8-4  Mapping Rules i               &                1. exec template result  I                   The EXEC rule requires the template's asterisk to imme- J                   diately follow the slash terminating the directory spec-K                   ification containing the scripts. The script name followspI                   immediately as part of the wildcard-matched string. For                    example:  4                      exec /htbin/* /ht_root/script/*  K                   If the URL path matches the template, the result, includ- M                   ing the first slash-terminated part of the wildcard-matched J                   section, becomes the URL format physical VMS file speci-I                   fication the script to be executed. What remains of the K                   original URL path is used to create the path information.f+                   Process no further rules.s  H                   Hence, the EXEC rule will match multiple script speci-H                   fications without further rules, the script name beingK                   supplied with the URL path. Hence any script (i.e. proce--M                   dure, executable) in the specified directory is accessable, J                   a possible security concern if script management is dis-                   tributed.   (                2. script template result  E                   The SCRIPT rule requires the template's asterisk tonF                   immediately follow the unique string identifying theL                   script in the URL path. The wildcard-matched string is theJ                   following path, and supplied to the script. For example:  :                      script /conan* /ht_root/script/conan*  J                   If the URL path matches the template, the result becomesL                   the URL format physical VMS file specification for the DCLJ                   procedure of the script to be executed (the default fileK                   extension of ".COM" is not required). What remains of theeK                   original URL path is used to create the path information.d+                   Process no further rules.e  4                                                 Note  E                         The wildcard asterisk is best located immedi- D                         ately after the unique script identifier. InC                         this way there does not need to be any path F                         supplied with the script. If even a slash fol-C                         lows the script identifier it may be mapped H                         into a file specification that may or may not be1                         meaningful to the script.M  N                                                             Mapping Rules  8-5 o  .            M                   Hence, the SCRIPT rule will match only the script specifiedvL                   in the result, making for finely-granular scripting at theK                   expense of a rule for each script thus specified. It also J                   implies that only the script name need precede any other#                   path information.c  I                   It may be thought of as a more efficient implementation I                   of the equivalent functionlity using two CERN rules, as 7                   illustrated in the following example:   /                      map /conan* /script/conan*e/                      exec /cgi-bin/* /cgi-bin/*g               8.2.4 SET Rule  J                The SET rule does not change the mapping of a path, it justM                sets one or more characteristics against that path that affectiM                the subsequent processing in some way. It is a general purposehJ                rule that conveniently allows the administrator to tell theJ                server to process requests with particular paths in some adH                hoc and generally useful fashion. Most SET parameters areK                single keywords that act as boolean switches on the request,t.                some require parameter strings.  F                1. CACHE, NOCACHE - The default is to cache files (whenI                   caching is enabled). NOCACHE sets files in this path asmM                   not to be stored in the file cache. A subsequent CACHE willaL                   again permit caching, allowing smaller path hierarchies to<                   be cached within larger ones that are not.  H                2. CHARSET - This setting allows overriding of the serverM                   default ([CharsetDefault] configuration parameter) content- L                   type character set (in the response header) for text filesL                   (plain and HTML). A string is required as in the following0                   example, "charset=ISO-8859-5".  M                3. CONTENT - The content-type of a file is normally determinednK                   by the file's type (extension). This setting allows filessI                   matching the template to be returned with the specifiedAG                   content-type. The content-type must be specified as at?                   parameter, e.g. "content=application/binary".l  G                4. EXPIRED, NOEXPIRED - This setting allows files in thenL                   specified paths to be sent pre-expired. The browser should<                   always then reload them whenever accessed.  D                5. LOG, NOLOG - When server access logging is enabledG                   the default is to log all requests. The NOLOG settingsI                   suppresses logging for requests involving the specifiedT                    path template.               8-6  Mapping Rules                 G                6. RMSCHAR - During rule mapping of a path to a VMS filevJ                   specification, if an RMS-invalid character (e.g. "+") orH                   syntax (e.g. multiple periods) is encountered a dollarL                   symbol is substituted in an attempt to make it acceptable.L                   This setting provides an alternate substitution character.H                   Any general RMS-valid character may be specified (e.g.K                   alpha-numeric, '$', '-' or '_', although the latter three_L                   are probably the only REAL choices). A single character isD                   required as in the following example, "RMSchar=_".  D                7. STMLF, NOSTMLF - Specify files to be automaticallyI                   converted to Stream-LF format. The default is to ignoreiJ                   conversion. STMLF allows selected paths to be converted.)                   See File Record Format.u  J                Of course, as with all mapping rules, paths containing fileI                types (extensions) may be specified so it is quite easy toeI                apply SETtings to paricular groups of files. The following A                example gives a small selection of potential uses.a  .                   # examples of SET rule usage.                   # --------------------------6                   # disable caching for selected paths,                   set /ht_root/src/* NOcache+                   set /sys$common/* NOcacheiK                   # enable stream-LF conversion in selected directory treest"                   set /web/* stmlf&                   set /ht_root/* stmlfT                   # respond with Cyrillic character set(s) from relevant directories4                   set /*/8859-5/* charset=ISO-8859-50                   set /*/koi8-r/* charset=KOI8-Rc                   # the Sun Java tutorial when UNZIPped contains underscores for invalid charactersa4                   set /vms/java/tutorial/* RMSchar=_b                   # if a request has "/plain-text/" in it's path then ALWAYS return as plain-text!8                   set /*/plain-text/* content=text/plain*                   map /*/plain-text/* /*/*'                   # same for "/binary/" 4                   set /*/binary/* content=text/plain&                   map /*/binary/* /*/*  #             8.3 Rule Interpretationn  K                The rules are scanned from first towards last, until a PASS,aM                EXEC, SCRIPT, FAIL or REDIRECT is encountered, when processingeL                ceases and final substitution occurs. Mapped rules substituteJ                the template with the result and continue to the next rule.        N                                                             Mapping Rules  8-7 r  s            7                Use of wildcards in template and result:,  E                o  The template may contain one or more asterisk ("*") J                   wildcard symbols. These match zero or more characters upH                   until the character following the wildcard (or end-of-M                   string). If no wildcard is present then the path must match '                   the template exactly.a  L                o  The result may contain one or more asterisk ("*") wildcardF                   symbols. It must not contain more wildcards than theL                   template. The result wildcards are expanded to replace theK                   matching characters of the respective template wildcards.kI                   Characters represented by wildcards in the template not G                   represented by a corresponding wildcard in the resultrJ                   are ignored. Non-wildcard result characters are directlyI                   inserted in reconstructed path. Non-wildcard charactersaH                   in the template are ignored. If the result contains no@                   wildcards it completely replaces the URL path.                  Virtual Servers  H                As described in Section 6.2 virtual service syntax may beH                used with mapping rules to selectively apply rules to oneH                specific service. If virtual services are configured ruleH                interpretation sees only rules common to all services andJ                those specific to it's own service (host address and port).L                In all other aspects rule interpretation applies as described                above.m                8.4 Mapping Examples  L                The example mapping rule file for the WASD HTTP server can be                viewed.  &                <online hypertext link>  "                Example of Map Rule  L                The result string of these rules may or may not correspond toK                to a VMS physical file system path. Either way the resultingmC                rule is further processed before passing or failing.   I                1. The following example shows a path "/web/unix/shells/c" K                   being mapped to "/web/software/unix/scripts/c", with thism6                   being used to process further rules.  9                      map /web/unix/* /web/software/unix/*/                   8-8  Mapping Rules    a            $                Examples of Pass Rule  M                The result string of these rules should correspond to to a VMS "                physical file path.  M                1. This example shows a path "/web/rts/home.html" being mappednH                   to "/user$rts/web/home.html", and this returned as the                   mapped path.  4                      pass /web/rts/* /user$rts/web/*  T                2. This maps a path "/icon/bhts/dir.gif" to "/web/icon/bhts/dir.gif",7                   and this returned as the mapped path.   7                      pass /icon/bhts/* /web/icon/bhts/*e  I                3. This example illustrates HTTP status code mapping. EachVK                   of these does basically the same thing, just using one of K                   the three possible delimiters according to the characterslE                   required in the message. The server generates a 403hM                   response with has as it's text the following message. (Alsor8                   see the conditional mapping examples.)  =                      pass /private/* "403 Can't go in there!"lE                      pass /private/* '403 "/private/" is off-limits!'yD                      pass /private/* {403 Can't go into "/private/"}  $                Examples of Fail Rule  L                1. If a URL path "/web/private/home.html" is being mapped the3                   path would immediately be failed.   (                      fail /web/private/*  H                2. To ensure all access fails, other than that explicitlyF                   passed, this entry should be included the the rules.                        fail /*  0                Examples of Exec and Script Rules  H                1. If a URL path "/htbin/ismap/web/example.conf" is beingM                   mapped the "/ht_root/script/" must be the URL format equiv- K                   alent of the physical VMS specification for the directorypL                   locating the script DCL procedure. The "/web/example.conf"J                   that followed the "/htbin/ismap" in the original URL be-J                   comes the translated path for the script. See Chapter 135                   for other information on scripting.t  /                      exec /cgi-bin/* /cgi-bin/*a  N                                                             Mapping Rules  8-9                 L                2. If a URL path "/conan/web/example.hlb" is being mapped theK                   "/ht_root/script/conan" must be the URL format equivalent J                   of the physical VMS specification for the DCL procedure.K                   The "/web/example.hlb" that followed the "/conan/" in thefJ                   original URL becomes the translated path for the script.D                   See Chapter 13 for other information on scripting.  :                      script /conan* /ht_root/script/conan*  '                Example of Redirect Rule   D                1. If a URL path "/AnotherGroup/this/that/other.html"@                   is being mapped the URL would be redirected to4                   "http://host/this/that/other.html"  A                      redirect /AnotherGroup/* http://host/group/*                8.5 Virtual Serverss  I                As described in Section 6.2, virtual service syntax may be H                used with mapping rules to selectively apply rules to oneH                specific service. This example provides the essentials ofI                using this syntax. Note that service-specific and service-nE                common rules may be mixed in any order allowing commonn:                mappings (e.g. for scripting) to be shared.  =                   # a mapping rule example of virtual servers 7                   [[alpha.wasd.dsto.defence.gov.au:80]]!S                   # ALPHA is the only service allowing access to VMS help directoryh+                   pass /sys$common/syshlp/* 6                   [[beta.wasd.dsto.defence.gov.au:80]]:                   # good stuff is only available from BETA$                   pass /good-stuff/*O                   # BETA has it's own error report format, the others share one I                   pass /errorreport /ht_root/local/errorreportalpha.shtml.7                   [[gamma.wasd.dsto.defence.gov.au:80]] R                   # gamma responds with documents using the Cyrillic character set+                   set /* charset=ISO-8859-5a                   [[*]]C3                   # common file and script mappingsA,                   exec /cgi-bin/* /cgi-bin/*1                   exec+ /cgiplus-bin/* /cgi-bin/* 6                   script+ /help/* /cgiplus-bin/conan/*D                   pass /errorreport /ht_root/local/errorreport.shtml>                   # now the base directories for all documents7                   [[alpha.wasd.dsto.defence.gov.au:80]] !                   /* /web/alpha/*a6                   [[beta.wasd.dsto.defence.gov.au:80]]                    /* /web/beta/*7                   [[gamma.wasd.dsto.defence.gov.au:80]]e               8-10  Mapping Rules                  !                   /* /web/gamma/*r                   [[*]] 4                   # catch-all rule (just in case :^)                    pass /* /web/*  M                The server administration menu WATCH report (see Section 11.2) J                provides the capability to view the rule databse as well asM                rule mapping during actual request processing, using the WATCH1                facility.  #             8.6 Conditional Mappings  H                The purpose of conditional mapping is to apply rules onlyK                after certain criteria other than the initial path match areeM                met. These criteria serve to create conditional mapping rules,e2                and were introduced in version 4.4.  G                THIS OFFERS A POWERFUL TOOL TO THE SERVER ADMINISTRATOR!   L                Conditional mapping can be applied on the following criteria:  +                o  authenticated remote usere  )                o  client internet address,  ,                o  browser-accepted languages  1                o  browser-accepted character setsd  0                o  browser-accepted content-types  /                o  browser identification string   ;                o  host and port specified in request header   /                o  HTTP method (GET, POST, etc.)c  <                o  proxy/gateway host(s) request forwarded by  E                o  request scheme (protocol . . . "http:" or "https:")i                  o  query string                  o  server namei                  o  server port   I                Note that path authorization is always applied to the path H                supplied with the request, not to the results of any ruleL                mapping that may have occured! This means authorization pathsM                may be administered without any ambiguity being implied by any +                rule mapping that may occur.s  I                Conditionals must follow the rule and are delimited by "["oL                and "]". Multiple, space-separated conditions may be includedI                within one "[...]". This behaves as a logical OR (i.e. the M                condition only needs one matched to be true). Multiple "[...]" H                conditionals may be included against a rule. These act as  N                                                            Mapping Rules  8-11                 G                a logical AND (i.e. all must have at least one conditioncF                matched). If a condition begins with a "!" it acts as aH                negation operator (i.e. matched strings result in a falseL                condition, unmatched strings in a true condition). The resultL                of an entire conditional may also be negated by prefixing the                "[" with a "!".  L                If a conditional, or set of conditionals, is not met the rule%                is completely ignored.   C                Matching is done by simple, case-insensitive, string H                comparison, using the wildcards "*", matching one or moreB                characters, and "%", matching any single character.  J                White-space (spaces and TABs), wildcards and the delimitingG                "[" and "]", are forbidden characters and cannot be usedeM                within condition matching strings, nor can they be encoded for M                inclusion in any way (for simplicity and speed of processing). M                These characters are uncommon in the information being matched L                against, but if one does occur then "match" it using a single(                character wildcard ("%").  M                While conditionals are powerful adjuncts to smart serving they/M                do add significant overhead to rule mapping and should be used !                with this in mind.e                  Conditionalsa  I                o  ac: - browser-accepted content types ("Accept:" requesti                   header field)   F                o  al: - browser-accepted languages ("Accept-Language:"'                   request header field)o  J                o  as: - browser-accepted character sets ("Accept-Charset:"'                   request header field)   I                o  fo: - request forwarded by proxy/gateway host(s) ("For- 0                   warded:" request header field)  J                o  hh: - host and port request directed to ("Host:" request                   header field)i  =                o  ho: - browser host internet name or addressC  +                o  me: - request HTTP method   $                o  qs: - query string  6                o  ru: - authenticated remote user name  K                o  sc: - request scheme (protocol), "http", and if SSL is inn.                   use "https" (see Chapter 10)  #                o  sn: - server nameg               8-12  Mapping Rulese l  [            #                o  sp: - server port   D                o  ua: - browser ("User-Agent:" request header field)                  Examplesp  H                NOTE: It is possible to spoof (impersonate) internet hostC                addresses. Therefore any controls applied using hosttH                name/address information cannot be used for authorization;                purposes in the strictest sense of the term.   J                1. The following example shows a rule being applied only ifH                   the client host is within a particular subnet. This isM                   being used to provide a "private" home page to those in theNM                   subnet while others get a "public" page by the second rule.   =                      pass / /web/internal/ [ho:131.185.250.*]a!                      pass / /web/e  E                2. This is a similar example to the above, but showingdI                   multiple host specifications and specifically excluding K                   one particular host using the negation operator "!". This K                   could be read as pass if ((host OR host) AND (not host)).   ]                      pass / /web/internal/ [ho:*.fred.com ho:*.george.com] [!ho:you.fred.com] !                      pass / /web/c  E                3. The next example shows how to prevent browsing of aiG                   particular tree except from specified host addresses.e  U                      pass /web/internal/* /web/SorryNoAccess.html [!ho:131.185.250.*]t)                      pass /web/internal/*a  F                   This could be used to prevent browsing of the serverE                   configuration files (an alternative to this sort of L                   approach is to use the authorization file, see Chapter 9).  X                      pass /ht_root/local/* /web/SorryNoAccess.html [!ho:131.185.250.201]  J                4. This example performs much the same task as the previousE                   one, but uses whole conditional negation to preventlE                   browsing of a particular tree except from specifieduH                   addresses (as well as using the continuation characterM                   to provide a more easily comprehended layout . . . note theeM                   trailing spaces as required). This could be read as pass if -                   not (host OR host OR host).         N                                                            Mapping Rules  8-13 -  -            C                      pass /web/internal/* /web/SorryNoAccess.html \                       ![\'                      ho:131.185.250.* \c'                      ho:131.185.251.* \b&                      ho:131.185.45.1 \-                      ho:ws2.wasd.dsto.gov.au\f                      ])                      pass /web/internal/*n  F                5. This example demonstrates mapping pages according toI                   geography or language preference (it's a bit contrived,h                   but . . . )   B                      pass /doc/* /web/doc/french/* [ho:*.fr al:fr]C                      pass /doc/* /web/doc/swedish/* [ho:*.se al:se] 3                      pass /doc/* /web/doc/english/*i  K                6. How to exclude specific browsers from your site (how many/+                   times have we seen this!)*  N                      # I had to pick on a well-known acronym, no offence Bill!=                      pass /* /web/NoThankYou.html [ua:*MSIE*]r  E                7. This example allows excluding certain requests fromlL                   specific addresses. This could be read as pass if ((method+                   is POST) AND (not host)).p  J                      pass /* /web/NotAllowed.html [me:POST] [!ho:*.my.net]  H                8. The following illustrates using the server name and/orG                   server port to conditionally map servers executing on G                   clustered nodes using the same configuration file, oraI                   for multi-homed/multi-ported hosts. Distinct home pagesoI                   are maintained for each system, and on BETA two servers J                   execute, one on port 8000 that may only be used by those=                   within the specified network address range.c  C                      pass / /web/welcome_to_Alpha.html [sn:alpha.*]eI                      pass / /web/welcome_to_Beta.html [sn:beta.*] [sp:80] [                      pass /* /sorry_no_access.html [sn:beta.*] [sp:8000] [!ho:*.my.sub.net] S                      pass / /web/welcome_to_Beta_private.html [sn:beta.*] [sp:8000]   G                9. Each of these three do basically the same thing, just F                   using the three possible delimiters according to theJ                   characters required in the message. The server generatesM                   a 403 response with has as it's text the following message.   P                      pass /private/* "403 Can't go in there!" [!ho:my.host.name]X                      pass /private/* '403 "/private/" is off-limits!' [!ho:my.host.name]W                      pass /private/* {403 Can't go into "/private/"} [!ho:my.host.name]e  G                Note that rule processing for any particular path may bep<                checked using the server administration menu.               8-14  Mapping Ruless e  n            @             8.7 Mapping User Directories (tilde character ("~"))  C                This server will map user directories using the samesC                mechanisms as for any other. No reference is made to I                SYSUAF.DAT, user support is accomplished via a combinationmJ                of mapping rule and logical name. This approach relies on aI                correspondance between the username and the home directory F                name. Hence users are made known by the HTTPd using theG                name of their top-level directory. As the naming of homesG                directories using the username is a common practice thisfM                mechanism should suffice in the majority of cases. Where there K                is no such correspondance individual rules could be used for I                each user. User scripts can also be supported using WASD's K                DECnet scripting environment. See Section 13.8.4 for furtheru                detail.  K                The "PASS" rule provides a wildcard representation of users' F                directory paths. As part of this mapping a subdirectoryM                specifically for the hypertext data should always be included.sF                Never map users' top-level directories. For instance ifF                a user's account home directory was located in the areaF                USER$DISK:[DANIEL] the following rule would potentiallyK                allow the user DANIEL to provide web documents from the homefI                subdirectory [.WWW] (if the user has created it) using the                  accompanying URL:  /                   pass /~*/* /user$disk/*/www/*r  &                   http://host/~daniel/  H                It is recommended that a separate logical name be createdJ                for locating user directories. This helps hide the internalJ                organisation of the file system. The following logical nameA                definition and mapping rule illustrate this point.   W                   $ DEFINE /SYSTEM /EXEC /TRANSLATION=CONCEALED WWW_USER device:[USER.]s  .                   pass /~*/* /www_user/*/www/*  G                Where users are grouped into different areas of the file ;                system a logical search list may be defined.   A                   $ DEFINE /SYSTEM /EXEC /TRANSLATION=CONCEALED -/%                            WWW_USER -t-                            DISK1:[GROUP1.], - -                            DISK1:[GROUP2.], -a-                            DISK2:[GROUP3.], -f*                            DISK2:[GROUP4.]  .                   pass /~*/* /www_user/*/www/*  N                                                            Mapping Rules  8-15 i  R            J                As logical search lists have specific uses and some compli-J                cations (e.g. when creating files) this is the only use forM                them recommended with this server, although it is specifically J                coded to allow for search lists in document specifications.  H                If only a subset of all users are to be provided with WWWH                publishing access either their account directories can beL                individually mapped (best used only with a small number) or aL                separate area of the file system be provided for this purpose5                and specifically mapped as user space.   D                Of course, user mapping is amenable to all other ruleK                processing so it is a simple matter to redirect or otherwisenL                process user paths. For instance, the published username doesJ                not need to, or need to continue to, correspond to any realA                user area, or the user's actual name or home area:t  @                   redirect /~doej/* http://a.nother.host/~doej/*;                   pass /~doej/* /www/messages/deceased.htmls>                   pass /~danielm/* /special$www$area/danielm/*?                   pass /~Mark.Daniel/* /user$disk/danielm/www/* .                   pass /~*/* /www_user/*/www/*  L                A user directory is always presented as a top-level directoryM                (i.e. no parent directory is shown), although any subdirectory .                tree is accesssable by default.                                                             8-16  Mapping Rulesr s                   M             Chapter__9_______________________________________________________n  ,             Authentication and Authorization    G                Authentication is the verification of a user's identity,dM                usually through a username/password combination. Authorization I                is allowing a certain action to be applied to a particular >                path based on authentication of the originator.  D                Generally, authorization is a two step process. FirstI                authentication, using a username/password database. Second[L                authorization, determining what the username is allowed to do$                for this transaction.  H                Authentication environments can get complex very quickly,K                don't forget to "keep it simple, stupid", see Section 9.4.1.r                  Overview   F                Server authorization is performed using a configurationG                file, authentication database and optional authorization F                grouping database, and is based on per-path directives.F                There is no user-configured authorization necessary, orG                possible! In the configuration file paths are associated F                with the authentication and authorization environments,J                and so become subject to the HTTPd authorization mechanism.H                Reiterating . . . WASD HTTPd authorization administrationH                involves those two aspects, setting authorization againstK                paths and administering the authentication and authorization                 databases.t  L                AUTHORIZATION IS ALWAYS APPLIED TO THE PATH SUPPLIED WITH THEL                REQUEST, not to the results of any rule mapping that may haveJ                occured! This means authorization paths may be administeredD                without ambiguity. With requests containing a script,M                authorization is performed on both script and path components. M                First script access is checked for any authorization, then theCL                path component is independently authorized. Either may result5                in an authorization challenge/failure.   I                For the WASD HTTPd user authentication can be done via the M                server system's SYSUAF database (not recommended except exceptiM                when employing SSL or in the most secure of LAN environments), 7                see Section 9.7 for further information.   H                The authentication database name can be refered to as theJ                realm, and refers to a collection of username/passwords. It3                can be the system's SYSUAF database.c  N                                          Authentication and Authorization  9-1    o            I                The authorization database can be refered to as the group, E                and refers to a collection of usernames and associated                 permissions.O  F                Separate databases are not always necessary, permissionM                information can be stored in the same database as the password I                information. Paths are generally authorized on a per-group J                basis. Path access can be also be restricted on an internetF                host name/domain, internet address and/or authenticatedI                username basis. If only a small number of usernames are tosH                be associated with a path it is possible to list them allJ                against the path and have permissions derived directly from3                the authentication database (realm).e  $                Authentication Policy  G                A policy regarding when authorization can be used may be K                established for the server. This can restrict authentication F                challenges to "https:" (SSL) requests (see Chapter 10),I                thereby ensuring that the authorization environment is not J                compromised by use in non-encrypted transactions. Two HTTPd'                qualifiers provide this.c  ?                o  /AUTHORIZATION=SSL  restricts all authentica-mI                   tion/authorization transactions to the SSL environment.t  K                o  /SYSUAF=SSL  restricts only SYSUAF authenticated transac- /                   tions to the SSL environment.t  G                o  /SYSUAF=ID  restricts SYSUAF authenticated account totJ                   those possessing a specific VMS resource idnetifier (see!                   Section 9.7.1).u  ;                o  /SYSUAF=(ID,SSL)  combines the above two.t  C                Note also that individual paths may be restricted toaE                SSL requests using either the mapping conditional ruleaJ                configuration or the authorization configuration files. See8                Conditionals and Access Restriction List.  M                In addition two configuration parameters have a direct role in 3                an established authorization policy.n  L                o  [AuthFailureLimit]  sets the maximum unsuccessful attemptsJ                   allowed before a username is then always refused authen-I                   tication. After this limit is reached the cache must beiJ                   purged to re-allow the user access, see Section 5.3.2.2.  I                o  [AuthRevalidateUserMinutes]  sets the number of minutes L                   between successive authentication attempts before the userM                   is forced to reenter the authentication data (via a browserc7                   dialog). Zero disables this function.   1             9-2  Authentication and Authorizationl    w            &                Authentication Failures  I                Details of authentication failures are logged to the HTTPdc                process log.t  H                o  %HTTPD-W-AUTHFAIL  indicates a failure to authenticateH                   (incorrect username/password). The number of failures,H                   the realm name, the user name and the originating hostF                   are provided. Isolated instances of this are only ofI                   moderate interest. Consecutive instances may indicate a I                   user thrashing about for the correct password, but they :                   usually give up before a dozen attempts.  F                o  %HTTPD-I-AUTHFAILOK  advises that a previous failureG                   to authenticate has now successfully done so. This isv,                   essentially informational.  L                o  %HTTPD-W-AUTHFAILIM  indicates the number of failures haveH                   exceeded the [AuthFailureLimit], after which automaticK                   refusal begins. This message should be of concern and thetI                   circumstances investigated, especially if the number of -                   attempts becomes excessive.s  #                Authorization Schemer  I                The term authorization scheme refers to the HTTP method of H                authenticating the user. The WASD HTTPd can employ one orG                other, or both of the "Basic" and "Digest" schemes. BothtK                schemes use a username/password mechanism, with Digest beingiL                preferable because the password is transmitted encrypted, andG                with Basic only encoded (and therefore easily readable).e  1                                              Notee  E                      The Digest scheme has, to date, only been testedsH                      against NCSA X Mosaic 2.7-4b, which seems to behaveG                      a little flakey when reloading documents, and doesh8                      not elegantly support stale nonces.  *             9.1 Permissions, Path and User  H                Both paths and usernames have permissions associated withM                them. A path may be specified as read-only, read and write, oraL                write-only (yes, I'm sure someone will want this!) A usernameH                may be specified as read capable, read and write capable,H                or only write capable. For each transaction these two areI                combined to determine the maximum level of access allowed.aM                The allowed action is the logical AND of the path and usernamei                permissions.   N                                          Authentication and Authorization  9-3 .  ]            L                The permissions may be described using the HTTP method names,E                or using the more concise abbreviations R, W, and R+W.   M                ______________________________________________________________dM                Path/User___DELETE_GET____HEAD___POST___PUT___________________i  9                READ or R   no     yes    yes    no     no   :                WRITE or W  yes    no     no     yes    yes  :                R+W         yes    yes    yes    yes    yes  9                DELETE      yes    yes    no     no     no   9                GET         no     yes    no     no     no   9                HEAD        no     no     yes    no     no   9                POST        no     no     no     yes    no   M                PUT_________no_____yes____no_____no_____yes___________________   0             9.2 Authorization Configuration File  G                Requiring a particular path to be authorized in the HTTP5D                transaction is accomplished by applying authorizationF                requirements against that path in a configuration file.K                This is an activity distinct from setting up and maintainingoJ                any authentication/authorization databases required for the                environment.p  M                By default, the system-table logical name HTTPD$AUTH locates aeL                common authorization configuration file, unless an individualL                rule file is specified using a job-table logical name. SimpleK                editing of the file changes the configuration. Comment lines M                may be included by prefixing them with the hash "#" character, L                and lines continued by placing the backslash character "\" as,                the last character on a line.  H                Configuration directives begin either with a "[realm]" orL                "[realm;group]" specification, or with the forward-slash of aL                path specification. Following the path specification are HTTPI                method keywords controlling group and world permissions touM                the path, and any access-restricting request scheme ("https:")a:                and/or host address(es) and/or username(s).  @                o  REALM -  Square brackets are used to enclose aJ                   [realm;group] specification, introducing a new authenti-I                   cation grouping. Within these brackets is specified the L                   realm (and database) name, and then an optional group (andJ                   database) name separated by a semi-colon. All path spec-I                   ifications following this are authenticated against the0I                   specified realm database, and permissions obtained fromj  1             9-4  Authentication and Authorizationm r  c            M                   the group database (or authentication database if group not I                   specified), until the next [realm;group] specification.e  E                   The following shows the format of an authenticationm2                   database only (realm) directive.  .                      [authentication-database]  J                   This the format of a directive using both authenticationE                   and authorization databases (both realm and group).u  G                      [authentication-database ; authorization-database]n  H                o  PATH -  Paths are usually specified terminated with anI                   asterisk wildcard. This implies that any directory treevI                   below this is included in the access control. WildcardsfL                   may be used to match any portion of the specified path, orJ                   not at all. Following the path specification are controlG                   keywords representing the HTTP methods or permissionseL                   that can be applied against the path, and optional access-J                   restricting list of host address(es) and/or username(s),J                   separated using commas. Access control is against eitherF                   or both the group and the world. The group access isJ                   specified first followed by a semi-colon separated worldJ                   specification. The following show the format of the pathJ                   directive, see the examples below to further clarify the                   format.   I                      /root/path/  group-access-list,group-permissions ; \eE                                   world-access-list,world-permissions   F                The same path cannot be specified against two differentI                realms. The reason lies in the HTTP authentication schema,sK                which allows for only one realm in an authentication dialog.eD                How would the server decide which realm to use in theH                authentication challenge? Of course, different parts of aM                given tree may have different authorizations, however any treefI                ending in an asterisk results in the entire sub-tree being L                controlled by the specified authorization environment, unlessK                a separate specification exists for some inferior portion ofe                the tree.                  Reserved Realms  L                The following realm names (authentication database names) are7                reserved and have special functionality.n  G                1. EXTERNAL -  Any authentication and authorization will/H                   be done in some way by an external CGI script. None is*                   attempted by the server.  N                                          Authentication and Authorization  9-5 a  e            J                2. WORLD -  This refers to any request and is not authenti-H                   cated in any way, only the permissions associated withL                   the path are applied to the request. The reserved username=                   "WORLD" becomes the authenticated username.   G                3. VMS -  Use the server system's SYSUAF database to au- I                   thenticate the username. For "http:" requests the user-5I                   name/password pairs are transmitted encoded but not en-uJ                   crypted, this is not recommended. For "https:" requests,M                   using the implicit security offered by SSL (see Chapter 10)hH                   the use of SYSUAF authentication is considered viable.  G                   By default accounts with SYSPRV authorized are alwaystK                   rejected to discourage the use of potentially significant G                   usernames (e.g. SYSTEM). Accounts that are disusered,tJ                   have passwords that have expired, or that are captive or=                   restricted are also automatically rejected.d  E                   The VMS realm has syntax variant allowing a synonym E                   to be used in the rule disguising the use of SYSUAFeI                   authentication. Merely use any other allowed realm namep-                   with "=VMS" appended to it.   J                   See Section 9.7 for further information on these topics.                   Reserved Username  2                The following username is reserved.  L                1. WORLD -  If a path is authorized using the WORLD realm theM                   pseudo-authenticated username becomes "WORLD". Any log will M                   reflect this username and scripts will access a WWW_REMOTE_*K                   USER containing this value. Although not forbidden, it isaL                   not recommended this string be used as a username in other                   realms.   &                Access Restriction List  J                If a host name, protocol identifier or username is includedK                in the path configuration directive it acts to further limit_H                access to matching clients (path and username permissionsI                still apply). If more than one are included a request mustnF                match each. If multiple host names and/or usernames areL                included the client must match at least one of each. Host andL                username strings may contains the asterisk wildcard, matchingK                one or more consecutive characters. This is most useful when J                restricting access to all hosts within a given domain, etc.  M                o  Host Names -  may be specified as either alphabetic (if DNS K                   name resolution is enabled, see [DNSlookup] configurationgJ                   directive) or numeric addresses. When a host restrictionF                   occurs there is never an attempt to authenticate any  1             9-6  Authentication and Authorizationi                 L                   associated username. Hence applying host restrictions veryI                   effectively prevents an attack from outside the allowed L                   addresses. The reserved word #localhost refers to the host2                   name the server is executing on.  L                o  Request Scheme -  (protocol) either "http:" or secured via                    "https:" (SSL)  J                o  User Names -  are indicated by a leading circumflex, theA                   "~" character (similar or username URL syntax).t                  For example  G                   /web/secret/* *.three.stooges,~Moe,~Larry,~Curly,read   K                restricts read access to Curly, Larry and Moe accessing from 6                within the three.stooges network, while  N                   /web/secret/* https:,*.three.stooges,~Moe,~Larry,~Curly,read  K                applies the further restriction of access via "https:" (SSL)i                only.  E                Note that it more efficient to place protocol and hostp3                restrictions at the front of a list.i               9.3 Virtual Serverse  I                As described in Section 6.2, virtual service syntax may be L                used with authorization mapping to selectively apply rules toL                one specific service. This example provides the essentials ofI                using this syntax. Note that service-specific and service- E                common rules may be mixed in any order allowing common 7                authorization environments to be shared.                                 N                                          Authentication and Authorization  9-7 l  i            C                   # authorization rules example for virtual serversc8                   [[alpha.wasd.dsto.defence.gov.au:443]]X                   # ALPHA SSL is the only service permitting VMS (SYSUAF) authentication                   [VMS]o'                   /web/* https:,r+w ; re5                   /httpd/-/admin/* ~daniel,https:,r+wi6                   [[beta.wasd.dsto.defence.gov.au:80]]2                   # BETA has it's own HTA database                   [BETA-USERS]                    /web/* r+w ; r7                   [[gamma.wasd.dsto.defence.gov.au:80]]-"                   # GAMMA likewise)                   [GAMMA-USERS;PROJECT-A]n*                   /web/project/a/* r+w ; r)                   [GAMMA-USERS;PROJECT-B] *                   /web/project/b/* r+w ; r                   [[*]] H                   # allow anyone from the local subnet to upload to here                   [WORLD]n1                   /web/unload/* 131.185.200.*,r+w   L                The server administration menu path authorization report (seeI                Section 11.2) provides a selector allowing the viewing andbL                checking of rules showing all services or only one particularH                virtual server, making it simpler to see exactly what any9                particular service is authorizing against.v  4             9.4 Authorization Configuration Examples  M                1. In the following example the authentication realm is "WASD" G                   and the permissions group "SOCIALCLUB". The directive K                   allows those authenticated from the WASD realm and in the L                   SOCIALCLUB group to read and write, and the world to read.  &                      [WASD;SOCIALCLUB]1                      /web/socialclub/* r+w ; readt  G                2. This example illustrates restricting access accordingeH                   internet address. Both the group and world restrictionH                   is identical, but the group address is being specifiedH                   numerically, while the world access is being specifiedI                   alphabetically (just for the purposes of illustration).oM                   This access check is done doing simple wildcard comparison,cE                   and makes numerical specifications potentially morepH                   efficient because they are usually shorter. The secondJ                   line restricts that path's write access even further, to)                   one username, "BLOGGS".       1             9-8  Authentication and Authorization                  &                      [WASD;SOCIALCLUB]W                      /web/socialclub/* 131.185.45.*,get,post; *.dsto.defence.gov.au,get h                      /web/socialclub/accounts/* 131.185.45.*,~BLOGGS,get,post; *.dsto.defence.gov.au,get  M                3. In the following example the authentication realm and grouprL                   are a single database, "ADMIN". The first directive allowsK                   those in the ADMIN group to read and write, and the world K                   to read ("get,post;get"). The second line restricts writetM                   and even read access to ADMIN group, no world access at alls                   ("get,post").D                        [ADMIN]1                      /web/everyone/* get,post;getn/                      /web/select/few/* get,post   K                4. With this example usernames are used to control access to M                   the specified paths. These usernames are authenticated fromaI                   the COMPANY database. The world has read access in botht                   cases.                        [COMPANY]>                      /web/docs/* ~Howard,~George,~Fred,r+w ; r4                      /web/accounts/* ~George,r+w ; r  I                5. The following example shows a path specifying the localiK                   system's SYSUAF being used to authenticate any usernames.WL                   Whenever using SYSUAF authentication it is strongly recom-K                   mended to limit the potential hosts that can authenticateiM                   in this way by always using a host-limiting access restric- 7                   tion list. The world get read access.                         [VMS]<                      /web/local/area/* 131.185.250.*,r+w ; r  I                6. To restrict server administration to browsers executingtJ                   on the server system itself and the SYSUAF-authenticatedG                   username DANIEL use a restriction list similar to themK                   following. It also shows the use of SYSUAF-authenticatione6                   being hidden by using a VMS-synonym.  !                      [SNEAKY=VMS]d=                      /httpd/-/admin/*  #localhost,~daniel,r+w   H                7. The following example illustrates providing a read andM                   writable area (GET, POST and PUTable) to hosts in the localiE                   network without username authentication (careful!).                         [WORLD];                      /web/scratch/*  *.local.hosts.only,r+w   N                                          Authentication and Authorization  9-9 s  s                         9.4.1 KISS  F                WASD authorization allows for very simple authorizationD                environments and provides the scope for quite complexH                ones. The path authentication scheme allows for multiple,G                individually-maintained authentication and authorization D                databases that can then be administered by autonomousH                managers, applying to widely diverse paths, all under theA                ultimate control of the overall Web administrator.   G                Fortunately great complexity is not generally necessary.   I                Most sites would be expected to require only an elementary I                setup allowing a few selected Web information managers the L                ability to write to selected paths. This can best be providedM                with the one authentication database containing read and write I                permissions against each user, with and access-restrictionW-                list against individual paths.   G                For example. Consider a site with five departments, eachDE                of which wishes to have two representatives capable of K                administering the departmental Web information. There is oney=                authentication database, named after the site:                      HYPOTHETICAL  K                In that database are twelve names, the first two the overall.J                Web administrators, capable of administering all authorizedL                paths, another two from each department makes up another ten:                      WEB1       r+w                    WEB2       r+w                    JOHN       r+w                    PAUL       r+w                    GEORGE     r+w                    RINGO      r+w                    CURLY      r+w                    LARRY      r+w                    MOE        r+w                    SHEMP      r+w                    MAC        r+w                    MYER       r+w  B                The authorization configuration file then contains:            2             9-10  Authentication and Authorization                                     [HYPOTHETICAL]H                   # allow web masters (!) to use the administration menuK                   #                       to revise web configuration files 7                   # world has no access (read or write) Y                   # access is only allowed from a browser on the same system as the HTTPda<                   /httpd/-/admin/*  #localhost,web1,web2,r+w<                   /ht_root/local/*  #localhost,web1,web2,r+wY                   # allows BOGUS_R_AND_D department representatives to maintain their web H                   # this may only be done from within the company subnet)                   # world has read accessdU                   /web/dept/bogus_R_and_D/*   150.15.30.*,John,Paul,web1,web2,r+w ; r =                   # and so on for the rest of the departmentsaX                   /web/dept/real_R_and_D/*    150.15.30.*,George,Ringo,web1,web2,r+w ; rK                   # (the next uses line continuation just for illustration) ;                   /web/dept/marketing/*       150.15.30.*,\aJ                                               Curly,Larry,web1,web2,r+w ;\2                                               readU                   /web/dept/production/*      150.15.30.*,Moe,Shemp,web1,web2,r+w ; r T                   /web/dept/inventory/*       150.15.30.*,Mac,Myer,web1,web2,r+w ; r                   [WORLD] Q                   # we need a spot for general POSTing (world has no read access)h>                   # (just for the purposes of illustration :^)#                   /web/world/*  r+w.    3             9.5 Databases, Authentication and Group   J                At this point it should be stressed that the HTTPd-specificH                (HTA) authentication and group databases are identical inF                internal structure and administration, it is merely theI                role they assume that differentiates them. The role of the F                database is purely a function of where they are used inJ                the configuration file realm directive, the first mentionedJ                becomes the authentication database, any subsequent, secondJ                database assumes the role of group database (otherwise thatD                role is also assumed by the authentication database).  &                Authentication Database  F                An authentication, or realm database contains usernamesJ                and associated passwords. Passwords are verified using thisG                database. Passwords are always stored in encrypted form.   H                When using an HTTPd-specific database it can also be usedF                to contain per-user permissions, that control access toC                configured paths. In this role it acts as both realmtC                (authentication) and group (authorization) database.       N                                         Authentication and Authorization  9-11                 I                It is also possible for the system's SYSUAF database to besI                used for authentication purposes. Of course HTTPd-specificTJ                permissions cannot be stored in this database, but if usingK                SYSUAF-authenticated usernames a VMS security profile can bedG                used to control access to served files, see Section 9.7.o  K                Warning ... when using Digest authentication, an authentica-eK                tion database cannot simply be renamed to represent a group-eL                name change, as the database name is encrypted as part of the                MD5 Digest!  %                Authorization Database   L                An authorization, or group database, contains a collection ofK                usernames and their associated permissions within the group.uH                That is, can that user read and/or write paths configuredE                against that group. A group database is never used ford6                password verification (authentication).  K                An authorization database is not always necessary. If only aeJ                small number of users need to be authorized against a givenJ                path they can be specified individually using a "~username"4                format (see Access Restriction List).  &                Database Administration  H                The same server administration menu is used to administerJ                authentication/authorization databases, see Section 9.6 and                Section 11.3.  G                There is a thirty-one character limit on database names,eH                and a fifteen character limit on usernames and passwords.F                All database and user names are case-insensitive. BASICL                authentication scheme passwords are case insensitive, howeverJ                DIGEST authentication scheme passwords should all be either=                upper or lower case, mixed case will not work.   3             9.6 Server Authorization Administrationw  F                The same server administration menu is used to maintainG                both the authentication and authorization databases, sees                Section 11.3.  L                The server authorization databases can be initially set-up by:                breaking-in to the server, see Section 11.1  J                A server's currently loaded path authorization and user au-L                thentication information may be administered and interrogatedJ                on-line using the server administration facility. See Chap-)                ter 11 for further detail.e  2             9-12  Authentication and Authorization                 *             9.7 SYSUAF-Authenticated Users  G                The ability to authenticate using the system's SYSUAF isdH                controlled by the server /SYSUAF qualifier. By default it                is disabled.l  M                By default accounts with SYSPRV authorized are always rejected*I                to discourage the use of potentially significant usernamesiK                (e.g. SYSTEM). This behaviour can be changed through the usehL                of specific identifiers, see Section 9.7.1 immediately below.L                Accounts that are disusered, have passwords that have expiredE                or that are captive or restricted are always rejected._                   VMS Realm Synonym  D                The VMS realm has a special syntax allowing a synonymE                to be used in the rule, hiding the evidence of SYSUAF-IK                authentication. Use any other allowed realm name with "=VMS"t8                appended to it, as shown in this example.  %                   [LOCAL=VMS;TESTING]s0                   /web/project/testing/* r+w ; r  ,             9.7.1 Authentication Identifiers  I                When SYSUAF authentication is enabled, by default all non- I                privileged, active accounts are capable of authentication. E                Restriction of this to those actually requiring such afL                capability is provided using VMS rights identifiers. When theJ                /SYSUAF=ID qualifier is employed a VMS account must possessI                one of two specific identifiers before it is allowed to be K                used for server authentication. Note that this mechanism caneM                also allow privileged accounts to be so used . . . deploy with L                discretion! Note also that the use of access identifiers withJ                this facility allows a much finer control of which accountsI                may be used for authentication and so is also the preferedh=                mechanism for deploying SYSUAF authentication.y                  1. WASD_VMS_R  ?                   This identifier provides at most read access.                   2. WASD_VMS_RW   F                   This identifier provides read and write access (path5                   protections still apply of course).e  M                Other identifiers provide further control for the way in which 5                the authenticated account may be used.L                   1. WASD_VMS_HTTPS  L                   Use of the authenticated account is restricted to "https:"!                   (SSL) requests.o  N                                         Authentication and Authorization  9-13    i                            2. WASD_VMS_PWD  M                   The account is allowed to change it's SYSUAF password (!!). K                   It is recommended this facility only be employed with SSL                    in place..  I                   Password modification is enabled by including a mappingo5                   rule to the internal change script.c  :                      map /http/-/change/* /http/-/change/*  M                   The authorization configuration file must provide authenti-                    cated access.                         [VMS]5                      /httpd/-/change/vms/* https:,r+w   '                   Also see Section 9.9.e  (                3. WASD_VMS__<group-name>  L                   This form allows a suitably named identifier to be createdL                   for use in providing group-membership via the SYSUAF. NoteM                   the double-underscore separating the fixed from the locally K                   specified portion. Using these identifiers it is possibleAL                   to limit paths to SYSUAF-authenticated accounts possessingK                   the requisite identifier in manner similar to non-SYSUAF- H                   authentication groups. An account possessing the WASD_M                   VMS__TESTING identifier is allowed write access to the pathO+                   in the following example:r  "                      [VMS;TESTING]3                      /web/project/testing/* r+w ; r   H                All four rights identifiers must exist for the /SYSUAF=IDJ                facility to be used (even though none may be granted to anyK                account). The identifiers may be created using the AUTHORIZEw/                utility with following commands:r  *                   $ SET DEFAULT SYS$SYSTEM!                   $ MCR AUTHORIZEm1                   UAF> ADD /IDENTIFIER WASD_VMS_R 2                   UAF> ADD /IDENTIFIER WASD_VMS_RW5                   UAF> ADD /IDENTIFIER WASD_VMS_HTTPS 3                   UAF> ADD /IDENTIFIER WASD_VMS_PWDt  K                They can then be provided to desired accounts using commandsU(                similar to the following:  >                   UAF> GRANT /IDENTIFIER WASD_VMS_RW <account>  !                and removed using:w  ?                   UAF> REVOKE /IDENTIFIER WASD_VMS_RW <account>U  2             9-14  Authentication and Authorization                 M                Be aware that, as with all successful authentications, and dueeK                to the WASD internal authentication cache, changing databasetM                contents does not immediately affect access. Any change in thewM                RIGHTSLIST won't be reflected until the cache entry expires ort;                it is explicitly flushed (see Section 11.4).a  )             9.7.2 Nil-Access VMS Accountsp  H                It is possible, and may be quite effective for some envi-J                ronments, to have a SYSUAF account or accounts strictly forJ                HTTP authorization, with no actual interactive or other ac-J                cess allowed to the VMS system itself. This would relax theI                caution on the use of SYSUAF authentication outside of SSLDH                transactions. An obvious use would be for the HTTP serverG                administrator. Additional accounts could be provided fortI                other authorization requirements, all without compromising %                the system's security.e  F                In setting up such an environment it is vital to ensureI                the HTTPd server is started using the /SYSUAF=ID qualifiertI                (see Authentication Policy). This will require all SYSUAF-)H                authenticated accounts to possess a specific VMS resourceM                identifier, accounts that do not possess the identifier cannot /                be used for HTTP authentication./  G                To provide such an account select a group number that issI                currently unused for any other purpose. Create the desiredeM                account using whatever local utility is used then activate VMSdL                AUTHORIZE and effectively disable access to that account fromK                all sources and grant the appropriate access identifier (see $                Section 9.7.1 above).  *                   $ SET DEFAULT SYS$SYSTEM!                   $ MCR AUTHORIZE X                   UAF> MODIFY <account> /NOINTERACTIVE /NONETWORK /NOBATCH /FLAG=DISMAIL>                   UAF> GRANT /IDENTIFIER WASD_VMS_RW <account>                9.7.3 SYSUAF and SSL  H                When SSL is in use (see Chapter 10) the username/passwordG                authentication information is inherently secured via thesK                encrypted communications of SSL. To enforce access to be viagI                SSL add the following to the HTTPD$MAP configuration file:o  N                   /whatever/path/you/like/*  "403 Access denied."  ![sc:https]  M                or alternatively the following to the HTTPD$AUTH configurationh                file:                     [REALM]D3                   /whatever/path/you/like/*  https:   N                                         Authentication and Authorization  9-15    e            L                Note that this mechanism is applied after any path and methodE                assessment made by the server's authentication schema.   F                The qualifier /SYSUAF=SSL provides a powerful mechanismG                for protecting SYSUAF authentication, restricting SYSUAF E                authenticated transactions to the SSL environment. The F                combination /SYSUAF=(SSL,ID) is particularly effective.  .                Also see Authentication Policy.  "             9.7.4 Security Profile  H                It is possible to control access to files and directoriesJ                based on the VMS security profile of a SYSUAF-authenticatedG                remote user. This functionality is implemented using VMSiG                security system services involving SYSUAF and RIGHTSLISTdH                information. The feature must be explicitly allowed usingH                the server /PROFILE qualifier. By default it is disabled.  G                When a SYSUAF-authenticated user (i.e. the VMS realm) isaH                first authenticated a VMS security-profile is created andI                stored in the authentication cache. A cached profile is anrL                efficient method of implementing this as it obviously removesJ                the need of creating a user profile each time a resource isK                assessed. If this profile exists in the cache it is attachedsK                to each request authenticated for that user. As it is cachediK                for a period, any change to a user's security profile in the L                SYSUAF or RIGHTSLIST won't be reflected in the cached profileM                until the cache entry expires or it is explicitly flushed (see                 Section 11.4).a  G                When a request has this security profile all accesses toaL                files and directories are assessed against it. When a file orM                directory access is requested the security-profile is employedmH                by a VMS security system service to assess the access. IfL                allowed, it is provided via the SYSTEM file protection field.K                Hence it is possible to be eligible for access via the OWNER L                field but not actually be able to access it because of SYSTEMK                field protections! If not allowed, a "no privilege" error is                 generated.   I                Of course, this functionality only provides access for the E                server, IT DOES NOT PROPAGATE TO ANY SCRIPT ACCESS. IfaH                scripts must have a similar ability they should implementF                their own scheme (which is not too difficult, ) see HT_J                ROOT:[SRC.MISC]CHKACC.C based on the CGI variable WWW_AUTH_K                REALM which would be "VMS" indicating SYSUAF-authentication,f=                and the authenticated name in WWW_REMOTE_USER.     2             9-16  Authentication and Authorization    r            !                Performance Impact   I                If the /PROFILE qualifier has enabled SYSUAF-authenticatedoJ                security profiles, whenever a file or directory is assessedF                for access an explicit VMS security system service callI                is made. This call builds a security profile of the object H                being assessed, compares the cached user security profileG                and returns an indication whether access is permitted orhJ                forbidden. This is addition to any such assessments made by1                the file system as it is accessed.   I                This extra security assessment is not done for non-SYSUAF- =                authenticated accesses within the same server.   L                For file access this extra overhead is negligible but becomesJ                more significant with directory listings ("Index of") whereG                each file in the directory is independently assessed forp                access.  /             9.8 Controlling Server Write Access   G                The server account should have no direct write access toaH                into any directory structure. Files in these areas shouldF                be owned by SYSTEM ([1,4]). Write access for the serverH                into VMS directories (using the POST or PUT HTTP methods)G                should be controlled using VMS ACLs. This is in addition H                to the path authorization of the server itself of course!C                The recommendation to have no ownership of files andhJ                provide an ACE on required directories prevents inadvertantJ                mapping/authorization of a path resulting in the ability to,                write somewhere not intended.  A                Two different ACEs implement two grades of access.   M                1. If the ACE grants CONTROL access to the server account then I                   only VMS-authenticated usernames with security profiles K                   can potentially write to the directory. Only potentially,bL                   because a further check is made to assess whether that VMS9                   account in particular has write access.e  L                   This example shows a suitable ACE that applies only to the%                   original directory:   3                      $ SET SECURITY directory.DIR -cX                        /ACL=(IDENT=HTTP$SERVER,ACCESS=READ+WRITE+EXECUTE+DELETE+CONTROL)  J                   This example shows setting an ACE that will propagate to@                   created files and importantly, subdirectories:  3                      $ SET SECURITY directory.DIR -fl                        /ACL=((IDENT=HTTP$SERVER,OPTIONS=DEFAULT,ACCESS=READ+WRITE+EXECUTE+DELETE+CONTROL), -Z                              (IDENT=HTTP$SERVER,ACCESS=READ+WRITE+EXECUTE+DELETE+CONTROL))  N                                         Authentication and Authorization  9-17 e  o            G                2. If the ACE grants WRITE access then the directory can G                   be written into by any authenticated username for thee"                   authorized path.  L                   This example shows a suitable ACE that applies only to the%                   original directory:   3                      $ SET SECURITY directory.DIR - P                        /ACL=(IDENT=HTTP$SERVER,ACCESS=READ+WRITE+EXECUTE+DELETE)  J                   This example shows setting an ACE that will propagate to@                   created files and importantly, subdirectories:  3                      $ SET SECURITY directory.DIR -ed                        /ACL=((IDENT=HTTP$SERVER,OPTIONS=DEFAULT,ACCESS=READ+WRITE+EXECUTE+DELETE), -R                              (IDENT=HTTP$SERVER,ACCESS=READ+WRITE+EXECUTE+DELETE))  E                To assist with the setting of the required ACEs an ex-eD                ample, general-purpose DCL procedure is provided, HT_)                ROOT:[EXAMPLE]AUTHACE.COM.s  *             9.9 User Password Modification  K                The server provides for users to be able to change their ownuJ                HTA passwords (and SYSUAF if required). This functionality,F                though desirable from the administrator's viewpoint, isI                not mandatory if the administrator is content to field any L                password changes, forgotten passwords, etc. Keep in mind thatL                passwords, though not visible during entry, are passed to the3                server using clear-text form fields.d  K                Password modification is enabled by including a mapping rule :                to the internal change script. For example:  7                   map /http/-/change/* /http/-/change/*   M                Any database to be enabled for password modification must havesM                a writable authorization path associated with it. For example:a                     [GROUP]y-                   /httpd/-/change/group/* r+w   !                   [ANOTHER_GROUP]e5                   /httpd/-/change/another_group/* r+w   D                Use some form of cautionary wrapper if providing this                functionality:g      2             9-18  Authentication and Authorization    r            5                   <H2>Change Your Authentication</H2>t  !                   <BLOCKQUOTE><I> `                   Change the password used to identify yourself to the REALM Web environment for`                   some actions.  Note that this <U>not</U> an operating system password, nor hasU                   it anything to do with it.  Due to the inherent weaknesses of usingl^                   non-encrypted password transmissions on networks <FONT COLOR="#ff0000"><U>DO_                   NOT</U> use a password you have in use anywhere else, especially an operatingf`                   system password!</FONT> You need your current password to make the change.  Ifb                   you have forgotten what it is contact <A HREF="/web/webadmin.html">WebAdmin</A>,Q                   preferably via email, for the change to be made on your behalf.i#                   </I></BLOCKQUOTE>                      <UL>G                   <LI><A HREF="/httpd/-/change/REALM/">REALM</A> realm.a                   </UL>m                                                                    N                                         Authentication and Authorization  9-19 i  *                M             Chapter__10______________________________________________________c                Secure Sockets Layer    F                This section is not a tutorial on SSL. It contains onlyL                information relating to WASD's use of it. Refer to the listedG                references, Section 10.4, for further information on SSLe                technology.  M                Enhancing privacy with SSL, certificate management and varyingf?                browser behaviours is not for the faint-hearted!o  E                The Secure Sockets Layer protocol (SSL) is designed tosF                provide privacy between two communicating applications,G                in the case of HTTP between the browser (client) and the F                HTTPd (server). It provides other capabilities, such asH                client authentication, but these are not considered here.G                SSL operates by establishing an authenticated, encrypted J                communication path between the two applications, "wrapping"I                the entire application protocol, such as HTTP, in a secureeK                link, providing complete privacy for the entire transaction.tL                In this way security-related data such as user identificationM                and password, as well as sensitive transaction information candA                be effectively protected from unauthorized access.t  L                WASD implements SSL using a freely available software library3                known as "SSLeay", see Section 10.3.h  M                SSL functionality is not supplied with the basic WASD package.SJ                In part this is due to the relative bulk of this component,K                but also considers patent issues and USA export restrictionsdK                on some cryptographic technology that would impact the basiccK                package's potential for download out of the USA. For furthernF                comment on this aspect check the SSLeay FAQ section "IsJ                this legal?". No recommendations are made by this author onH                the use of the SSLeay package in any particular locality,L                except to comment that it is in commercial and non-commercialH                use in many applications across Europe, North America and                Australasia.l  H                The WASD SSL component is available as a separate, easilyM                integrated package, either with complete SSLeay source or justuJ                SSLeay object libraries, some SSLeay utility object modulesL                for building executables and WASD support files. Obtain these8                from the same source as the main package.    N                                                     Secure Sockets Layer  10-1    u                            SSL Overheadg  M                SSL adds a significant overhead to an HTTP transaction for thet!                following reasons.f  G                o  An initial connection establishment, where the client J                   and server exchange cryptographic data and authorize the                   transaction.  K                o  The transaction transfer, where all application data must G                   be processed by the CPU into an encrypted stream, andZ6                   back . . . very expensive processes.  K                o  The encrypted data contains more bytes than the raw data, 3                   increasing network transfer time.   I                o  Other miscellaneous SSL handshaking for the life of the/                   transaction.  G                For these reasons SSL HTTP is slower and has far greater E                impact on the server system CPU than standard HTTP andmH                therefore should only be used when transaction privacy isJ                required, not as a general HTTP service. Also, if a generalL                HTTP and an SSL HTTP service is provided on a multi-processorI                system, with one or other or both experiencing significantwG                traffic, then the two services should be run in separatei                processes.e  !                SSL Access Controlc  G                When authorization is in place (see Chapter 9) access to G                username/password controlled data/functionality benefits J                enormously from the privacy of an authorization environmentJ                inherently secured via the encrypted communications of SSL.K                SSL may be used as part of the site's access control policy,rL                as whole-of-site, see Authentication Policy, or on a per-pathC                basis, see Conditionals and Access Restriction List.t                  Interoperability   J                WASD SSL has been tested against the following browsers (if?                any others are tested please advise the result).                 &             10-2  Secure Sockets Layer o  e              M                ______________________________________________________________ M                Browser_______Version_______OK____Comment_____________________t  L                Netscape      v3.0          yes   accepts CA (both ".PEM" andJ                Navigator     (Digital            ".CRT"), initiates serverL                              Unix)               certificate dialog on firstA                                                  "https:" connects  L                Netscape      v3.02         yes   accepts CA (both ".PEM" andJ                Navigator     (WinNT)             ".CRT"), initiates serverL                                                  certificate dialog on firstA                                                  "https:" connectt  K                Netscape      v3.03 (VMS)   yes   accepts CA(both ".PEM" and J                Navigator                         ".CRT"), initiates serverL                                                  certificate dialog on firstA                                                  "https:" connect   L                Netscape      v4.03         yes   accepts CA (both ".PEM" andJ                Navigator     (WinNT)             ".CRT"), initiates serverL                                                  certificate dialog on firstA                                                  "https:" connectl  L                Netscape      v4.5 (WinNT)  yes   accepts CA (both ".PEM" andJ                Navigator                         ".CRT"), initiates serverL                                                  certificate dialog on firstA                                                  "https:" connectn  L                Netscape      v4.05         yes   accepts CA (both ".PEM" andJ                Navigator     (Digital            ".CRT"), initiates serverL                              Unix)               certificate dialog on firstA                                                  "https:" connecta  J                MS Internet   3.02 (WinNT)  no    accepts CA (".CRT" only),M                Explorer                          but then refuses to transactcJ                                                  SSL requests claiming theK                                                  site is not certified by a ?                                                  well-known CA!t  J                MS Internet   4.0 (WinNT)   yes   accepts CA (".CRT" only),M                Explorer                          initiates server certificatedI                                                  dialog on first "https:"t8                                                  connect            N                                                     Secure Sockets Layer  10-3 L  d          M                ______________________________________________________________ M                Browser_______Version_______OK____Comment_____________________e  M                Cryptozilla   08-APR-1998   yes   This in-development browser,eI                              (WinNT)             implements full-strengtheI                                                  encryption (USA domestictI                                                  grade), and demonstratesfI                                                  WASD SSL's full-strengthIM                                                  capability. In Cryptozilla'seF                                                  case the DES-CBC3-SHAH                                                  cipher, using a 168-bitM                __________________________________key,_was_negotiated.________l    "             10.1 SSL Configuration  ?                SSL installation creates the major directory HT_ J                ROOT:[SRC.SSLEAY-0_9_0b] containing at the least the SSLeayL                copyright notice, object libraries, object modules for build-L                ing executables, example certificates, and some other supportM                files and documentation. If a complete source package has beenw8                obtained the tree is considerably larger.  K                The example HTTPd startup procedure already contains support M                for the SSL executable. If this has been used as the basis for K                startup then only the respective boolean needs to be altered J                to use the SSL rather than the standard executable. The SSLF                executable supports both standard HTTP services (ports)I                and HTTPS services (ports). These must be configured usingyI                the [service] parameter. SSL services are distinguished byiL                specifying "https:" in the parameter. The default port for an"                SSL service is 443.  K                The following example illustrates creating two standard HTTPtJ                services, one on the default port 80, another on port 8000,K                and two SSL services, the first on the default port 443, the #                second on port 8443.a                     [Service]n0                   alpha.wasd.dsto.defence.gov.au5                   alpha.wasd.dsto.defence.gov.au:8000a8                   https://alpha.wasd.dsto.defence.gov.au=                   https://alpha.wasd.dsto.defence.gov.au:8443j  H                The "/SSL" qualifier controls which version(s) of the SSLG                protocol the server will support; "2", "3" or "23" (i.e.oI                versions 2 and 3, also the default). Using /NOSSL disables :                the SSL functionality of an SSL executable.      &             10-4  Secure Sockets Layer t  n            M                The one further requirement of an SSL server is a certificate. J                By default this is located using the HTTPD$SSL_CERT logicalM                name during startup, however if required, each SSL service can M                have an individual certificate configured against it using the ,                syntax shown in this example.                     [Service] Q                   https://alpha.wasd.dsto.defence.gov.au;ht_root:[local]alpha.pem O                   https://beta.wasd.dsto.defence.gov.au;ht_root:[local]beta.pemEQ                   https://gamma.wasd.dsto.defence.gov.au;ht_root:[local]gamma.pemt                  SSL Quick-Start  J                If the basic WASD v5.n package is installed, configured andI                performing satisfactorily the following steps give a quick *                outline for support of SSL.  J                1. UNZIP the WASD SSL package. The ZIP archive will containL                   brief installation instructions. Use the following commandB                   to read this and any other information provided.  7                      $ UNZIP -z device:[dir]archive.ZIP   M                2. Once UNZIPped it will be necessary to link the executables. ?                   This should be performed using the UPDATE.COMp  L                   It assumes a vanilla setup, using the standard directoriesI                   and account environment described in this document. All M                   sections prompt before performing any action and default to M                   "no". The SSL parameter indicates the SSL components should                    be processed.   3                      $ SET DEFAULT HT_ROOT:[000000] "                      $ @UPDATE SSL  F                3. Once linked the UPDATE.COM procedure will prompt forJ                   permission to execute the demonstration/check procedure.  K                   It is also possible to check the SSL package at any otherTG                   time using the FREEWARE_DEMO.COM procedure. It shouldNG                   detect the TCP/IP agent in use (if not specify UCX or I                   NETLIB as a parameter). It is necessary to specify that G                   it is to use the SSL executable. Follow the displayed                    instructions.   9                      $ @HT_ROOT:[000000]FREEWARE_DEMO SSLa  3                4. Modify server startup procedures.t  9                   o  Using pre-existing, non-v5.n Startup   I                     1. Modify the server startup procedure to INSTALL and K                        the HTTPD80.COM procedure (or equivalent) to use theiK                        HTTPD_SSL.EXE executable (or HTTPD_SSL_NETLIB.EXE asI#                        appropriate)   N                                                     Secure Sockets Layer  10-5    e            D                     2. Modify the server startup procedure to defineD                        a logical HTTPD$SSL_CERT locating the exampleM                        certificate at HT_ROOT:[EXAMPLE]HTTPD.PEM, for exampleT  P                            DEFINE /SYS HTTPD$SSL_CERT HT_ROOT:[EXAMPLE]HTTPD.PEM  '                   o  Using v5.n Startup   G                      Modify the "PROVIDE_SSL" symbol to be 1 (or true).   J                5. Modify the HTTPD$CONFIG configuration file to specify anG                   SSL service. For example the following creates both awI                   standard HTTP service on the default port 80 and an SSLt1                   service on the default port 443s                        [Service].                      alpha.dsto.defence.gov.au6                      https://alpha.dsto.defence.gov.au  ?                6. Shutdown the server completely, then restart.h  J                7. To check the functionality (on default ports) access the                   server via  "                   o  Standard HTTP  +                         http://host.domain/                      o  SSL HTTPt  ,                         https://host.domain/  M                8. Once the server has been proved functional with the exampleoF                   certificate it is recommended that a server-specificM                   certificate be created using the CA.COM procedure described I                   in Section 10.2. This may then be used by placing it in J                   the appropriate local directory, changing the HTTPD$SSL_K                   CERT logical definition in the startup and restarting theg                   server.u  '             10.2 Certificate Management   G                This section is not a tutorial on certificates and their H                management. Refer to the listed references, Section 10.4,6                for further information on this aspect.  I                Certificates associate a public cryptographic key with thewH                identity of the certificate holder, usually an individualK                or server. It includes a distinguishing name, identificationsI                and signature of the certificate authority (CA, the issuer J                and guarantor of the certificate), and the period for whichH                the certificate is valid, possibly with other, additional                information.   &             10-6  Secure Sockets Layer H  =            J                The two types of certifcates of interest here should not be                confused.  K                1. CA -  The Certificate Authority identifies the authority, D                   or organization, that issues a server certificate.  K                2. Server -  Identifies a particular end-service. It's value I                   as an guarantee of identity is founded in the authorityaL                   of the organization that issues the certificate. It is theA                   certificate specified to the server at startup.L  E                The server uses a server certificate to establish it'snD                identity during the initial phase of the SSL protocolI                exchange. Each server should have a unique certificate. AnaI                example certificate is provided with the WASD SSL package.yL                This is the default used by the example startup procedure andI                will suffice to demonstrate the server's functionality. IfeK                a "live" SSL site is required a unique certificate issued bycJ                a third-party Certificate Authority is desirable. A workingM                alternative to obtaining one of these certificates is providedbG                by the HT_ROOT:[SRC.SSLEAY-0_9_0b.WASD]CA.COM procedure, F                which allows the user to act as a certificate authorityI                (CA) and issue identifying certificates. Because the CA iscI                non-authoritative (not a well-known CA) these certificates G                have little value except to allow SSL transactions to beh1                established with trusting clients.s  L                This procedure allows CA as well as server certificates to beM                issued, as well as providing foreign command symbols for other K                certificate management utilities. For usage requirements andiI                parameters check the commentary in the procedure preamble.e  I                CA certificates can be loaded into browsers to allow sites K                using that CA to be accessed by that browser without further L                dialog. Both Netscape Navigator (v3.n & v4.n) and MS InternetI                Explorer (v4.n) automatically invokes a server certificateuF                load dialog when it encounters a site using a valid but*                unknown server certificate.  J                A manual load is accomplished by requesting the certificateF                in a format appropriate to the particular browser. ThisK                triggers a browser dialog with the user to confirm or refuse K                the loading of that certificate into the browser Certificate "                Authority database.  J                To facilitate loading CA certificates into a browser ensureE                the following entries are contained in the HTTP$CONFIGa"                configuration file:    N                                                     Secure Sockets Layer  10-7 l                                  [AddIcon]nH                   /httpd/-/binary.gif  [BIN]  application/x-x509-ca-cert                     [AddType] L                   .CRT  application/x-x509-ca-cert  -  DER certifcate (MSIE)X                   .PEM  application/x-x509-ca-cert  -  Privacy Enhanced Mail certificate  L                The following would load the WASD testing CA certificate in a"                format suitable for  )                o  Navigator (v3.n, v4.n):   ?                      /ht_root/src/ssleay-0_9_0b/wasd/cacert.pem   .                o  MS Internet Explorer (v4.n):  ?                      /ht_root/src/ssleay-0_9_0b/wasd/cacert.crt   H                Navigator should be able to load using either certificateC                format. MSIE v3.n will load and report on the ".CRT"rE                certificate quite contentedly, but then will not allownG                it to be used because it does not represent a well-known K                Certficate Authority. MSIE v4.n seems able to use the ".CRT"                 certificate.L  +                Changing Server Certificates   H                If a site's server (or CA certificate) is changed and theM                server restarted any executing browsers will probably complainiK                (Netscape Navigator reports an I/O error). In this case opennJ                the browser's certificate database and delete any relevant,K                permanently stored certificate entry, then close and restartcF                the browser. The next access should initiate the serverJ                certificate dialog, or the CA certificate may be explicitly                reloaded.               10.3 SSLeay   L                WASD implements SSL using a freely available software libraryL                known as "SSLeay" (pronounced "S-S-L-E-A-Y", i.e. all lettersK                spelt), authored and copyright by Eric Young and Tim Hudson.LL                It is not a GNU-licensed package, but does makes unrestrictedG                commercial and non-commercial use available. The FAQ for %                SSLeay may be found att  3                http://www.psy.uq.oz.au/~ftp/Crypto/   F                This should be consulted for all information on the SSL+                technology employed by WASD.d  K                If the SSLeay component of WASD is installed it can be found                 at   *                HT_ROOT:[SRC.SSLEAY-0_9_0b]  &             10-8  Secure Sockets Layer    o            H                The previous version of SSLeay, 0.8.1, provided with WASDI                v5.0.0, can also be linked and will work with WASD v5.1 togL                5.3. It is preferable to move to SSLeay v0.9.0b as known bugsL                in the previous version have been fixed in this one (ignoringG                the issue of new bugs being introduced ;^). If v0.8.1 is ,                installed it will be found at  )                HT_ROOT:[SRC.SSLEAY-0_8_1]   G                It has been necessary to make minor modifications to the H                0.9.0b distribution to support VMS (there was rudimentaryC                support that looked like a hang-over from a previous(J                distribution). These changes are very minor and designed toL                address the differences in VMS and DECC versions. All changesI                to source can be found by searching for "MGD" in [...]*.C, -                [...]*.H and [...]*.COM files.   F                These changes have been made only to support WASD's useF                of the package, they are not proposed as general SSLeay>                modifications, i.e. they were purely pragmatic!  J                Our thanks to the authors of and contributors to the SSLeayM                package, although if there is a documentation boffin out there 4                please contact eric@CryptSoft.com :^)               10.4 SSL References   G                The following provide a starting-point for investigating D                SSL and SSLeay further (verified available at time of                publication).  >                o  http://www.netscape.com/newsref/std/SSL.htmlC                   Netscape Communication Corporation's SSL Overview   6                o  http://www.psy.uq.oz.au/~ftp/Crypto/                   SSLeay FAQ.   I                o  http://www.camb.opengroup.org/www/prism/wwwj/index.htmln0                   A good introduction to SSLeay.  E                o  http://www.camb.opengroup.org/~fjh/Papers/cook/ssl_                    cook.html F                   An excellent overview of managing certification with                   SSLeay.i  E                o  http://www.consensus.com/security/ssl-talk-faq.htmlA.                   SSL-Talk discussion list FAQ      N                                                     Secure Sockets Layer  10-9 t  s                M             Chapter__11______________________________________________________   !             Server Administration     H                All server configuration files, with the execption of theK                authentication databases, are plain text and may be modified_J                with any prefered editor. However the majority of these can>                also be administered on-line through a browser.  K                A menu of server administration functions is provided by the                 server.  &                <online hypertext link>  K                In addition a Web Update facility allows some administrationtB                of file system portions of the Web. See Chapter 16.  K                If authorization is in use (see Chapter 9) it is recommendednK                that the path to these reports be controlled via authentica-iL                tion and authorization, using both host and username restric-/                tions, similar to the following:   "                   [WHATEVER-REALM]L                   /httpd/-/admin/*  host.ip.addr,~WebMaster,~WhoEverElse,r+w  F                If a full authorization environment is not required butJ                administration via browser is still desired restrict accessJ                to browsers executing on the server system itself, using anL                appropriate SYSUAF-authenticated username. Provision of a VMSL                account for server administration only is quite feasable, see                Section 9.7.2.                      [VMS]e<                   /httpd/-/admin/*  #localhost,~username,r+w  L                If SSL is in use (see Chapter 10) then username/password pri-K                vacy is inherently secured via the encrypted communications.tI                To restrict server administration functions to this secureaK                environment add the following to the HTTPD$MAP configurations                file:  E                   /httpd/-/admin/*  "403 Access denied."  ![sc:https]c  J                When using the revise capability of the administration menuF                it is necessary to comply with all the requirements forI                Web update of files. This is discussed in general terms inTJ                Chapter 16. Revision of server configuration files requiresI                path permissions allowing write access for the username(s) K                doing the administration, as well as the required ACL on the K                target directory (in the following example HT_ROOT:[LOCAL]).h  N                                                    Server Administration  11-1                                    [VMS]e<                   /httpd/-/admin/*  #localhost,~username,r+w<                   /ht_root/local/*  #localhost,~username,r+w  K                It is possible to allow general access to the administration"H                menu and reports while restricting the ability to intiateF                server actions such as a restart! Using the WORLD realmF                against the path is necessary, for the obvious securityM                reason, the server administration module will not allow itselfiJ                to be used without an authenticated username, provided as a,                pseudo-authenticated "WORLD".                     [VMS] D                   /httpd/-/admin/control/*  #localhost,~username,r+w                   [WORLD] $                   /httpd/-/admin/* r  +             11.1 Breaking-in To The Server!   K                The server's authentication/authorization environment can be J                circumvented under special circumstances. Note that this isM                not possible without administrator action and persists only astF                long as the administrator actually performs the action!  J                This provision exists for only four foreseeable situations:  -                1. ad hoc server configuration   I                2. initial configuration of the authentication environmenta  6                3. loss of the administrator's password  8                4. demonstration/experimentation purposes                  Methoda  E                If performing the initial authentication configurationi  B                make_sure_the_HT_AUTH_logical_is_correctly_defined.  L                Manually start a new instance of the server on a non-standardM                port using the /PROMISCUOUS qualifier. This can be done at thetC                command line. There is now a security hole. Example:e  /                   $ HTTPD = "$HT_EXE:HTTPD.EXE"sG                   $ SPAWN /WAIT HTTPD /NOLOG /SERVICE=8088 /PROMISCUOUSn  M                This server with then allow access using any username/passwordpJ                combination. Even if not completely paranoid it's perhaps aL                good idea to append a specific password to the qualifier, the:                server will then only authenticate to that.  T                   $ SPAWN /WAIT HTTPD /NOLOG /SERVICE=8088 /PROMISCUOUS=VERYCAUTIOUS  '             11-2  Server Administration     i            L                Access this instance of the server with a browser and use the*                server administration menu.    1                   http://host:port/httpd/-/admin/s  K                It is now possible to review server-generated reports, checkpG                rule mappings, create databases, enter username details,OL                change the administrator's password to something known, etc.,M                etc. Shutdown that server again (ctrl-Y) and the security hole                 disappears.  F                Note that if a site authorization rule already maps theF                administration menu path or configuration file path theJ                server may report duplicate path errors. This is due to theI                /PROMISCUOUS startup effectively introducing the followingcJ                two rules, ensuring the menu and configuration files can beM                accessed regardless of anything already in or missing from the "                authorization file.                     [PROMISCUOUS]A<                   # access to the server administration menu&                   /httpd/-/admin/* r+wU                   # access to write into the "usual" location for configuration filesh&                   /ht_root/local/* r+w  L                Other rules may be placed in the local configuration file forL                the [PROMISCUOUS] realm specifically for use during this modeM                of access. They will not apply during normal server operation. F                Be sure they are placed before other rules in the file.  %             11.2 HTTPd Server Reportse  L                The server provides a number of internally generated reports.  F                It is possible to use this facility standalone, without;                configuring authorization, see Section 11.1.                11.2.1 Statistics   M                Server process up-time, CPU-time and other resources consumed, J                number of connections processed, number of requests of eachL                HTTP method, type of processing involved (HTTPd module used),.                number of bytes processed, etc.                11.2.2 Configuration  L                A tabular summary of the server's current configuration. ThisJ                is a convenient method for viewing the information from the!                HTTPD$CONFIG file.a  N                                                    Server Administration  11-3 e  a                         11.2.3 Message  I                A tabular report of the server's current message database,i?                multiple languages shown if configured that way.                11.2.4 Mapping  I                All loaded mapping rules. A selector allows rules applyinghE                only to one particular virtual server to be displayed.h  %             11.2.5 Path Authorization   K                If authorization is in use (see Chapter 9) this report listsiJ                the paths with associated authorization and access control.  &             11.2.6 User Authentication  L                List any users that have been authorized since the server wasL                last started, the realm authorized from, the group it appliesI                to (if any), and what the user's capabilities are (allowed=J                HTTP methods). A time-stamp and counters provide additional                information.c               11.2.7 Cache  L                Allows monitoring of cache behaviour and performance, as wellK                as the files currently in the cache. For further informationr                see Chapter 14.                11.2.8 DCL Scripting  H                Provides some DCL, CGI and CGIplus scripting information.  I                o  DCL module statistics (same information as displayed in M                   the server statistics report). These are cumulative for thee<                   entire life of the system (unless zeroed).  K                o  Subprocess information shows how many actual subprocesses.J                   exist at the time of the report, as indicated by the PIDF                   and bolded, non-zero liftime (in minutes). The soft-I                   limit specifies how many CGIplus scripts are allowed tolH                   continue existing before the least used is deleted andH                   the hard-limit show how many subprocesses may actuallyI                   exist at any one time (the margin allows for subprocess J                   deletion latency). A count of how many times the CGIplusL                   subprocesses have been explicitly purged (button availableI                   on this report page). The life-time of zombie processes(H                   (in minutes, zero implying use of zombies is disabled)E                   and the number that have been purged due to expiry. I                   CGIplus subprocess life-time (in minutes, zero implying H                   indefinite), the number purged due to life-time expiryL                   and the number of CGIplus subprocesses that the server has  '             11-4  Server Administratione                 M                   actually purged (deleted) to maintain the soft-limit marginr"                   specified above.  M                o  Each of the allocated subprocess data structures is listed.sF                   There may be zero up to hard-limit items listed hereH                   depending on demand for DCL activities and the life ofG                   the server. Items with a PID shown indicate an actualiI                   subprocess existing. This can be a zombie subprocess or J                   a CGIplus subprocess. If no subprocess is indicated thenJ                   the other information represents the state the last timeI                   the item's associated subprocess completed. Information L                   includes the script (URL-style path) or DCL command, totalL                   count of times the item has been used and the last time itM                   was. The zombie count indicates the number of time the sametM                   subprocess finished a request and entered the zombie state. M                   The CGIplus column indicates it is/was a CGIplus script and L                   shows the total number of times that particular script hasJ                   been/was used. If the subprocess is currently in use the?                   client information show the client host name.   L                o  If any subprocesses are associated with any data structureI                   a purge button is provided that forces all subprocessesiL                   to be deleted. This can be useful if a new script image isJ                   compiled and it is required all scripts now use this. IfK                   a script is currently processing a request the subprocesseM                   deletion occurs when that processing is complete. The purgetK                   button does not force a subprocess to delete, so a secondeL                   button forces all subprocesses to delete immediately. ThisM                   can be used to forceably clear errant scripts, etc., but beuE                   warned script processing is indiscrimately stopped!t  #             11.2.9 DECnet Scripting   J                DECnet module information shows totals for DECnet scripting4                usage and the DECnet connection list.  E                This list will grow, up to the specified configurationgK                maximum, as conconurrent scripting demand occurs. MaintainedbI                connections are indicated by the bolded, non-zero lifetimetM                (in minutes). When this reaches zero the task is disconnected.yL                The current/last task for that connection is indicated, alongM                with the number of times the connection was reused and a totalv1                number of uses for that list item.r  M                Purge and force buttons allow current links to be broken after ;                request completion or forcibly disconnected.         N                                                    Server Administration  11-5 e                            11.2.10 Memory  K                Provides a report and does an integrity check on each of theaD                Virtual Memory (VM) zones employed by the WASD HTTPd.               11.2.11 RequestA  E                Lists current requests (always shows at least your ownwE                connection accessing this report :^) and if enabled by H                configuration a history list of the most recent requests.G                Enabled by the configuration parameter [RequestHistory].b               11.2.12 SSL   L                The SSL report lists counts of the number of SSL transactionsK                initiated and completed, along with session cache statistics0I                for the currently connected SSL service. It also lists thelA                ciphers available and current session information.o               11.2.13 Activity  I                Provide a graphical snapshot of server activity of a giveni                period.  K                This is dynamic data, held in memory only, and so is currentiH                only from the latest server startup. It is enabled by theI                configuration parameter [ActivityDays]. The administration M                menu provides several, represented as a period of hours before I                the present time. Number of requests and bytes sent to therJ                client are represented by a histogram with respective meansH                for each during the period by a line graph. A greyed areaI                indicates no data available for that time (i.e. before the[8                latest server startup, or in the future).  G                Activity data is accumulated on a per-minute basis. ThisgE                is the maximum granularity of any report. When reportssF                are selected that can display less than this one minuteJ                granularity (i.e. with periods greater than four hours) theK                value shown is the peak of the number of minutes sampled forrJ                display. This better represents the load on the server than-                would a mean of those samples.t  J                For browsers recognised as capable (with v4.3 of the serverH                these are Netscape Navigator 3.0ff and Microsoft InternetL                Explorer 3.02ff) this report is JavaScript-enabled, and if inL                focus the browser refreshes itself at an interval appropriateF                to the reporting period. If not in focus, the report isL                automatically refreshed when the browser is brought back into                focus.o  '             11-6  Server Administration/ k  l            H                The graph is an image map, various regions of which allowG                the selection of other reports with different periods or/H                durations. This allows previous periods to be examined atG                various levels of detail using the graph for navigation. I                Various sections may have no mapping as appropriate to thee                current report.  M                The following example shows the layout for a four hour report. H                The upper and lower sections have distinct functions. TheG                middle 50% of the upper section allows the same end time I                (most commonly the current hour) to be examined over twice M                the current period, in this case it would be over eight hours.nL                The left 25% allows the previous fours hours to be viewed (ifK                such data exists), and for non-current reports the right 25%WJ                allows the next four hours to be viewed. The lower half canL                be divided into sections representing hours or days dependingK                on the period of the current report. This allows that periodsK                to be viewed in greater detail. For single hour reports thiso1                section, of course, is not mapped.   L                Remember that the URL of the mapped section will be displayedI                in the status bar of the browser. As the URL contains time H                components it is not a difficult task to decipher the URLI                displayed to see the exact time and period being selected.   C                   +-----------+-----------------------+-----------+ C                   | previous  |     same end time     | next      |oC                   | 4 hours   |   double the period   | 4 hours   |qC                   |           |                       |           | C                   |           |                       |           |wC                   +-----------+-----------+-----------+-----------+sC                   | hour 1    | hour 2    | hour 3    | hour 4    |eC                   | period: 1 | period: 1 | period: 1 | period: 1 |fC                   |           |           |           |           |gC                   |           |           |           |           | C                   +-----------+-----------+-----------+-----------+                11.2.14 WATCHc  M             This report provides an online, real-time, in-browser-window viewtK             of request processing on the running server. See Chapter 12 fors             details.                N                                                    Server Administration  11-7    m            $             11.3 HTTPd Server Revise  M                The server provides a limited configuration revision facility.   E                1. Configuration -  A form-driven interface allows thehG                   current configuration of the server to be altered on-iK                   line. This configuration may then be saved to the on-disktK                   file and then the server could be restarted using the newlI                   parameters. The source of the current configuration cancL                   be either the server itself (from it's volatile, in-memoryH                   parameters) or from the on-disk configuration file. InI                   addition it is possible to directly edit and update the                    on-disk file.r  L                2. Message -  No form-driven interface is currently availableF                   for changing the messages. However it is possible toG                   directly edit and update the on-disk file. The server I                   can then be restarted to use the modified database (see                     Section 11.4).  L                3. Mapping -  No form-driven interface is currently availableH                   for changing the mapping rules. However it is possibleK                   to directly edit and update the on-disk file. The mapping K                   rules could then be reloaded, changing the current server +                   rules (see Section 11.4).s  M                4. Path Authorization -  No form-driven interface is currentlytJ                   available for changing the path authorization configura-J                   tion. However it is possible to directly edit and updateK                   the on-disk file. The path authorization directives could/L                   the be reloaded, changing the current server authorization%                   (see Section 11.4).r  H                5. User Authentication -  User authentication comprises aM                   number of dialogues that allow the authentication databasesd4                   to be administered. These include:  '                   o  creating databasesc  '                   o  deleting databasesE  D                   o  accessing databases for administering usernames  7                   o  listing usernames within databasesU  %                   o  adding usernamesn  '                   o  deleting usernames   B                   o  modifying username permissions and other data  K                   o  reseting in-server (cached) authentication informationt  A                   Chapter Chapter 9 covers authentication detail.   '             11-8  Server AdministrationE C  0            $             11.4 HTTPd Server Action  J                The server allows certain run-time actions to be initiated.M                Many of these functions can also be initiated from the commandn%                line, see Section 5.3.s                  Control Section  J                1. Server Restart/restartNOW/Exit/exitNOW -  Caution ... noG                   confirmation! The difference between restart/exit and H                   restartNOW/exitNOW is the former waits for any currentD                   requests to be completed, while the latter does itD                   immediately regardless of any current connections.  G                2. Logging On/Off/Flush -  The HTTPD$LOG logical must betF                   configured to allow access logging to be enabled and*                   disabled from this menu.  M                3. Caching On/Off/Purge -  Caching may be enabled and disabled G                   in an ad hoc fashion using these controls. When being M                   disabled after being enabled all previous data is retained. M                   If subsequently reenabled that data is then again available K                   for use. This allows convenient assessment of the subject*F                   or even object benefits on the cahing. If purged all3                   entries in the cache are removed.l  +                Configuration Action Sectionc  J                1. Statistics Zeroed -  All counters are zeroed (except the2                   number-of-times-zeroed counter!)  M                2. Mapping Rules Reload -  Reloads the path mapping rules from ;                   the on-disk file into the running server.   L                   Caution!  If changing CGIplus script mapping it is advisedI                   to restart the server rather than reload. Some conflicteI                   is possible when using new rules while existing CGIplusn(                   scripts are executing.  M                3. Path Authorization Reload -  Reloads the path authorizationeK                   directives from the on-disk file into the running server.s  K                4. User Authentication Cache Purge -  For efficiency reasonslL                   authenticated user information is cached for a limited pe-M                   riod within the running server. All this cached informationiJ                   may be completely purged using this action, forcing sub-I                   sequent requests to be reauthenticated from the on-disk                    database.S    N                                                    Server Administration  11-9                     M             Chapter__12______________________________________________________                WATCH Facility    J                The WATCH facility is a powerful adjunct in server adminis-K                tration. From the administration menu it provides an online,eM                real-time, in-browser-window view of request processing in the M                running server. The ability to observe live request processing K                on an ad hoc basis, without changing server configuration or1J                shutting-down/restarting the server process, makes this fa-K                cility a great configuration and problem resolution tool. Ite*                allows (amongst other uses)  -                o  assessment of mapping rulese  3                o  assessment of authorization rulesa  >                o  investigation of request processing problems  9                o  general observation of server behaviour   F                A single client per server process can access the WATCHJ                facility at any one time. The report can be generated for aL                user-specified number of seconds or aborted at any time using)                the browser's stop button.   !             12.1 Event Categoriesm  I                An event is considered any significant point for which thetI                server code has a reporting call provided. These have beeneK                selected to provide maximum information with minimum clutter E                and impact on server performance. Obvious examples are,J                connection acceptance and closure, request path resolution,M                error report generation, network reads and writes, etc. EventssM                are collected together into groupings to allow clearly defineddI                areas of interest to be selected for reporting. The report H                menu provides for the inclusion of any combination of the$                following categories.  E                o  Connection -  Each TCP/IP connection acceptance andoI                   closure. The connect shows which service the request ist5                   using (scheme, host name and port).   F                o  Request Processing -  Each major step in a request'sK                   progress. For example, path resolution and final response                    status.s  N                                                           WATCH Facility  12-1 g  d            G                o  Request Header -  Provides the HTTP request header as H                   a section of blank-line terminated text. If an "Autho-H                   rization:" line is included any non-encrypted password(                   information is masked.  M                o  Request Body -  In the case of HTTP POST or PUT methods anytM                   request body is displayed. It will generally be URL-encoded +                   but otherwise plain-text.c  H                o  Response Processing -  Each major step in generating aM                   response to the request. These generally reflect calls to amM                   major server module such as file CACHE, FILE access, INDEX- J                   OF, SSI processing, etc. One or more of these events mayJ                   occur for each request. For instance a directory listingL                   will show an INDEX-OF call and then usually a FILE call as/                   any read-me file is accessed.t  M                o  Response Header -  The blank-line terminated HTTP header tonK                   the response. Only server-generated headers are included.eI                   Scripts that provide a full HTTP stream do not have theoH                   header explicitly reported. The response body categoryI                   must be enabled to observe these (indicated by a STREAMw                   notation).  F                o  Response Body -  The content of the response. If theG                   content-type is anything other than text the reported G                   contents and format may be indeterminate, or at leastcJ                   determined by the way the particular browser renders anyG                   non-printable bytes. Some requests also generate very K                   large responses which will clutter output. Generally thisaL                   category would be used when investigating specific request)                   response body problems.   L                o  Path Mapping -  This, along with the authorization report,F                   provides one of the most useful aspects of the WATCHJ                   facility. It comprises an event line indicating the pathI                   to be mapped (it can also show a VMS file specification H                   if a reverse-mapping has been requested). Then as eachI                   rule is processed a summary showing current path, matchiJ                   "Y"/"N" for each path template and any conditional, thenJ                   the result and conditional. Finally an event entry showsH                   the resulting path, VMS file specification, any scriptL                   name and specification resolved. The path mapping categoryJ                   allows the administrator to directly assess mapping rule<                   processing with live or generated traffic.  F                o  Authorization -  When authorization is deployed thisM                   category shows the rules examined to determine if a path isbM                   controlled, any authentication events in assessing username J                   and password, and the consequent group, user and requestM                   capabilities (read and/or write) for that path. No passworde+                   information is displayed.h                12-2  WATCH Facility    )            K                o  Error -  The essential elements of a request error reportsH                   are displayed. This may include a VMS status value and,                   associated system message.  H                o  Network -  For each raw network read and write the VMS>                   status code and size of the I/O is recorded.  K                o  Timer -  Timers control the maximum periods each stage inoI                   request processing may procede before the server abortstE                   processing. Input, output and keep-alive timers aret                   reported.a  J                o  Log -  Access logging events include log open, close and4                   flush, as well as request entries.  I                o  SSL -  If the Secure Sockets Layer image is in use thispH                   category provides a indication of high-level activity.  J                o  CGI -  This category displays the generated CGI variableK                   names and values as used by subprocess and DECnet script-r,                   ing, and by SSI documents.  K                o  DCL -  Debugging scripts can sometimes present particulareI                   difficulties. This category may help. It reports on all F                   input/output streams with the subprocess (SYS$INPUT,6                   SYS$OUTPUT, SYS$COMMAND, CGIPLUSIN).  F                o  DECnet -  For the same reason as above this categoryI                   reports all DECnet scripting input/output of the DECnetiK                   link. In particular, it allows the observation of the OSUn%                   scripting protocol.   "             12.2 Request Filtering  H                By default all requests to all services are WATCHed. FineG                control may be exercised over exactly which requests are I                reported, allowing only a selected portion of all requestsrH                being processed to be concentrated on, even on a live andL                busy server. This is done by filtering requests according the"                following criteria.  H                o  Client -  The originating host name or address. UnlessI                   server DNS host name resolution is enabled this must beb7                   expressed in dotted-decimal notation.   H                o  Service -  The service connected to. This includes theJ                   scheme of the service (i.e. "http:", "https:"), the hostH                   name (real or virtual), and the port. The host name isL                   the official name of the service as reported during serverH                   startup. As the port number is a essential part of theM                   service specification it must always be explicitly supplied                     or wildcarded.  N                                                           WATCH Facility  12-3 n  s            +                o  Path -  The request path.   D                These filters are controlled using fully-specified orH                wildcarded strings. Requests that do not match the filterF                are not reported. In the case of originating client andG                destination service, requests are eliminated before evereM                appearing in the report. Path filtering is slightly different,tG                requiring some request processing before the path can bebH                determined. Depending on the categories selected this mayL                result in some events begin displayed. It will be eliminated,M                with an accompanying explanatory message, as soon the path hasa                been determined.h  J                The following examples are grouped in the same order as theA                categories listed above; client, service and path.   0                   alpha.wasd.dsto.defence.gov.au$                   *.wasd.dsto.gov.au!                   131.185.250.202                    131.185.250.*h  4                   beta.wasd.dsto.defence.gov.au:80001                   beta.wasd.dsto.defence.gov.au:*U                   http://*                   https:*p                   *:80                      /ht_root/src/*                   /cgi-bin/*#                   /web/*/cyrillic/*                12.3 Report Format  H                The following example illustrates the format of the WATCHG                report. It begins with a six-line heading. The first two C                record the date, time and official server name, with I                underline. The third provides the WASD server version. The F                fourth and fifth provide a list of the categories beingE                recorded and the filters in use. The sixth, the column -                headings described as follows:   -                o  time the event was recorded   @                o  the module name of the originating source code  -                o  the line in the code module   D                o  a unique item number for each thread being WATCHED  %                o  event category namep  C                o  free-form, but generally interpretable event datal                12-4  WATCH Facility                 E                Note that some items also include a block of data. The J                request header category does this, providing the blank-lineG                terminated text comprising the HTTP header. Rule mappingAJ                also provides a block of information representing each ruleJ                as it is interpreted. Generally WATCH-generated informationJ                can be distinguished from other data by it's uniform formatJ                and delimiting vertical bars. Initiative and imagination isM                sometimes required to interpret the free-form data but a basicsJ                understanding of HTTP serving and a little consideration isM                generally all that is required to deduce the essentials of anyd                report.  W                   14-NOV-1998 20:47:41  WATCH REPORT  gamma.wasd.dsto.defence.gov.au:80fW                   ---------------------------------------------------------------------sB                   |HTTPd-WASD/5.3.0 OpenVMS/AXP Digital-TCPIP SSL|h                   |Watching: connect, request, request header, mapping, response, response header (219)|6                   |Client: "*" Service: "*" Path: "*"|D                   |Time_______|Module__|Line|Item|Category|Event...|                   |20:47:43.46 NET      1035 0001 CONNECT  ACCEPT 131.185.250.202,30214 http://gamma.wasd.dsto.defence.gov.au:80| L                   |20:47:43.46 REQUEST  1171 0001 REQUEST  HEADER 354 bytes|(                   GET /ht_root/ HTTP/1.0Q                   If-Modified-Since: Tuesday, 03-Nov-98 18:51:51 GMT; length=9904 A                   Referer: http://gamma.wasd.dsto.defence.gov.au/r(                   Connection: Keep-Alived                   User-Agent: Mozilla/3.03Gold (X11; I; OpenVMS V7.1-1H1 AlphaServer 4100 5/400 4MB)"                   Pragma: no-cache6                   Host: gamma.wasd.dsto.defence.gov.auR                   Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, */*                                            N                                                           WATCH Facility  12-5    o            I                   |20:47:43.46 REQUEST  2144 0001 REQUEST  GET /ht_root/| J                   |20:47:43.46 MAPURL   0298 0001 MAPPING  PATH /ht_root/|]                   /ht_root/  ..  REDIRECT  /web/nt02/*  http://nt02.wasd.dsto.defence.gov.au/ g                   /ht_root/  YN  PASS      /*  403 Access denied.  ![HO:131.185.250.* HO:131.185.247.*]dR                   /ht_root/  N.  service   [[gamma.wasd.dsto.defence.gov.au:8088]]0                   /ht_root/  Y.  service   [[*]]9                   /ht_root/  ..  SET       /web/*   stmLF =                   /ht_root/  ..  SET       /ht_root/*   stmLF I                   /ht_root/  ..  SET       /ht_root/src/*   NOcache stmLFrN                   /ht_root/  ..  MAP       /httpd-internal-icons/*  /httpd/-/*Q                   /ht_root/  ..  PASS      /ht_root/runtime/*  /ht_root/runtime/* G                   /ht_root/  ..  PASS      /*/-/*  /ht_root/runtime/*/*O5                   /ht_root/  Y-  PASS      /ht_root/*fa                   |20:47:43.46 MAPURL   0321 0001 MAPPING  RESULT /ht_root/ HT_ROOT:[000000] - -|m[                   |20:47:43.46 CACHE    0595 0001 RESPONSE CACHE HT_ROOT:[000000]HOME.HTML|tL                   |20:47:43.46 NET      1963 0001 RESPONSE HEADER 267 bytes|&                   HTTP/1.0 200 SuccessH                   Server: HTTPd-WASD/5.3.0 OpenVMS/AXP Digital-TCPIP SSL5                   Date: Sat, 14 Nov 1998 10:17:43 GMTf>                   Last-Modified: Wed, 04 Nov 1998 04:21:51 GMT=                   Content-Type: text/html; charset=ISO-8859-1c&                   Content-Length: 9904(                   Connection: Keep-Alive                   Keep-Alive:e  \                   |20:47:43.46 REQUEST  0450 0001 REQUEST  STATUS 200 rx:354 tx:10171 bytes|\                   |20:47:43.46 REQUEST  0252 0001 CONNECT  KEEP-ALIVE 131.185.250.202,30214|W                   |20:47:48.66 NET      1502 0001 CONNECT  CLOSE 131.185.250.202,30214|a  "             12.4 Usage Suggestions  J                The following provides a brief explanation on the way WATCH3                operates and any usage implications.i  H                A single client may be connected to the WATCH facility atI                any given time. When connecting the client is sent an HTTPnF                response header and the WATCH report heading lines. TheF                request then remains connected until the WATCH durationJ                expires or the client overtly aborts the connection. DuringJ                this period the browser behaves as if receiving a sometimesH                very slow, sometimes stalled, plain-text document. As theK                server processes WATCHable events the text generated is sent -                to the WATCH-connected client.u  J                If the connection is aborted by the user some browsers willG                consider document retrieval to be incomplete and attempt I                to reconnect to the service if an attempt is made to printuG                or save the resulting document. As the printing of WATCHtL                information is often quite valuable during problem resolutionM                this behaviour can result in loss of information and generally                 12-6  WATCH Facility _  _            J                be quite annoying. Appropriate use of the duration selectorJ                when requesting a report can work around this, as at expiryK                the server disconnects, browsers generally interpreting thiseM                as legitimate end-of-document (when no content-length has been                 specified).  I                During report processing some browsers may not immediately H                update the on-screen information to reflect received dataL                without some application activity. If scroll-bars are presentG                on the document window manipulating either the horizonallJ                or vertical slider will often accomplish this. Failing thatL                minimizing then restoring the application will usually result<                in the most recent information being visible.  H                Browser reload/refresh may be used to restart the report.E                A browser will quite commonly attempt to remain at theyL                current position in the document, which with a WATCH report'sG                sustained but largely indeterminate data stream may takesK                some time to reach. It is suggested the user ensure that anynM                vertical scroll-bar is at the beginning of the current report,e'                then refresh the report.e  J                Selecting a large number of categories, those that generateH                copious output for a single event (e.g. response body) orL                collecting for extended periods can all result in the receiptF                of massive reports. Some browsers do not cope well with+                documents megabytes in size.t  !             12.5 Command-Line Usee  M                Although intended primarily as a tool for online use WATCH can J                be deployed at server startup with a command-line qualifierH                and provide report output to the server process log. ThisI                is slightly more cumbersome than the Web interface but maytM                still be useful in some circumstances. Full control over evente2                categories and filters is possible.  I                o  /NOWATCH Disables the use of the online WATCH facility.p  G                o  /WATCH= Enables the server WATCH facility, dumping to K                   standard output (and the server process log if detached). H                   When in effect the online facility is unavailable. TheK                   string supplied to the qualifier may comprise four comma-"L                   separated components. Only the first is manadatory. StatedF                   order is essential. It will probably be necessary toA                   enclose the complete string in quotation marks.   G                   1. integer representing the categories to be reported   "                   2. client filter  #                   3. service filter   N                                                           WATCH Facility  12-7 g  r                                4. path filter  D                   The category integer must be the bitwise-OR of theI                   constants found in the ADMIN.H source code header file. J                   The end of the category list in the on-line WATCH reportM                   header contains a parenthesized integer. This is the number M                   representing the enabled categories for that report and canbJ                   be used for those same categories from the command line.  J                   The following examples illustrate the command-line WATCH                    specification.                        /NOWATCHi                      /WATCH=88/                      /WATCH="88,*,*,/cgi-bin/*"o                                                                                    12-8  WATCH Facility e  n                M             Chapter__13______________________________________________________p               Scripting     G                This chapter is not a tutorial on authoring CGI scripts.eK                There exists a plague of references in the popular computingrG                press covering aspects of this technology, usually quite C                comprehensive. This chapter merely outlines the WASD M                implementation details, which are in general very much vanilla                 CGI.s  H                Scripts are mechanisms for creating simple HTTP services,L                sending data to (and sometimes receiving data from) a client,F                extending the capabilities of the basic HTTPd. AnythingJ                that can write to SYS$OUTPUT can be used to generate scriptL                output. A DCL procedure or an executable can be the basis forM                a script. Simply TYPE-ing a file can be provide script output. I                Scripts execute in processes separate from the actual HTTP E                server but under it's control and interacting with it.s  D                NOTE:  WASD can manage a script's process environmentI                either as a subprocess spawned by the HTTP server, or as aeK                network process created using DECnet. By default it supportsuJ                subprocess-based CGI scripts without further configuration.I                If DECnet-based CGI scripting or OSU (DECthreads) emulated 5                scripting is desired see Section 13.8.   H                Scripts are enabled using the exec or script rules in theM                mapping file (see Chapter 8). The script portion of the resultaH                must be a URL equivalent of the physical VMS procedure or(                executable specification.               13.1 Caution!   L                Scripts are executed within unprivileged subprocesses spawnedK                by the HTTP server. These subprocesses are owned by the HTTP.K                server account (HTTP$SERVER). Script actions can potentially H                affect server behaviour. For example it is possible for aK                script to issue an "HTTPD/DO=EXIT=NOW" command, or to create J                or modify logical name values in the JOB table (e.g. changeK                the value of LNM$FILE_DEV altering the logical search path). L                Obviously these types of actions are undesirable. In additionJ                scripts can access any WORLD-readable and modify any WORLD-H                writable resource in the system/cluster, opening a windowG                for information leakage or mischievous/malicious actionsuL                (some might argue that anyone with important WORLD-accessableJ                resources on their system deserves all that happens to them  N                                                                Scripting  13-1                 K                - but we know they're out there :^) Script authors should benK                aware of any potential side-effects of their scripts and Web L                administrators vigilant against possible malicious behaviours-                of scripts they do not author.U  H                As of version 4.2 it has become possible to exercise someL                control over the privileges of spawned subprocesses, allowingJ                enviroments that require scripts to have minimum privilegesM                (e.g. NETMBX, TMPMBX for IPC) to provide them using the server >                account's authorized privileges. See Chapter 6.  &             13.2 Scripting Environment  K                WASD HTTPd scripting underwent a major redesign between v4.1 H                and v4.2. This was to provide a faster and more efficientL                scripting environment. It provided the opportunity for a muchI                needed review of the DCL mechanism within the server. As a K                result two capabilities not found in earlier versions becametI                available, persistant subprocesses (see below) and CGIplus "                (see Section 13.7).  M                Process creation under the VMS operating system is notoriouslyeG                slow and expensive. This is an inescapable overhead when D                scripting via child processes. An obvious strategy isF                to avoid, at least as much as possible, the creation ofM                subprocesses. The only way to do this is to share subprocesses.J                between multiple scripts/requests, addressing the attendantH                complications of isolating potential interactions betweenM                requests. These could occur through changes made by any scriptaJ                to the subprocess' enviroment. For VMS this involves symbolL                and logical name creation, and files opened at the DCL level.K                In reality few scripts need to make logical name changes and L                symbols are easily removed between uses. DCL-opened files areL                a little more problematic, but again, in reality most scripts6                doing file manipulation will be images.  J                A reasonable assumption is that for almost all environmentsM                scripts can quite safely share subprocesses with great benefit J                to response latency and system impact (see Section 15.2 forH                a table with some comparative performances). If the localM                environment requires absolute script isolation for some reason M                then this subprocess-persistance may easily be disabled with al3                consequent trade-off on performance.a  H                NOTE: With the form of subprocess management used in v4.2I                and following, BYTLM can become an issue. When setting the I                HTTPd account BYTLM quota allow approxiamtely 12,500 byteseM                per subprocess that can be concurrently active, plus a general H                allowance (technically, allow 1.0 x /NETBUF= plus 1.0 x +L                0.5 x + 0.5 x /SUBBUF=). That is if the subprocess hard-limitM                (see below) is 20 then BYTLM should be set to at least 250,000                13-2  Scripting  i  i            K                plus 50,000. Of course in such a case PRCLM should be set to,J                at least 20, preferably 40. These and other relevant quotasH                may be monitored using the HTTPDMON utility or the server#                administration menu.                     Zombies  D                The term zombie is used to describe subprocesses whenJ                persisting between uses (the reason should be obvious, theyM                are neither "alive" (processing a request) nor are they "dead" L                (deleted) :^) Zombie subprocesses have a finite time to existI                (non-life-time?) before they are automatically purged fromrL                the system (see Chapter 6). This keeps process clutter on the#                system to a minimum.m                13.3 Script Run-Time  I                Scripts are merely executed or interpreted files. Although-K                by default VMS executables and DCL procedures can be used asAK                scripts, other run-time environments may also be configured. H                For example, scripts written for the Perl language may beF                transparently given to the Perl interpreter in a scriptG                subprocess. This type of script activation is based on atL                unique file type (extension following the file name), for theM                Perl example this is most commonly ".PL", or sometimes ".CGI".oJ                Both of these may be configured to automatically invoke theM                site's Perl interpreter, or any other run-time environment forC                that matter.e  K                This configuration is performed using the [DclScriptRunTime]-I                parameter, where a file type is associated with a run-timeiI                environment. This parameter takes two components, the fileaL                extension and the run-time verb. The verb may be specified asK                a simple, globally-accessable verb (e.g. one embedded in theaI                CLI tables), or in the format to construct a foreign-verb, M                providing reasonable versatility. Run-time parameters may also I                be appended to the verb if desired. The server ensures the L                verb is foreign-assigned if necessary, then used on a commandK                line with the script file name as the final parameter to it./  K                The following is an example showing a Perl run-time environ- K                ment being specified. The first line assumes the "Perl" verbvJ                is globally accessable on the system (e.g. perhaps providedI                by the DCL$PATH logical) while the second (for the sake ofaM                illustration) shows the same Perl interpreter being configured G                for a different file type using the foreign verb syntax.a  $                   [DclScriptRunTime]                   .PL PERL%                   .CGI $PERL_EXE:PERL   N                                                                Scripting  13-3                 K                A file contain a Perl script then may be activated merely by 6                specifying a path such as the following  %                   /cgi-bin/example.pld  J                To add any required parameters just append them to the verb                specified.h  $                   [DclScriptRunTime]9                   .XYZ XYZ_INTERPRETER -vms -verbose -etc B                   .XYZ $XYZ_EXE:XYZ_INTERPRETER /vms /verbose /etc  K                If a more complex run-time environment is required it may be K                necessary to wrap the script's execution in a DCL procedure.   %                Script File Extensionsm  J                The WASD server does not require a file type (extension) toH                be explicitly provided when activating a script. This canH                help hide the implementation detail of any script. If theK                script path does not contain a file type the server searches0H                the script location for a file with one of the known fileG                types, first ".COM" for a DCL procedure, then ".EXE" for1H                an executable, then any file types specified using scriptH                run-time configuration directive, in the order specified.  K                For instance, the script activated in the Perl example above L                could have been specified as below and (provided there was noL                "EXAMPLE.COM" or "EXAMPLE.EXE" in the search) the same script(                would have been executed.  "                   /cgi-bin/example               13.4 CGI Compliance   F                The HTTPd scripting mechanism is designed to be WWW CGIL                (Common Gateway Interface) compliant, based in part on by theL                INTERNET-DRAFT authored by D.Robinson (drtr@ast.cam.ac.uk), 8                January 1996.  &                CGI Compliant Variables  D                Environment variables are created in a similar way toG                the CERN VMS HTTPd implementation, where CGI environmenteK                variables are provided to the script via DCL global symbols.tH                Each CGI variable symbol name is prefixed with "WWW_" (byL                default, although this can be changed using the "/CGI_PREFIX"I                qualifier, see Section 5.3, this is not recommended if thevK                WASD VMS scripts are to be used, as they expect CGI variablep6                symbols to be prefixed in this manner).               13-4  Scriptinge a               *                Extensions to CGI Variables  F                In line with other CGI implemenations, additional, non-H                compliant variables are provided to ease CGI interfacing.J                These provide the various components of the query string. AK                keyword query string and a form query string are parsed intot)                separated variables, named                       WWW_KEY_number                   WWW_KEY_COUNT ,                   WWW_FORM_form-element-name  %                See the example below._  $                CGI Variable Capacity  J                DCL symbol values are limited to approximately 1024 charac-J                ters. The CGI interface will provide symbols with values upL                to that limit if required. This should be sufficient for most                circumstances.n  (                CGI Variable Descriptions  >                Remember, all variables are prefixed by "WWW_".  M                ______________________________________________________________eM                Name__________________Description___________"Standard"_CGI____e  =                AUTH_GROUP            authentication group  noh/                                      (or empty)i  =                AUTH_REALM            authentication realm  no /                                      (or empty)t  >                AUTH_TYPE             authentication type   yes6                                      (BASIC or DIGEST)  >                CONTENT_LENGTH        "Content-Length:"     yes8                                      from request header  >                CONTENT_TYPE          "Content-Type:" from  yes3                                      request header   =                FORM_field            query string "&"      not3                                      separated forme-                                      elements   >                GATEWAY_INTERFACE     "CGI/1.1"             yes    N                                                                Scripting  13-5 e  (          M                ______________________________________________________________tM                Name__________________Description___________"Standard"_CGI____i  C                HTTP_ACCEPT           any list of browser-  optionalm5                                      accepted contenta*                                      types  C                HTTP_ACCEPT_CHARSET   any list of browser-  optionalr7                                      accepted characterp)                                      setsy  C                HTTP_ACCEPT_LANGUAGE  any list of browser-  optionalb7                                      accepted languages   C                HTTP_AUTHORIZATION    any from request      optional +                                      header   C                HTTP_COOKIE           any cookie sent by    optionalt/                                      the client   C                HTTP_FORWARDED        any proxy/gateway     optionalf9                                      hosts that forwarded 0                                      the request  C                HTTP_HOST             host and port         optional 5                                      request was sentl'                                      to   C                HTTP_IF_MODIFIED_     any last modified     optional 4                SINCE                 GMT time string  C                HTTP_PRAGMA           any pragma directive  optional.6                                      of request header  C                HTTP_REFERER          any source document   optional 9                                      URL for this requesti  C                HTTP_USER_AGENT       client/browser        optional 3                                      identification +                                      stringl  =                KEY_n                 query string "+"      noe7                                      separated elementsn  =                KEY_COUNT             number of "+"         no 7                                      separated elementsl  >                PATH_INFO             virtual path of data  yes5                                      requested in URL   >                PATH_TRANSLATED       VMS file path of      yes6                                      data requested in(                                      URL               13-6  Scripting2    C          M                _______________________________________________________________M                Name__________________Description___________"Standard"_CGI____p  >                QUERY_STRING          un-URL-decoded        yes5                                      string followingt/                                      "?" in URLi  >                REMOTE_ADDR           IP host address of    yes0                                      HTTP client  >                REMOTE_HOST           IP host name of HTTP  yes+                                      clienta  >                REMOTE_USER           authenticated remote  yes9                                      user name (or empty),  =                REQUEST_CHARSET       any server-           non7                                      determined requeste2                                      character set  >                REQUEST_METHOD        "GET", "PUT", etc.    yes  =                REQUEST_SCHEME        "http:" or "https:"   no   =                REQUEST_TIME_GMT      GMT time request      nou-                                      receivedc  =                REQUEST_TIME_LOCAL    Local time request    non-                                      received   >                SCRIPT_NAME           name of script        yes9                                      being executed (e.g.e.                                      "/query")  =                SERVER_CHARSET        server default        no 2                                      character set  =                SERVER_GMT            offset from GMT       no 4                                      (e.g. "+09:30")  >                SERVER_NAME           IP host name of       yes2                                      server system  >                SERVER_PROTOCOL       HTTP protocol         yes4                                      version (always0                                      "HTTP/1.0")  >                SERVER_PORT           IP port request was   yes0                                      received on  >                SERVER_SOFTWARE       software ID of HTTP   yesM                ______________________server__________________________________r  N                                                                Scripting  13-7                 )                CGI Variable Demonstratione  K                The basic CGI symbol names are demonstrated here with a callhG                to a script that simply executes the following DCL code:.  %                   $ SHOW SYMBOL WWW_*a!                   $ SHOW SYMBOL *   M                Note how the request components are represented for "ISINDEX"-dK                style searching (third item) and a forms-based query (fourth                 item).g  /                <online hypertext demonstration>e  #                CGI Compliant Outputt  K                Script output must behave in a CGI-compliant fashion (by way H                of contrast, see Section 13.5). That is, a CGI script mayG                redirect the location of the document, using a Location: H                header line, or may supply a data stream beginning with aJ                Content-Type: header line. Both must be followed by a blank                line.  I                If the script output begins with a CGI-compliant "Content-lI                Type: text/ . . . " (text document) the HTTPd assumes thatuH                output will be line-oriented and requiring HTTP carriage-H                control (each record/line terminated by a line-feed), andJ                will thereafter ensure each record it receives is correctlyJ                terminated before passing it to the client. In this way DCLI                procedure output (and the VMS CLI in general) is supported L                transparently. Any other content-type is assumed to be binary3                and no carriage control is enforced.   &             13.4.1 Example DCL Scripts  C                A simple script to provide the system time might be:a  ,                   $ say = "write sys$output"=                   $! the next two lines make it CGI-compliantn2                   $ say "Content-Type: text/plain"                   $ say ""6                   $! start of plain-text script output                   $ show timei  J                A script to provide the system time more elaborately (using                HTML):                      13-8  Scripting  m               ,                   $ say = "write sys$output"=                   $! the next two lines make it CGI-compliant 1                   $ say "Content-Type: text/html"e                   $ say ""0                   $! start of HTML script output                    $ say "<HTML>"C                   $ say "Hello ''WWW_REMOTE_HOST'"  !(CGI variable)t                   $ say "<P>"oI                   $ say "System time on node ''f$getsyi("nodename")' is:"i0                   $ say "<H1>''f$cvtime()'</H1>"!                   $ say "</HTML>"c                  13.5 Raw HTTP Output  L                A script does not have to output a CGI-compliant data stream.J                If it begins with a HTTP header status line (e.g. "HTTP/1.0M                200 OK"), HTTPd assumes it will supply a raw HTTP data stream,nK                containing all the HTTP requirements. This is the equivalent L                of the no-parse-header, or "nph . . . " named scripts of some                environments.  L                Any such script must observe the HyperText Transfer Protocol.K                Every line must be terminated by a carriage-return and line-oJ                feed (represented as "\r""\n"), or as a minimum by a singleL                line-feed. In particular, the type of the data being returnedK                by the scripts must be included in an HTTP header sent priordM                to the data itself. Headers for the two most common data typesaM                will be illustrated here. Note that the blank line is strictlyc3                necessary, it terminates the header.                   Plain-Texth  %                   HTTP/1.0 200 ok\r\n+.                   Content-Type: text/plain\r\n                   \r\n                  HTML(  %                   HTTP/1.0 200 ok\r\n -                   Content-Type: text/html\r\nt                   \r\n                N                                                                Scripting  13-9 e               "                Raw HTTP DCL Script  H                The following example show a non-CGI-compliant DCL scriptK                similar in function to the CGI-compliant one above. Note the J                full HTTP header and each line explicitly terminated with a2                carriage-return and line-feed pair.  "                   $ cr[0,8] = %x0d"                   $ lf[0,8] = %x0a,                   $ say = "write sys$output"C                   $! the next line determines it is raw HTTP streami8                   $ say "HTTP/1.0 200 Success''cr'''lf'";                   $ say "Content-Type: text/html''cr'''lf'"t:                   $! response header separating blank line$                   $ say "''cr'''lf'"0                   $! start of HTML script output%                   $ say "<HTML>''lf'"l7                   $ say "Hello ''WWW_REMOTE_HOST'''lf'" "                   $ say "<P>''lf'">                   $ say "Local time is ''WWW_TIME_LOCAL'''lf'"&                   $ say "</HTML>''lf'"                   Raw HTTP C Script  L                When scripting using the C programming language and providingM                a full HTTP response there can be considerable efficiencies tonM                be gained by providing a binary output stream from the script.mL                This may be simply provided using a code construct similar to;                following to reopen <stdout> in binary mode.i  W                   /* reopen output stream so that the '\r' and '\n' are not filtered */                    #ifdef __DECCo[                      if ((stdout = freopen ("SYS$OUTPUT", "w", stdout, "ctx=bin")) == NULL) *                         exit (vaxc$errno);                   #endif  I                This is used consistently in WASD scripts. Of course aftere:                that the full HTTP header must be supplied.  %                      fprintf (stdout, ,                   "HTTP/1.0 200 Success\r\n\.                   Content-Type: text/html\r\n\                   \r\n\l                   <HTML>\n\a                   Hello %s\n\d                   <P>\n\&                   System time is %s\n\                   </HTML>\n",s/                      getenv("WWW_REMOTE_HOST"), /                      getenv("WWW_TIME_LOCAL"));t               13-10  Scripting i  i                         13.6 Raw HTTP Input   G                The logical name SYS$INPUT (with a synonym of HTTP$INPUTrH                for backward compatibility), <stdin> for C Language basedK                scripts, defines a mailbox providing a stream containing theoJ                request body (if any). This is available for procedures and7                executables to explicitly open and read.e  H                Note that this is a raw stream, and HTTP lines (carriage-L                return/line-feed terminated sequences of characters) may haveM                be blocked together for network transport. These would need to 2                be explicity parsed by the program.  J                NOTE: Versions of the server prior to 4.3 supplied the fullK                request (header then body) to the script. This was not fullyuH                CGI-compliant. Versions 4.3 and following supply only theF                body, although the previous behaviour may be explicitlyK                selected using the configuration parameter [DclFullRequest].v  "             13.7 CGIplus Scripting  L                Common Gateway Interface ... plus lower latency, plus greater7                efficiency, plus far less system impact!   K                I know, I know! The term CGIplus is a bit too_cute but I had $                to call it something!  I                CGIplus attempts to eliminate the overhead associated with H                creating the subprocess and then executing the image of aJ                CGI script. It does this by allowing the subprocess and anyI                associated image/application to continue executing between I                uses, eliminating any startup overheads. This reduces both F                the load on the system and the request latency. In thisJ                sense these advantages parallel those offered by commercialG                HTTP server-integration APIs, such as Netscape NSAPI and M                Microsoft ISAPI, without the disadvantages of such proprietory M                interfaces, the API complexity, language dependency and server #                process integration..  L                CGIplus is not as complex (and consequently nor as versatile)E                as another approach to improving CGI performance, Open <                Market's FastCGI, see http://www.fastcgi.com/  H                CGIplus design is generic enough to be easily implementedE                by other server architectures if found desirable. (ForlI                example, it is imagined Unix platforms would implement theiK                CGIplus variable stream using named pipes one of which wouldoH                be designated by the CGIPLUSIN environment variable.) TheL                CGIplus-specific script environment and example code has beenL                made as platform-neutral as possible, providing potential forL                a more wide-spread adoption. Existing CGI scripts can rapidlyI                and elegantly be modified to additionally support CGIplus.r  N                                                               Scripting  13-11 c  t            L                The capability of scripts to easily differentiate between andK                operate in both standard CGI and CGIplus environments with atA                minimum of code revision offers great versatility.e    "                CGIplus Performance  I                A simple performance evaluation indicates the advantage of H                CGIplus. See Section 15.2 for some test results comparingI                the non-persistant-process, persistant-process and CGIplus                 environments.  K                Without a doubt, the subjective difference in activating the K                same script within the standard CGI and CGIplus environments "                is quite startling!  "                CGIplus Programming  L                The script interface is still CGI, which means a new API doesL                not need to be learned and existing CGI scripts are simple to                modify.  4                See examples in HT_ROOT:[SRC.CGIPLUS]  '                <on-line hypertext link>_  E                Instead of having the CGI variables available from the_J                environment (generally accessed via the C Language getenv()H                standard library call) a CGIplus script must read the CGII                variables from CGIPLUSIN. They are supplied as a series of H                records (lines) containing a CGI variable name (in upper-G                case), an equate symbol and then the variable value. TheDL                line will never contain more than 1024 characters. The formatH                may be easily parsed and as the value contains no encoded/                characters may be directly used.   '                Requirements when using:a  L                o  The read will block between subsequent requests and so may8                   be used to coordinate the application.  D                o  The first record read in any request can always beE                   discarded. This is provided so that a script may be K                   synchronized outside of the general CGIplus variable read_D                   loop (the DCL and Perl examples use this feature).  G                o  The CGIplus variable stream should be completely read K                   (up until the blank line, see below) before beginning any %                   request processing.t  I                o  The CGIplus variable stream should ALWAYS BE COMPLETELYT<                   READ (up until the blank line, see below).               13-12  Scripting e               L                o  An empty record (blank line) indicates the end of a singleK                   request's CGIplus variable stream. Reading MUST be haltedaF                   at this stage. Request processing may then commence.  M                After processing, the CGIplus script can loop, waiting to read >                the details of the next request from CGIPLUSIN.  F                Request output (to the client) is written to SYS$OUTPUTI                (<stdout>) as per normal CGI behaviour. End of output MUSToI                be indicated by writing a special EOF record to the output J                stream. This is bit of a kludge, and the least elegant partM                of CGIplus design, but it is also the simplest implementation. K                A unique EOF sequence is generated for each use of DCL via a K                zombie or CGIplus subprocess. A non-repeating series of bits L                most unlikely to occur in normal output is employed . . . butJ                there is still a very, very, very small chance of prematureD                termination of output (one in 2^280 I think!) See HT_D                ROOT:[SRC.HTTPD]DCL.C for how the value is generated.  H                The CGIplus EOF string is obtained by the script from theI                logical name CGIPLUSEOF, defined in the script subprocess'sG                process table, using the scripting language's equivalenttI                of F$TRNLNM(),  SYS$TRNLNM(), or a getenv() call (in the C K                standard library). This string will always contain less thanOL                64 characters and comprise only printable characters. It mustH                be written at the conclusion of a request's output to theK                output stream as a single record (line) but may also contain J                a <CR><LF> or just <LF> trailing carriage-control (to allowH                for programming language requirements). It only has to beK                evaluated once, as the processing begins, remaining the samedJ                for all requests over the life-time of that instance of the                script.  L                HTTP input (raw request stream, header and any body) is still-                available to a CGIplus script.o                  Code Examples  H                Of course a CGIplus script should only have a single exitF                point and should explicitly close files, free allocatedI                memory, etc., after processing a request (i.e. not rely on K                image run-down to clean-up after itself). It is particularlyTG                important when modifying existing scripts to work in the I                CGIplus environment to ensure this requirement is met (whotH                of us hasn't thought "well, this file will close when the$                image exits anyway"?)  D                It is a simple task to design a script to modify it'sI                behaviour according to the environment it is executing in. J                Detecting the presence or absence of the CGIPLUSEOF logicalL                is sufficient indication. The following C code fragment shows  N                                                               Scripting  13-13                 M                simultaneously determining whether it is a standard or CGIplus L                environment (and setting an appropriate boolean), and getting7                the CGIplus EOF sequence (if it exists).   !                   int  IsCgiPlus;0'                   char  *CgiPlusEofPtr;   O                   IsCgiPlus = ((CgiPlusEofPtr = getenv("CGIPLUSEOF")) != NULL);   J                The following C code fragment shows a basic CGIplus requestL                loop, reading lines from CGIPLUSIN, and some basic processingG                to select required CGI variables for request processing.s                      if (IsCgiPlus)                   { !                      char  *cptr;f'                      char  Line [1024],_,                            RemoteHost [128];&                      FILE  *CgiPlusIn;  P                      if ((CgiPlusIn = fopen (getenv("CGIPLUSIN"), "r")) == NULL)                      {2                         perror ("CGIplus: fopen");!                         exit (0);c                      }                        for (;;)                       {H                         /* will block waiting for subsequent requests */                          for (;;)                         {eS                            /* should never have a problem reading CGIPLUSIN, but */uM                            if (fgets (Line, sizeof(Line), CgiPlusIn) == NULL)t                            {8                               perror ("CGIplus: fgets");'                               exit (0);                             }V                            /* first empty line signals the end of CGIplus variables */6                            if (Line[0] == '\n') break;<                            /* remove the trailing newline */Q                            if ((cptr = strchr(Line, '\n')) != NULL) *cptr = '\0';   Q                            /* process the CGI variable(s) we are interested in */ G                            if (!strncmp (Line, "WWW_REMOTE_HOST=", 16)) ;                               strcpy (RemoteHost, Line+16);i                         }l  ?                         (process request, signal end-of-output)w                      }                   }   G                CGI scripts can write output in record (line-by-line) or H                binary mode (more efficient because of buffering by the C               13-14  Scripting s  e            J                RTL). When in binary mode the output stream must be flushedL                immediately before and after writing the CGIplus EOF sequenceJ                (note that in binary a full HTTP stream must also be used).K                This code fragment shows placing a script output stream intoG2                binary mode and the flushing steps.  W                   /* reopen output stream so that the '\r' and '\n' are not filtered */uX                   if ((stdout = freopen ("SYS$OUTPUT", "w", stdout, "ctx=bin")) == NULL)'                      exit (vaxc$errno);H                     do {  '                      (read request ...)   /                      /* HTTP response header */ \                      fprintf (stdout, "HTTP/1.0 200 ok\r\nContent-Type: text/html\r\n\r\n");  '                      (other output ...)   #                      if (IsCgiPlus)u                      {O                         /* the CGIplus EOF must be an independant I/O record */e(                         fflush (stdout);>                         fprintf (stdout, "%s", CgiPlusEofPtr);(                         fflush (stdout);                      }  &                   } while (IsCgiPlus);  J                If the script output is not binary (using default <stdout>)J                it is only necessary to ensure the EOF string has a record-#                delimiting new-line.   :                   fprintf (stdout, "%s\n", CgiPlusEofPtr);  F                Other languages may not have this same requirement. DCLM                procedures are quite capable of being used as CGIplus scripts.   4                See examples in HT_ROOT:[SRC.CGIPLUS]  '                <on-line hypertext link>n  G                Whenever developing CGIplus scripts/applications (unlikerM                standard CGI) don't forget that after compiling, the old imagemJ                must be purged from the server before trying out the new!!!6                (I've been caught a number of times :^)  I                Scripting subprocesses may be purged or deleted using (seee                 Section 5.3.2.4):  (                   $ HTTPD /DO=DCL=DELETE'                   $ HTTPD /DO=DCL=PURGE   N                                                               Scripting  13-15                 #                Other Considerations   H                Multiple CGIplus scripts may be executing in subprocessesG                at any one time. This includes multiple instances of any-I                particular script. It is the server's task to track these, F                distributing appropriate requests to idle subprocesses,G                monitoring those currently processing requests, creatinglK                new instances if and when necessary, and deleting the least- K                used, idle CGIplus subprocesses when configurable thresholdshH                are reached. Of course it is the script's job to maintainE                coherency if multiple instances may result in resource G                conflicts or race conditions, etc., between the scripts."  I                The CGIplus subprocess can be given a finite life-time set L                by configuration parameter (see Chapter 6). If this life-timeJ                is not set then the CGIplus will persist indefinitely (i.e.K                until purged due to soft-limits being reached, or explicitly!I                purged/deleted). When a life-time has been set the CGIplus K                subprocess is automatically deleted after being idle for the<K                specified period (i.e. not having processed a request). This I                can be useful in preventing sporadically used scripts from 5                cluttering up the system indefinitely.g  K                In addition, an idle CGIplus script can be terminated by thelK                server at any time the subprocess soft-limit is reached (theeI                subprocess SYS$DELPRC()ed)  so resources should be largelydJ                quiescent when not actually processing. Of course a CGIplusL                subprocesses may also be manually terminated from the command$                line (e.g. STOP/ID=).  M                Some CGIplus scripting information and management is available,D                via the server administration menu, see Section 11.2.  #                CGIplus Rule Mapping   K                CGIplus scripts are differentiated from standard CGI scripts M                in the mapping rule configuration file using the "script+" andf1                "exec+" directives. See Chapter 8.\  L                Scripts capable of operating in both standard CGI and CGIplusK                environments may simply be accessed in either via rules such                 as   ,                   exec /cgi-bin/* /cgi-bin/*1                   exec+ /cgiplus-bin/* /cgi-bin/*T  G                while specific scripts can be individually designated as                 CGIplus using  E                   script+ /cgiplus_example* /cgi-bin/cgiplus_example*m               13-16  Scripting $  U            I                Caution!  If changing CGIplus script mapping it is advised J                to restart the server rather than reloading the rules. SomeG                conflict is possible when using new rules while existing -                CGIplus scripts are executing.d    !             13.8 DECnet Scriptinga  F                "Imitation is the sincerest form of flattery" - proverb  J                NOTE:  WASD requires no additional configuration to supportL                subprocess-based scripting. The following information applies9                only if DECnet-based scripting is desired.s  H                By default WASD executes scripts within subprocesses, butF                can also provide scripting using DECnet for the processH                management. DECnet scripting is not provided to generallyI                supplant the subprocess-based scripting but augment it foro%                certain circumstances:v  G                o  To provide an environment within WASD where OSU-basedeM                   scripts (both CGI and OSU-specific) may be employed without                    modification.   K                o  To allow nodes without a full HTTP service to participate J                   in providing resources via a well-known server, possibly:                   resources that only they have access to.  F                o  Load-sharing amongst cluster members for high-impact5                   scripts or particularly busy sites.   1                o  Provide user-account scripting.   !                DECnet Performancea  A                Any DECnet based processing incurs some overheads.a  *                o  connection establishment  ,                o  NETSERVER image activation  <                o  NETSERVER maintenance (such as logs, etc.)  @                o  activation of DECnet object image or procedure  *                o  DECnet object processing  <                o  activation by object of image or procedure  (                o  DECnet object run-down  F                o  NETSERVER image reactivation on completion of object                   processing  N                                                               Scripting  13-17 e               J                As of version 5.2 WASD provides reuse of DECnet connectionsD                for both CGI and OSU scripting, in-line with OSU v3.3H                which provided reuse for OSU scripts. This means multipleJ                script requests can be made for the cost of a single DECnetH                connection establishment and task object activation. ThisJ                functionality provides substantial performance improvementsJ                as indicated by DECnet Observations. Note that the OSU taskI                procedure requires the definition of the logical name WWW_iM                SCRIPT_MAX_REUSE representing the number of times a script maytG                be reused. The WASD startup procedures can provide this.   L                In practice both the WASD CGI and OSU scripts seem to provide)                acceptable responsiveness.a                  Rule Mappingo  F                DECnet-based scripts are mapped using the same rules asM                subprocess-based scripts, using the SCRIPT and EXEC rules (seelJ                Chapter 8 for general information on mapping rules). DECnetJ                scripts have a DECnet node and task specification string asJ                part of the mapping rule. There are minor variations withinK                these to further identify it as a WASD or an OSU script. SeetH                Section 13.8.4 for information on mapping user scripting.  L                The specification string follows basic VMS file system syntaxM                (RMS), preceding the file components of the specification. ThefK                following example illustrates declaring that paths beginningeK                with FRODO will allow the execution of scripts from the CGI- ;                BIN:[000000] directory on DECnet node FRODO.   2                   exec /FRODO/* /FRODO::/cgi-bin/*  L                In similar fashion the following example illustrates a scriptM                "frodo_show" that might do a "SHOW SYSTEM" on node FRODO. Notea5                that these rules are case-insensitive.v  D                   script /frodo-showsys /frodo::/cgi-bin/showsys.com  G                Both of the above examples would use the WASD CGI DECnet J                environment (the default if no task specification string isK                provided). By including task information other environments,mK                in particular the OSU scripting enviroment, can be specifiedaH                for the script to be executed within. The default task isK                named CGIWASD and can also be explicitly specified (althoughyM                this behaviour would be the same as that in the first example)   @                   exec /frodo/* /frodo::"task=cgiwasd"/cgi-bin/*  K                All task specification strings may also use zero as the taskr                abreviation.   =                   exec /frodo/* /frodo::"0=cgiwasd"/cgi-bin/*e               13-18  Scripting                 I                To execute a script within the OSU environment specify thenG                standard OSU task executive WWWEXEC, as in the followinge                example:   >                   exec /osu/* /FRODO::"task=wwwexec"/cgi-bin/*  K                This would allow any URL beginning with "/osu/" to execute a -                script in the OSU environment.                   Local Systemk  I                To specify any script to execute on the same system as theiE                HTTP server specify the node name as zero or SYS$NODE.R  =                   exec /decnet/* /0::"task=cgiwasd"/cgi-bin/*eA                   exec /osu/* /sys$node::"task=wwwexec"/cgi-bin/*   B                Mapping rules are included in the examples (see HT_K                ROOT:[EXAMPLE]) providing this. After the DECnet environment>K                has been started any CGI script may be executed on the localeK                system via DECnet by substituting "/decnet/" for "/cgi-bin/" H                as the script path, and any OSU script available by usingJ                "/osu/". Behaviour is indeterminate, though it shouldn't beM                catastrophic, if one is invoked using the incorrect path (i.e.rI                an OSU script using /decnet/ or a CGI script using /osu/).n  ,             13.8.1 Script System Environment  H                The target system must have sufficient of the WASD serverL                environment to support the required CGI script activation andI                activity. If the target system is actually the same system G                as the HTTP server then it already exists, or if part of H                the local system's cluster, then providing this should beI                relatively straight-forward. If the target system has none G                of the server environment then at a minimum it must have J                the logical name CGI-BIN defined representing the directoryK                containing the required DECnet object procedure and scripts. 7                The following fragment illustrates this:s  Q                   $ DEFINE /SYSTEM /TRANSLATION=(CONCEALED) CGI-BIN device:[dir.]o  D                In this directory must be located the WASDCGI.COM andF                WWWEXEC.COM procedures required by the network task. OfL                course other parts of the environment may need to be provided0                depending on script requirements.          N                                                               Scripting  13-19 r  r            !             13.8.1.1 Proxy Access   E                The local system must have proxy access to each targetlI                scripting system (even if that "target" system is the samexI                system as the HTTP server). This involves creating a proxy G                entry in each target hosts's authorization database. The M                following example assumes the existance of a local HTTP$SERVER H                account. If it does not exist on the target node then oneI                must be created with the same security profile as the HTTP                 server's.  F                Caution! If unsure of the security implications of thisI                action consult the relevant VMS system management securityf                documentation.r  E                The zero represents the system the server is currentlyi                executing on.  *                   $ SET DEFAULT SYS$SYSTEM!                   $ MCR AUTHORIZEcE                   UAF> ADD /PROXY 0::HTTP$SERVER HTTP$SERVER /DEFAULT   F                It is necessary to ensure the account has permission toJ                write into it's home directory. A network process creates aL                NETSERVER.LOG (Phase-IV) or NET$SERVER.LOG (DECnet-Plus) fileJ                in the home directory, and will fail to start if it cannot!  #             13.8.1.2 DECnet Objects   M                To provide DECnet scripting DECnet object(s) must be specified)H                for any system on which the scripts will be executed. TheM                DECnet object is the program or procedure that is activated atsM                the target system inside of a network-mode process to interact $                with the HTTP server.  (                DECnet-Plus (OSI/Phase-V)  I                DECnet-Plus uses the NCL utility to administer the network M                environment. The following NCL scripting shows the creation of =                a network application for the WASD CGI object:)                     $ MCR NCL C                   CREATE NODE 0 SESSION CONTROL APPLICATION CGIWASD ]                   SET NODE 0 SESSION CONTROL APPLICATION CGIWASD ADDRESSES = {NAME=CGIWASD} -                    ,CLIENT =  -*                   ,INCOMING ALIAS = TRUE -*                   ,INCOMING PROXY = TRUE -+                   ,OUTGOING ALIAS = FALSE -h*                   ,OUTGOING PROXY = TRUE -(                   ,NODE SYNONYM = TRUE -=                   ,IMAGE NAME = CGI-BIN:[000000]CGIWASD.COM - &                   ,INCOMING OSI TSEL =               13-20  Scripting                 :                To create a DECnet-Plus OSU WWWEXEC object:                     $ MCR NCLt]                   SET NODE 0 SESSION CONTROL APPLICATION WWWEXEC ADDRESSES = {NAME=WWWEXEC} -                    ,CLIENT =  -*                   ,INCOMING ALIAS = TRUE -*                   ,INCOMING PROXY = TRUE -+                   ,OUTGOING ALIAS = FALSE - *                   ,OUTGOING PROXY = TRUE -(                   ,NODE SYNONYM = TRUE -=                   ,IMAGE NAME = CGI-BIN:[000000]WWWEXEC.COM - &                   ,INCOMING OSI TSEL =  M                These must be executed at each system (or server) startup, andsJ                may be executed standalone, as illustrated, or incorporatedL                in the NCL script SYS$STARTUP:NET$APPLICATION_STARTUP.NCL forI                automatic creation at each system startup. Examples may be *                found in HT_ROOT:[EXAMPLE].                  Phase-IV.  M                DECnet Phase-IV uses the NCP utility to administer the networkyL                environment. The following NCP commands may be used each timeK                during server startup to create the required DECnet objects.aL                With Phase-IV the SET verb may be replaced with a DEFINE verbJ                and the commands issued just once to permanently create theI                objects (a SET must also be done that first time to createo9                working instances of the DEFINEd objects).   -                To create a DECnet CGI object:                      $ MCR NCP N                   SET OBJECT CGIWASD NUMBER 0 FILE CGI-BIN:[000000]CGIWASD.COM  5                To create a DECnet OSU WWWEXEC object:t                     $ MCR NCP N                   SET OBJECT WWWEXEC NUMBER 0 FILE CGI-BIN:[000000]WWWEXEC.COM  :                Examples may be found in HT_ROOT:[EXAMPLE].  ,             13.8.1.3 Reducing Script Latency  J                Script system network process persistance may be configuredJ                using NETSERVER logical names. These can control the numberJ                and quiescent period of the server processes. These logicalH                names must be defined in the LOGIN.COM of the HTTP server3                account on the target script system.a  I                o  NETSERVER$SERVERS_username -  This logical controls thesL                   number of network server processes that are kept availableM                   at any one time. Defining this logical results in a minimumgG                   of the specified number of quiescent server processes.  N                                                               Scripting  13-21 o  g            I                   maintained. This can improve script response latency byaG                   circumventing the need to create a process to servicerH                   the request, at the cost of cluttering the system with&                   NETSERVER processes.  @                      DEFINE /JOB NETSERVER$SERVERS_HTTP$SERVER 5  K                o  NETSERVER$TIMEOUT -  This logical controls the duration a J                   quiescent network process persists before being deleted.L                   The default period is five minutes. The following examplesH                   first show reducing that to thirty seconds, the secondK                   increasing it to one hour. Again, this can improve scriptsH                   response latency by circumventing the need to create aL                   process to service the request, at least during the periodB                   a previously created process continues to exist.  ?                      DEFINE /JOB NETSERVER$TIMEOUT "0 00:00:30" ?                      DEFINE /JOB NETSERVER$TIMEOUT "0 01:00:00"s  '             13.8.1.4 DECnet/OSU Startup   H                The example STARTUP.COM and STARTUP_DECNET.COM proceduresC                found in the HT_ROOT:[EXAMPLE] directory provide the F                essentials for DECnet/OSU scripting. If the INSTALL.COME                startup environment is used setting the PROVIDE_DECNET J                symbol to 1 in STARTUP.COM will create the DECnet scripting1                environment during server startup.s               13.8.2 CGI  J                CGI scripts may be transparently executed within the DECnetL                scripting environment. This means that the script is executedD                within a network process, on the target system (whichI                could be the local system), instead of within a subprocessTG                on the local system. Other than that the WASD DECnet CGIsI                environment behaves identically to the standard subprocess F                CGI environment. CGIplus scripting is not supported andD                if CGIplus-only scripts are executed the behaviour is                indeterminate.Y  L                An example of making the HELP database on a system other thanM                that hosting the HTTP server (using the CONAN script) would beo+                done using the mapping rules   .                   map /FRODO/help /FRODO/help/?                   script /FRODO/help/* /FRODO::/cgi-bin/conan/*   2                and for the example DCL SHOW script  <                   script /FRODO/show* /FRODO::/cgi-bin/show*               13-22  Scripting e  a            -             13.8.3 OSU (DECthreads) Emulationn  M                The OSU, or DECthreads, server is the most widely deployed VMSiM                HTTP server environment, authored by David Jones and copyrightnD                the Ohio State University. See http://kcgl1.eng.ohio-F                state.edu/www/doc/serverinfo.html for more information.  D                The WASD HTTP server provides an emulation of the OSUH                scripting environment. This is provided so that OSU-basedK                scripts (both CGI-style and OSU-specific) may be employed byaM                WASD with no modification. As this emulation has been designed J                through examining OSU code and lots of trial and error it'sK                behaviour may be incomplete or present errors. A list of OSUoM                scripts known to work with WASD is provided at the end of this 2                section, see Known Working Scripts.  F                Supported scripts include only those that depend on theC                OSU WWWEXEC object and dialog for all functionality.eD                Any script that uses other OSU-specific functionalityF                is not supported. Interactions between WASD's and OSU'sD                authentication/authorization schemes may be expected.  H                Please remember this is a first-cut of reverse-engineeredK                technology. The author would like to know of any OSU scriptsiK                the WASD emulation barfs on, and will attempt to address thes:                associated limitation(s) and/or problem(s).                  OSU Setup  K                Software necessary for supporting the OSU scripting environ- K                ment (e.g. WWWEXEC.COM) and selected OSU scripts (mainly for M                testing purposes) have been extracted from the OSU v3.3a pack-eL                age and included in the HT_ROOT:[SRC.OSU] directory. This hasE                been done within the express OSU licensing conditions.t  @                   Copyright 1994,1997 The Ohio State University.R                   The Ohio State University will not assert copyright with respectP                   to reproduction, distribution, performance and/or modificationO                   of this program by any person or entity that ensures that all Q                   copies made, controlled or distributed by or for him or it bear O                   appropriate acknowlegement of the developers of this program.i  J                An example DECnet and OSU scripting startup may be found inK                HT_ROOT:[EXAMPLE]. This should be called from or used within K                the HTTP server startup. It includes two logical definitionscF                required for common OSU scripts. Other tailoring may be1                required for specific OSU scripts.       N                                                               Scripting  13-23 r  e            %                OSU - General Comments   K                David Jones, the author of the DECthreads (OSU) HTTP server,oG                outlines his reasons for basing OSUs scripting on DECnet L                (reproduced from a USENET NEWS reply to a comment this author2                made about DECnet-based scripting).  Z                   ------------------------------------------------------------------------  L                   From           JONESD@er6.eng.ohio-state.edu (David Jones):                   Organization   The Ohio State University9                   Date           12 Aug 1997 09:04:11 GMT \                   Newsgroups     vmsnet.sysmgt,comp.os.vms,comp.infosystems.www.servers.miscO                   Message-ID     <5sp8ub$brs$1@charm.magnus.acs.ohio-state.edu>   Z                   ------------------------------------------------------------------------  +                    . . .  some text omittedb  S                   Since I was comfortable with DECnet, I based the scripting systemfS                   for the OSU server around it.    The key reasons to use netservert?                   processes rather than spawning sub-processes:e  U                       1. DECnet automatically caches and re-uses netserver processes,yY                          whereas there were well-known performance problems with spawningi'                          sub-processes.s  Z                       2. DECnet processes are detached processes, so you don't worry aboutV                          the effect of scripts consuming pooled quotas (e.g. bytlm) on1                          the HTTP server process.t  [                       3. Creation/connection with the DECnet server process is asynchronousra                          with respect to the server so other operations can proceed concurrently. ]                          Spawning is done in supervisor mode, blocking the server's operationgK                          until the child process is completely initialized.r  Y                       4. With DECnet, scripts can be configured to run on different nodes ,                          for load balancing.  U                       5. In addition to the standard 'WWWEXEC' object, you can createa\                          other 'persistent' DECnet objects that the server communicates with\                          as scripts. (this was implemented years before OpenMarket's FastCGI#                          proposal).T  Y                       6. CGI is not the be-all end-all of scripting.  The dialog phase ofgT                          OSU's scripting environment allows scripts to do things CGIZ                          is incapable of, such as ask the server to translate an arbitraryT                          path and not just what followed the script name in the URL.  Z                   People grouse all the time about the installation difficulties caused by]                   it's reliance on DECnet,  the reason shown above were cited to show that itn-                   wasn't made so capricously.W  +                    . . .  some text omittedp               13-24  Scripting /  F            N                   David L. Jones               |      Phone:    (614) 292-6929?                   Ohio State Unviversity       |      Internet: ^                   2070 Neil Ave. Rm. 122       |               jonesd@kcgl1.eng.ohio-state.eduL                   Columbus, OH 43210           |               vman+@osu.edu  =                   Disclaimer: Dogs can't tell it's not bacon.g  J                The OSU server's DECnet scripting is not based on arbitraryH                considerations. This author does not disagree with any ofK                the concerns, and as may be seen from WASD documentation the L                design of WASD also directly addresses points 1, 3 and 5 withH                the use of persistant subprocesses and CGIplus. CertainlyK                DECnet-based scripting addresses the very legitimate point 4 L                (and also allows nodes with specific resources to participateI                without installing full HTTP server environments). For all G                practical purposes point 2 may be addressed by adjusting J                process quotas. Point 6 is only too true (possibly at leastD                until Java servers and servlets become ubiquitous :^)  $                Known Working Scripts  L                The following is a list of OSU-specific scripts that the WASDJ                implementation has either been developed or tested against,M                and any installation notes or other WASD specifics. The author K                would like to know of any OSU scripts the WASD emulation has 3                problems or works successfully with.m  L                o  All of the scripts, etc. provided in the HT_ROOT:[SRC.OSU]+                   directory. These include:h                      o  cgi_symbols                     o  cgi-mailtol  !                   o  html_preproc                       o  set_dcl_env                     o  testcgi                     o  testformI                     o  tmail                      o  vmshelpgate                     o  webbook                  o  helpgate  F                   Comment out the Conan The Librarian mappings for theF                   "/help" path and provide the following in HTTPD$MAP:  N                                                               Scripting  13-25                 E                      # first make "/help" into a script specificationx5                      map /help* /htbin/helpgate/help*eJ                      # general rule mapping "/htbin" to OSU DECnet scripts<                      exec /htbin/* /0::"0=wwwexec"/cgi-bin/*O                      # map the non-script part of the path back to just "/help"g6                      pass /htbin/helpgate/help* /help*  L                   It is possible to support both HELP environments (althoughJ                   helpgate will not work without owning the "/help" path),J                   merely provide another mapping for Conan with a slightly.                   different path, for example:  '                      map /chelp /chelp/f5                      script /chelp/* /cgi-bin/conan/*z  $                o  HTML pre-processor  K                   Yes, backward compatibility can be provided for those old$G                   OSU .HTMLX files in your new WASD environment ;^) AllRH                   that is needed is a file type mapping to the script in6                   the HTTPD$CONFIG configuration file.                        [AddType]I                      .HTMLX  text/html  /htbin/html_preproc  OSU SSI HTMLS                  o  showtime                  o  mgmt               13.8.4 User Scriptsi  J                The WASD DECnet environment provides a simple mechanism forI                executing scripts within accounts other than the server's.rI                This allows configured users to write and maintain scriptseJ                within their own areas and have them execute as themselves.K                Both standard CGI and OSU scripting may be provided for with                 this facility.   H                Of course there is always a down-side. Be careful to whomK                this capability is granted. User scripts are executed withinnL                a user network-mode process created by DECnet. Script actionsL                cannot generally affect server behaviour, but they can accessK                any WORLD-readable and modify any WORLD-writable resource in0K                the system/cluster, opening a window for information leakage I                or mischievous/malicious actions. Script authors should be G                aware of any potential side-effects of their scripts andSG                Web administrators vigilant against possible destructive 8                behaviours of scripts they do not author.  H                User scripting is not enabled by default. To provide thisL                facility mapping rules into the user area must be provided inJ                much the same way as for user directories, See Section 8.7.               13-26  Scripting W  X            D                The "EXEC" rule provides a wildcard representation ofJ                users' script paths. As part of this mapping a subdirectoryJ                specifically for the web scripts should always be included.H                Never map users' top-level directories. For instance if aI                user's account home directory was located in the area WWW_SK                USER:[DANIEL] the following rule would potentially allow thetH                user DANIEL to provide scripts from the home subdirectoryJ                [.WWW.CGI-BIN] using the accompanying rules (first for CGI,'                second for OSU scripts):e  D                   exec /~*/cgi-bin/* /0""::/www_user/*/www/cgi-bin/*O                   exec /~*/osu-bin/* /0""::"0=wwwexec"/www_user/*/www/cgi-bin/*u  L                Scripts located in these directories are accessable via paths%                such as the following:   '                   /~daniel/cgi-bin/testt  $                Explicit User Account  K                Using mapping rules it is possible to explicitly specify the M                user account for a particular script or scripts to be executed H                within. This may be useful if an application has quota orJ                other resource requirements that are desired to be withheldM                from the HTTP server account (i.e. it can provide a measure of F                isolation between the server and application accounts).  M                   exec /whatever-bin/* /0"WHATEVER"::/whatever_root/cgi-bin/* X                   script /dowhatever/* /0"WHATEVER"::/whatever_root/cgi-bin/dowhatever/*                  Proxy AccessT  M                For each user account permitted to execute local scripts proxy H                access to that account must be granted to the HTTP server                account.l  F                Caution! If unsure of the security implications of thisI                action consult the relevant VMS system management securityd                documentation.e  *                   $ SET DEFAULT SYS$SYSTEM!                   $ MCR AUTHORIZEE?                   UAF> ADD /PROXY <node>::HTTP$SERVER <account>   H                For example, the following would allow the HTTP server to@                execute scripts on behalf of the username DANIEL.  7                   UAF> ADD /PROXY 0::HTTP$SERVER DANIELt    N                                                               Scripting  13-27 i  n                         13.9 Java Scripts   E                Java classes may be used to perform CGI scripting with K                WASD. They may be designed as standard CGI scripts (with the M                inevitable latency of the class loading) or as CGIplus scriptsS=                (with the attendant benefit of lower latency).S  H                Note that Java scripts must always be mapped and executedJ                using the CGIplus path, however some can behave as standardJ                CGI scripts, exiting after responding to the request, whileG                others can persist, responding to multiple requests (see J                Section 13.7). The CGIplus path is always necessary as JavaM                does not have direct access to a process' general environment,nH                the traditional way of passing CGI variables, so the WASDI                implementation uses the CGIplus data stream to provide CGIc                information.   K                WASD provides a class to allow a relatively simple interfaceDK                to the CGI environment for both GET and POST method scripts. M                This and a collection of demonstration scripts may be found ind0                the HT_ROOT:[SRC.JAVA] directory.  L                Developed using the first-release JDK1.1 beta kit for OpenVMS                Alpha V7.1.                  Requirementsd  L                o  Ensure the Java class file type is mapped to the Java run->                   time in the HTTPD$CONFIG configuration file.  '                      [DclScriptRunTime] 6                      .CLASS  @CGI-BIN:[000000]JAVA.COM  E                o  The following content types are configured, also inh                   HTTPD$CONFIG.                         [AddType]D                      .CLASS  application/octet-stream  -  Java class6                      .JAVA  text/plain  -  Java sourceD                      .JAR  application/octet-stream  -  Java archive@                      .PROPERTIES  text/plain  -  Java properties  G                o  The CGI-BIN logical includes the HT_ROOT:[JAVA] classi2                   directory in the server startup.  I                      $ JAVA_ROOT = F$TRNLNM("HT_ROOT") - ".]" + ".JAVA.]"E@                      $ DEFINE /SYSTEM /TRANSLATION=(CONCEALED) -G                               CGI-BIN 'EXE_ROOT','SCRIPT_LOCAL_ROOT', -n7                               'SCRIPT_ROOT','JAVA_ROOT'                13-28  Scripting i  /            /             13.10 HTTP Persistant-State Cookiesf  F                The WASD server is cookie-aware. That is, if the clientI                supplies a "Cookie:" request header line it is passed to a H                CGI script as "WWW_HTTP_COOKIE" CGI variable symbol. If aL                cookie is not part of the request this symbol does not exist.M                A script may use the "Set-Cookie:" response header line to set                 cookies.p  M                Here is a small demonstration of cookie processing using a DCLo                script.  /                <online hypertext demonstration>e                                                                          N                                                               Scripting  13-29                     M             Chapter__14______________________________________________________u               Cache     I                WASD HTTPd provides an optional, configurable, monitorable M                file data and revision time cache. File data, so that requestsiF                for documents can be fulfilled without reference to theK                underlying file system, potentially reducing request latency H                and more importantly improving overall server performanceJ                and system impact, and file revision time, so that requestsI                specifying an "If-Modified-Since:" header can also benefit                 from the above.  L                Note that it is a file-system cache. Only documents generatedH                from the file system are cached, not from any potentiallyH                dynamic sources, such as scripts, directory listings, SSIJ                documents, etc. The reason should be obvious. Only the fileM                system provides a reliable mechansim for ensuring the validitysL                of the cached data (i.e. has the original changed in some way                since loaded?)t  M                Files are cached according to mapped path (not necessarily the L                same path supplied with the request) and not by the file nameJ                represented by any path. This is a design decision targetedL                at avoiding any access to RMS before searching the cache. For@                example, the ambiguous reference to the directory                     /ht_root/   K                may result in the following file being accessed (due to home                 page resolution)o  +                   HT_ROOT:[000000]HOME.HTML   G                and the contents returned to the client and consequently E                cached. Each time the path "/ht_root/" is subsequentlyrH                requested it will be path hit and serviced from the cache1                entry without any recourse to RMS.o  L                Of course the same file may be requested with the unambigious                pathe  $                   /ht_root/home.html  L                which is completely different to the first instance, althoughH                ultimately accessing the same file. Hence one file may beE                cached multiple times against distinct paths. AlthoughnI                isolated instances of this are possible, the likelihood of(I                significant resources being consumed in practice should bei                quite low.   N                                                                    Cache  14-1 d  b            %                Why Implement Caching?-  F                Caching, in concept, attempts to improve performance byI                keeping data in storage that is faster to access than it's)M                usual location. The performance improvement can be assessed in -                three basic ways; reduction of   H                o  response when accessing the data (latency and transfer                   time)   2                o  processing involved (CPU cycles)  H                o  impact on the usual storage location (file system I/O)  J                This cache is provided to address all three. Where networksI                are particularly responsive a reduction in request latencypI                can often be noticable. It is also suggested a cache "hit"aH                may consume less CPU cycles than the equivalent access toI                the (notoriously expensive) VMS file system. Where serversrJ                are particularly busy or where disk subsystems particularlyG                loaded a reduction in the need to access the file systembI                can significantly improve performance while simultaneouslyeL                reducing the impact of the server on other system activities.K                The author's feeling is though, that for most VMS sites higheL                levels of hits are not a great concern, and for these cachingM                can easily be left disabled, particularly if the file system'ss,                virtual I/O cache is enabled.  H                A comparison between cached and non-cached performance is&                provided in Chapter 15.  L                Why take so long to implement caching? (introduced in versionG                4.5) Well, WASD's intranet services are not particularlyoH                busy sites. This coupled with powerful hardware has meantL                performance has not been an overriding concern. However, thisJ                cache module came about because I felt like creating it andM                it was an obvious lack of functionality within the server, not 9                because WASD (the organisation) needed it.                   Terminology  /                This is what is meant when used.g  M                o  "hit" refers to a request path being found in cache. If theoM                   data is still valid the request can be supplied from cache.r  I                o  "load"ing the cache refers to reading the contents of ao)                   file into cache memory.   L                o  "valid" means that the file from which the cached data wasM                   originally read has not had it's revision date changed (theiJ                   implication being is the file contents have not changed.               14-2  Cachet    t            1             14.1 Cache Suitability Considerations   L                A cache is not always of benefit! It's cost may outweigh it's                return.  L                Any cache's efficiencies can only occur where subsets of dataJ                are consistently being demanded. Although these subsets mayH                change slowly over time a consistent and rapidly changingE                aggregate of requests lose the benefit of more readilysG                accessable data to the overhead of cache management, dueeG                to the constant and continuous flushing and reloading ofnG                cache data. This server's cache is no different, it willsD                only improve performance if the site experiences someK                consistency in the files requested. For sites that have only K                a small percentage of files being repeatedly requested it is J                probably better that the cache be disabled. The other majorJ                consideration is available system memory. On a system whereJ                memory demand is high there is little value in having cacheM                memory sitting in page space, trading disk I/O and latency fortL                paging I/O and latency. On memory-challenged systems cache is&                probably best disabled.  I                To help assessment of the cache's efficiency for any giventC                site monitor the administration menu's cache report.d  H                Two sets of data provide complementary information, cache1                activity and file request profile.l  M                o  Activity information summarizes the cache search behaviour, 7                   in particular that of the hash table..  H                   The "searched" item, indicates the number of times theM                   cache has been searched. Most importantly, this may includepL                   paths that can never be cached because they represent non-M                   file requests (e.g. directory listings). Requests involving I                   scripts, and some others, never attempt a cache search.e  H                   The "hit" item, indicates the number of times the hashE                   table directly provided a cached path. This is very                    efficient.  I                   The "miss" item, indicates the number of times the hash I                   table directly indicated a path was not cached. This is 6                   decisive and is also very efficient.  L                   The "collision" item, indicates the number of times multi-M                   ple paths resolved to the same hash table entry. CollisionsnL                   require further processing and are far less efficient. TheM                   sub-items, "collision hits" and "collision misses" indicateHK                   the number of times that further processing resulted in ao0                   found or not-found cache item.  N                                                                    Cache  14-3                 I                   A large number of cache misses compared to searches maypK                   only indicate a large number of non-cachable requests and M                   so depending on that further datum is not of great concern. K                   A large proportion of collisions (say greater than 12.5%)hI                   is however, indicating either the hash table size needs I                   increasing (1024 should be considered a minimum) or the F                   hashing algorithm in the software need reviewing :^)  F                o  Files information summarizes the site's file request                   profile.  I                   With the "loads not hit" item, the count represents the J                   cumulative number of files loaded but never subsequentlyL                   hit. If this percentage is high it means most files loadedI                   are never hit, indicating the site's request profile isB2                   possibly unsuitable for caching.  J                   The item "hits" respresents the cumulative, total numberH                   of hits against the cumulative, total number of loads.K                   The percentage here can range from zero to many thousandseD                   of percent :^) with less than 100% indicating poorI                   cache performance and from 200% upwards better and goodDK                   performance. The items "1-9", "10-99" and "100+" show theeH                   count and percentage of total hits that occured when aM                   given entry had experienced hits within that range (e.g. if L                   an entry has had 8 previous hits, the ninth increments theJ                   "1-9" item whereas the tenth and eleventh increments the%                   "10-99" item, etc.)   D                   Other considerations also apply when assessing theK                   benefit of having a cache. For example, a high number and J                   percentage of hits can be generated while the percentageG                   of "loads not hit" could be in the also be very high.eI                   The explanation for this would be one or two frequently I                   requested files being hit while most others are loaded, L                   never hit, and flushed as other files request cache space.M                   In situations such as this it is difficult to judge whetheryJ                   cache processing is improving performance or just adding                   overhead.h                  Recommendation   L                Monitor the site's cache behaviour and adjust parameters from;                an assessment based on the guidelines above.   J                Again, the author's suggestion is, that for most VMS sites,K                high levels of access are not a great concern, and for these/3                caching can easily be left disabled.                  14-4  Cacheb v  p            )             14.2 Cache Content Validation   J                The cache will automatically revalidate the file data afterD                a specified number of seconds ([CacheValidateSeconds]G                configuration parameter), by comparing the original fileeK                revision time to the current revision time. If different theuI                file contents have changed and the cache contents declarediI                invalid. If found invalid the file transfer then continuesmL                outside of the cache with the new contents being concurrently'                reloaded into the cache.b  L                Cache validation is also always performed if the request usesM                "Pragma: no-cache" (i.e. as with the Netscape Navigator reloadAJ                function). Hence there is no need for any explicit flushingJ                of the cache under normal operation. If a document does notJ                immediately reflect any changes made to it (i.e. validationL                time has not been reached) validation (and consequent reload)5                can be "forced" with a browser reload.n  H                If a site's contents are relatively static the validationL                seconds could be set to an extended period (say 3600 seconds,G                one hour) and then rely on an explicit "reload" to forcee,                validation of a changed file.  H                The entire cache may be purged of cached data either fromJ                the server administration menu or using command line server3                control, as in the following example9  )                   $ HTTPD /DO=CACHE=PURGE   $             14.3 Cache Configuration  F                The cache is controlled using HTTPD$CONFIG file config-E                uration directives. A number of parameters control theGH                cache's behaviour. See the example configuration file HT_/                ROOT:[EXAMPLE]HTTPD$CONFIG.CONF.t  5                o  Cache enables and disables caching.C  H                o  CacheChunkKBytes sets the granularity of memory blocksM                   allocated to file data (in kilobytes). To reduce the numbersJ                   of, and possible blocks sizes of memory, being requestedL                   (potentially improving memory allocation performance) dataM                   allocated to cache is done in multiples of this chunk size.y  H                o  CacheEntriesMax and CacheTotalKBytesMax provide growthG                   limits to cache expansion. Maximum entries limits the L                   number of files loaded into the cache before entries beginH                   to be reused (flushing the original contents). MaximumK                   total kilobytes allocated to the cache provides a ceilingiK                   on the memory consumed. These parameters operate to limitpG                   each other (i.e. if one reaches it's limit before thepA                   other, the other will not grow further either).e  N                                                                    Cache  14-5 T  $            F                o  CacheFileKBytesMax provides a limit on file size (inH                   kilobytes). Files larger than the specified limit will"                   never be cached.  G                o  CacheFrequentHits and CacheFrequentSeconds attempt to I                   reduce unproductive reuse of cache entries by providing F                   the cache with some indication of what constitutes aG                   frequently hit entry. If it is frequently hit then itPI                   should not be immediately reused when there is a demandiF                   for cache space. The first parameter sets the numberH                   of hits an entry must sustain before being a candidateF                   for "CacheFrequentSeconds" assessment. If a file hasF                   been hit at least "CacheFrequentHits" times in totalJ                   and the last hit was within the number of seconds set byK                   "CacheFrequentSeconds" it will not be flushed and reused.PL                   If it has not been hit within the specified period it will                   be reused.  M                o  CacheHashTableEntries sets the size of the hash table, used M                   to rapidly index into the cached paths. Generally bigger isiL                   better (each entry consumes four bytes, hence 1024 entriesL                   consume 4096 bytes). Due to the hashing algorithm employedK                   the size should be in magnitudes of two (e.g. 1024, 2048,sL                   etc.), if not, the specified amount is rounded down to the-                   nearest (e.g. 1000 to 512).   G                o  CacheValidateSeconds The interval after which a cache H                   entry's original, content revision time is revalidatedK                   against the file's current revision time. If not the same I                   the contents are declared invalid and reloaded. SettingbM                   this to a greater period reduces disk I/O but revised filessH                   may not be obvious within an acceptable timer unless a8                   re-validation is forced with a reload.               14.4 Cache Control  E                The cache may be enabled, disabled and purged from theeG                server administration menu (see Chapter 11). In additionsK                the same control may be exercised from the command line (see #                Section 5.3.2) using   &                   $ HTTPD /DO=CACHE=ON'                   $ HTTPD /DO=CACHE=OFF )                   $ HTTPD /DO=CACHE=PURGE   L                If cache parameters are altered in the configuration file theK                server must be restarted to put these into effect. DisablingOG                the cache on an ad hoc basis (from menu or command line)uI                does not alter the contents in any way so it can merely belL                reenabled with use of the cache's previous contents resuming.               14-6  Cachee a  (            M                In this way comparisions between the two environments may morel                easily be made.                                                                                                N                                                                    Cache  14-7 o  e                M             Chapter__15______________________________________________________e               Server Performance    L                The server has a single-process, multi-threaded, asynchronousH                I/O design. On a single-processor system this is the mostL                efficient approach. On a multi-processor system it is limitedL                by the single process context (ignoring scripts which executeF                within their own context). An obvious improvement wouldG                be to have multi-processor threading or a pool of server I                processes, one per CPU, servicing requests. The latter maye5                be the approach of future refinements.t  K                The server has been tested with up to 30 concurrent requestsuL                originating from 6 different systems and continues to provideL                an even distribution of data flow to each client (albeit more                slowly :^)t  K                The test system was a lightly-loaded AlphaServer 2100 4/275, L                VMS v7.1 and DEC TCP/IP 4.2. No Keep-Alive: functionality wasM                employed so each request required a complete TCP/IP connectionmM                and disposal, although the WWWRKOUT utility (see Section 17.6)aJ                was used on the same system as the HTTP server, eliminatingI                actual network transport. DNS (name resolution) and access %                logging were disabled.h  L                Test results are all obtained using the native Digital TCP/IPE                Services executable. The NETLIB image may provide verytI                slightly lower results due to the additional NETLIB layer.o1                These results are indicative only!a                  OSU Comparisonc  H                Until v5.3 a direct comparison of performance between OSUK                and WASd had not been made (even to satisfy the author's own M                occasional curiosity). After a number of users with experiencemK                in both environments commented . . . WASD seemed faster, wasmM                it? . . . it was decided to make and provide comparisons usinge;                the same metrics used on WASD for some time.e  K                Every endeavour has been made to ensure the comparison is aseK                equitable as possible (e.g. each server executes at the same J                process priority, has a suitable cache enabled, runs on theI                same machine in the same relatively quiescent environment,lI                2 CPUs to allow OSU to take advantage of VMS V7.1's kernel J                threads). Each test run was interleaved between each serverK                to try and distribute any environment variations. The lowestp  N                                                       Server Performance  15-1 v  s            J                measurements averaged out of a number of runs were used forI                each. Tests showing /PORT=7777 were to the OSU server, anyw                others to WASD.  I                Of course performance is just one of a number of consider- H                ations in any software environment (otherwise we wouldn'tI                be using VMS now would we? ;^) No specific conclusions are J                promoted by the author. Readers may draw their own from the&                results recorded below.  0             15.1 Simple File Request Turn-Around  L                A series of tests using batches of 200 accesses were made andJ                the results averaged. The first test returned an empty fileJ                measuring response and file access time, without any actualG                transfer. The second requested a file of 64K characters, K                testing performance with a more realistic scenario. All werehK                done using one and then ten concurrent requests. For clarity L                the command lines for the ten-simultaneous test are not shownK                below (but are of course just a variation). Two sets of data J                are reported, one with caching disabled, the other enabled.  P                   $ WWWRKOUT /SIM=1 /NOBREAK /NOVARY /NOHEAD /NOOUT /COUNT=200 -2                   /PATH="/ht_root/exercise/0k.txt"P                   $ WWWRKOUT /SIM=1 /NOBREAK /NOVARY /NOHEAD /NOOUT /COUNT=200 -3                   /PATH="/ht_root/exercise/64k.txt"aP                   $ WWWRKOUT /SIM=1 /NOBREAK /NOVARY /NOHEAD /NOOUT /COUNT=200 -=                   /PATH="/ht_root/exercise/0k.txt" /PORT=7777fP                   $ WWWRKOUT /SIM=1 /NOBREAK /NOVARY /NOHEAD /NOOUT /COUNT=200 ->                   /PATH="/ht_root/exercise/64k.txt" /PORT=7777  M                The following results were derived using the WASD v5.3 and OSUe                3.3a servers.  ?                                Cache Disabled - Requests/Second   M                ______________________________________________________________ M                Response____Concurrent__WASD________OSU_______________________m  7                0K          1           75.7        44.0o  7                0K          10          98.0        56.7n  7                64K         1           24.7        10.6.  M                64K_________10__________35.5________15.9______________________   >                                Cache Enabled - Requests/Second    $             15-2  Server Performance o  e          M                ______________________________________________________________ M                Response____Concurrent__WASD________OSU_______________________   7                0K          1           227.3       51.4   7                0K          10          263.1       55.9s  7                64K         1           40.4        20.0t  M                64K_________10__________45.9________23.4______________________e  F                Significantly, with both WASD cached and non-cached (asH                with OSU), throughput actually improves at ten concurrentI                requests (probably due to the latency of the serial TCP/IP J                connection/disconnection in one-by-one, compared to several'                happening concurrently).   M                Note that the response and transfer benefits decline noticablytE                with file size (transfer time). The difference betweenhL                cached and non-cached with the zero file size (no actual dataM                transfer involved) gives some indication of the raw difference H                in response latency, some 200-300% improvement. This is aL                fairly crude analysis, but does give some indication of cache                efficiencies.  !                File Transfer Ratei  M                Under similar conditions results indicate a potential transferiI                rate well in excess of 1 Mbyte per second. (Remember, both E                client and server are on the same system, so the data, F                although being transported by TCP/IP networking, is notI                actually ending up out on a physical network.) This serveseH                to demonstrate that server architecture should not be theJ                limiting factor in file throughput. For clarity the commandJ                line for the ten-simultaneous test are not shown below (but/                are of course just a variation).i  O                   $ WWWRKOUT /SIM=1 /NOBREAK /NOVARY /NOHEAD /NOOUT /COUNT=10 -h;                   /PATH="/sys$common/sysexe/tnt$server.exe"eO                   $ WWWRKOUT /SIM=1 /NOBREAK /NOVARY /NOHEAD /NOOUT /COUNT=10 - F                   /PATH="/sys$common/sysexe/tnt$server.exe" /PORT=7777  M                The following results were derived using the WASD v5.3 and OSU                 3.3a servers.  >                                 Transfer Rate - MBYTES/Seconds  M                ______________________________________________________________uM                Response______________Concurrent__WASD________OSU_____________u  A                2.4MB (4700 blocks)   1           3.10        1.39e  N                                                       Server Performance  15-3 o  n          M                ______________________________________________________________ M                Response______________Concurrent__WASD________OSU_____________   M                2.4MB_(4700_blocks)___10__________3.17________1.73____________   K                Significantly, there were no dramatic drops in transfer rateiH                between one and ten concurrent requests! In fact an small&                increase in throughput!    !                File Record Format   H                The server can handle STREAM, STREAM_LF, STREAM_CR, FIXEDK                and UNDEFINED record formats very much more efficiently thanh%                VARIABLE or VFC files.e  G                With STREAM, FIXED and UNDEFINED files the assumption iseI                that HTTP carriage-control is within the file itself (i.e.fJ                at least the newline (LF), all that is required required byJ                browsers), and does not require additional processing. WithH                VARIABLE record files the carriage-control is implied andJ                therefore each record requires additional processing by theJ                server to supply it. Even with variable record files havingI                multiple records buffered by the HTTPd before writing them K                collectively to the network improving efficiency, stream andeH                binary file reads are by Virtual Block and are written toH                the network immediately making the transfer of these very                 efficient indeed!  L                So significant is this efficiency improvement a module existsJ                to automatically convert VARIABLE record files to STREAM-LFM                when detected by the file transfer module. This is disabled by K                default but the user is strongly encouraged to enable it and L                to ensure that stream format files are provided to the serverG                by other hypertext generating and processing utilitites.                15.2 Scripting  L                Persistant-subprocesses are probably the most efficient solu-L                tion for child-process scripting under VMS. See Section 13.2.G                The I/O still needs to be on-served to the client by theh                server.  H                A simple performance evaluation shows the relative meritsI                of the three WASD scripting environments available, plus a"L                comparison with OSU3.3a. All were obtained using the WWWRKOUTM                utility (see Section 17.6) accessing the same CGI test utility I                script, HT_ROOT:[SRC.CGIPLUS]CGIPLUSTEST.C, which executesmI                in both standard CGI and CGIplus environments. A series ofmG                200 access were made and the results averaged. The first I                test returned only the HTTP header, evaluating raw requesteH                turn-around time. The second test requested a body of 64K  $             15-4  Server Performance ,               J                characters, again testing performance with a more realistic                scenario.  K                DECnet-based scripting was tested using essentially the same M                environment as subprocess-based CGI, assessing the performance K                of the same script being executed using DECnet to manage the J                processes. Three separate environments have been evaluated,K                WASD-DECnet-CGI, WASD-OSU-emulation and OSU3.3a. The OSU3.3anM                script used the WASD CGISYM.C utility to generate the requiredoJ                CGI symbols (also see WASD/OSU Comparison). DECnet Phase-IV                was in use.  J                For clarity the command lines for the ten-simultaneous testH                are not shown below (but are of course just a variation).  P                   $ WWWRKOUT /SIM=1 /NOBREAK /NOVARY /NOHEAD /NOOUT /COUNT=200 -0                   /PATH="/cgi-bin/cgiplustest?0"P                   $ WWWRKOUT /SIM=1 /NOBREAK /NOVARY /NOHEAD /NOOUT /COUNT=200 -2                   /PATH="/cgi-bin/cgiplustest?800"P                   $ WWWRKOUT /SIM=1 /NOBREAK /NOVARY /NOHEAD /NOOUT /COUNT=200 -4                   /PATH="/cgiplus-bin/cgiplustest?0"P                   $ WWWRKOUT /SIM=1 /NOBREAK /NOVARY /NOHEAD /NOOUT /COUNT=200 -6                   /PATH="/cgiplus-bin/cgiplustest?800"P                   $ WWWRKOUT /SIM=1 /NOBREAK /NOVARY /NOHEAD /NOOUT /COUNT=200 -/                   /PATH="/decnet/cgiplustest?0" P                   $ WWWRKOUT /SIM=1 /NOBREAK /NOVARY /NOHEAD /NOOUT /COUNT=200 -1                   /PATH="/decnet/cgiplustest?800"fP                   $ WWWRKOUT /SIM=1 /NOBREAK /NOVARY /NOHEAD /NOOUT /COUNT=200 -1                   /PATH="/htbin/cgiplustestosu?0" P                   $ WWWRKOUT /SIM=1 /NOBREAK /NOVARY /NOHEAD /NOOUT /COUNT=200 -3                   /PATH="/htbin/cgiplustestosu?800" P                   $ WWWRKOUT /SIM=1 /NOBREAK /NOVARY /NOHEAD /NOOUT /COUNT=200 -9                   /PATH="/htbin/cgiplustest?0" /PORT=7777eP                   $ WWWRKOUT /SIM=1 /NOBREAK /NOVARY /NOHEAD /NOOUT /COUNT=200 -;                   /PATH="/htbin/cgiplustest?800" /PORT=7777i  M                The following results were derived using the WASD v5.3 and OSUe                3.3a servers.  >                                CGI Scripting - Requests/Second  M                ______________________________________________________________ @                                                    DECnet-  OSU-M                Response_ConcurrenCGI______CGIplus__CGI______emul_____OSU_____   H                0KB      1        16.7     59.4     8.8      7.5      6.9  I                0KB      10       25.5     83.0     14.8     12.3     10.1   H                64KB     1        11.7     23.1     7.5      6.5      5.7  N                                                       Server Performance  15-5 e  u          M                ______________________________________________________________ @                                                    DECnet-  OSU-M                Response_ConcurrenCGI______CGIplus__CGI______emul_____OSU_____4  M                64KB_____10_______9.8______15.7_____10.9_____9.2______8.7_____l                    Observationss  G                Although these results are indicative only, they do showiH                CGIplus to have a potential for improvement over standardJ                CGI in the order of 300%, a not inconsiderable improvement.J                Of course this test generates the output stream very simplyD                and efficiently and so excludes any actual processingH                time that may be required by a "real" application. If theK                script/application has a large activation time the reductionrL                in response latency could be even more significant (e.g. Perl2                scripts and RDMS access languages).  "                DECnet Observations  J                This section comments on non-persistant scripts (i.e. thoseL                that must run-up and run-down with each request - general CGIM                behaviour). Although not shown here measurements of connection I                reuse show significant benefits in reduced response times, M                consistency of response times and overall thoughput, showing a K                difference of some 200% over non-reuse (similar improvementst7                were reported with the OSU 3.3a server).   D                With ten simultaneous and back-to-back scripts and noI                connection reuse many more network processes are generatedeL                than just ten. This is due to the NETSERVER maintenance tasksL                such as log creation and purging, activating and deactivatingK                the task, etc., adding latency into this script environment.hM                The throughput was generally still lower than with subprocess-                 based scripting.   J                While earlier versions cautioned on the use of DECnet-basedJ                scripting this has been relaxed somewhat through connection                reuse._  "                WASD/OSU Comparison  J                A direct comparison of CGI performance between WASD and OSUI                scripting is biased in favour of WASD, as OSU scripting is.G                based on it's own protocol with CGI behaviour layered-inaL                above scripts that require it. Therefore a non-CGI comparisonI                was devised. The script, HT_ROOT:[SCRIPT]FACE2FACE.COM, ishH                designed to favour neither environment, merely return theA                plain-text string "Hello!" as quickly as possible.e  $             15-6  Server Performance l  e            `                   $! OSU and WASD scripting face-to-face in a script that favours neither unduly>                   $ if f$type(WWWEXEC_RUNDOWN_STRING) .nes. ""                   $ then2                   $    write net_link "<DNETTEXT>"3                   $    write net_link "200 Success" .                   $    write net_link "Hello!"3                   $    write net_link "</DNETTEXT>"                    $ else0                   $    write sys$output "Hello!"                   $ endifo  J                For clarity the command lines for the ten-simultaneous testH                are not shown below (but are of course just a variation).  P                   $ WWWRKOUT /SIM=1 /NOBREAK /NOVARY /NOHEAD /NOOUT /COUNT=200 -,                   /PATH="/cgi-bin/face2face"P                   $ WWWRKOUT /SIM=1 /NOBREAK /NOVARY /NOHEAD /NOOUT /COUNT=200 -+                   /PATH="/decnet/face2face" P                   $ WWWRKOUT /SIM=1 /NOBREAK /NOVARY /NOHEAD /NOOUT /COUNT=200 -*                   /PATH="/htbin/face2face"P                   $ WWWRKOUT /SIM=1 /NOBREAK /NOVARY /NOHEAD /NOOUT /COUNT=200 -5                   /PATH="/htbin/face2face" /PORT=7777e  M                The following results were derived using the WASD v5.3 and OSUd                3.3a servers.  >                                 Face-to-Face - Requests/Second  M                ______________________________________________________________e@                                                    DECnet-  OSU-M                _________ConcurrenCGI______CGIplus__CGI______emul_____OSU_____r  I                "Hello!" 1        31.0     n/a      14.6     25.3     18.4m  M                "Hello!"_10_______53.8_____n/a______21.3_____36.6_____20.7____t               15.3 SSL  G                At this time there are no definitive measurements of SSL F                performance (see Chapter 10), as work on an SSL versionG                of the WWWRKOUT utility has not yet been undertaken. One J                might expect that because of the CPU-intensive cryptographyL                employed in SSL requests that performance, particularly whereJ                concurrent requests are in progress, would be significantlyK                lower. In practice SSL seems to provide more-than-acceptableu                responsiveness.        N                                                       Server Performance  15-7 .                            15.4 Suggestions  M                Here are some suggestions for improving the performance of thenM                server, listed in approximate order of significance. Note thatiI                these will have proportionally less impact on an otherwisea%                heavily loaded system.s  G                1. Disable host name resolution (configuration parameter G                   [DNSLookup]). DNS latency can slow request processingaL                   significantly! Most log analysis tools can convert numericM                   addresses so DNS resolution is often an unnecessary burden.   I                2. Ensure served files are not VARIABLE record format (see K                   above). Enable STREAM-LF conversion using a value such as ;                   250 (configuration parameter [StreamLF]).   H                3. Use persistant-subprocess DCL/scripting (configuration-                   parameter [ZombieLifeTime])u  @                4. Use CGIplus-capable scripts whenever possible.  C                5. Enable caching (configuration parameter [Cache]).   F                6. Disable logging (configuration parameter [Logging]).  L                7. Set the HTTP server process priority higher, say to 6 (use0                   startup qualifier /PRIORITY=).  K                8. Reduce to as few as possible the number of mapping rules.=  L                9. Use a pre-defined log format (e.g. "common", configuration)                   parameter [LogFormat]).   G               10. Disable request history (configuration parameter [Re- !                   questHistory]).e  F               11. Disable activity statistics (configuration parameter"                   [ActivityDays]).                        $             15-8  Server Performance s  e                M             Chapter__16_______________________________________________________               HTTPd Web Update    M                The Update facility allows Web documents and file environments J                to be administered from a standard browser. This capabilityM                is available to Web administrator and user alike. Availability M                and capability depends on the authorization environment within                 the server.  H                It should be stressed that this is not designed as a fullK                hypertext administration or authoring tool, and for document_D                preparation relies on the editing capabilities of theH                <TEXTAREA> widget of the user's browser. It does however,M                allow ad-hoc changes to be made to documents fairly easily, as K                well as allowing documents to be deleted, and directories toK&                be created and deleted.  I                Consult the current Update documentation for usage detail.n  &                <online hypertext link>  '                Update Access Permissionr  G                If SSL is in use (see Chapter 10) then username/passwordPM                privacy of the authorization environment is inherently securedlG                via the encrypted communications. To restrict web updateeI                functionality to this secure environment add the followinge3                to the HTTPD$MAP configuration file:   ;                   /upd/*  "403 Access denied."  ![sc:https]a  G                Of course, the user must have write (POST/PUT) access todI                the document or area on the server (i.e. the path) and theTK                server account have file system permission to write into the                  parent_directory.  G                The server will report "Insufficient privilege or objectcK                protection violation ... /path/document" if it does not have @                file system permission to write into a directory.  K                Also see Section 9.8 for information on write access controle&                for the server account.        N                                                         HTTPd Web Update  16-1                     M             Chapter__17______________________________________________________i               Utilitiesy    M                Foreign commands for external utilities (and the HTTPD control K                functionality) will need to be assigned in the adminstration E                users' LOGIN.COM. Alternatives should be used when the A                environment supported through NETLIB. For example:   *                   HTTPD == "$HT_EXE:HTTPD"2                   !HTTPD == "$HT_EXE:HTTPD_NETLIB"0                   HTTPDMON == "$HT_EXE:HTTPDMON"8                   !HTTPDMON == "$HT_EXE:HTTPDMON_NETLIB"0                   STREAMLF == "$HT_EXE:STREAMLF"0                   WWWRKOUT == "$HT_EXE:WWWRKOUT"8                   !WWWRKOUT == "$HT_EXE:WWWRKOUT_NETLIB"               17.1 Echo Facility  J                Ever had to go to extraordinary lengths to find out exactlyE                what your browser is sending to the server? The server H                provides a request echo facility. This merely returns theJ                complete request as a plain-text document. This can be usedJ                for for checking the request header lines being provided byJ                the browser, and can be valuable in the diagnosis of POSTed                forms, etc.  J                This facility must be enabled through a mapping rule entry.  (                   script /echo/* /echo/*  G                It may then be used with any request merely by insertinguM                "/echo" at the start of the path, as in the following example.   ?                   http://wasd.dsto.defence.gov.au/echo/ht_root/F               17.2 Where Facilitye  H                Need to locate where VMS has the HTTPd files? This simpleI                facility maps the supplied path then parses it to obtain aaJ                resulting VMS file specification. This does not demonstrate0                whether the path actually exists!  J                This facility must be enabled through a mapping rule entry.  *                   script /where/* /where/*  N                                                                Utilities  17-1 i  l            G                It may then be used with any request merely by insertingeE                "/where" at the start of the path, as in the followingw                example.   @                   http://wasd.dsto.defence.gov.au/where/ht_root/               17.3 Xray Facility  L                The Xray facility returns a request's complete response, bothK                header and body, as a plain text document. Being able to see K                the internals of the response header as well as the contents L                of the body rendered in plain text can often be valuable when'                developing scripts, etc.u  J                This facility must be enabled through a mapping rule entry.  (                   script /Xray/* /Xray/*  G                It may then be used with any request merely by insertingbM                "/xray" at the start of the path, as in the following example.r  ?                   http://wasd.dsto.defence.gov.au/xray/ht_root/o  !             17.4 StreamLF Utilityo  L                This utility converts VARIABLE format files to STREAM_LF. TheM                WASD HTTPd server access STREAM_LF files in block/IO-mode, far J                more efficiently that the record-mode required by variable-L                record format files. Use "STREAMLF/HELP" for some basic usage                information.U  H                NOTE  This server can also be configured to automaticallyH                convert any VARIABLE record format files it encounters to                STREAM_LF.S               17.5 HTTPd Monitor  K                The HTTP server may be monitored using the HTTPDMON utility.2I                This utility continuously displays a screen of informations)                comprising three sections:   %                1. Process InformationtJ                   HTTPd process information includes its up-time, CPU-timeH                   consumed (excluding any subprocesses), I/O counts, and%                   memory utilization.   !                2. Server CountersCI                   The server counters keep track of the total connectionseM                   received, accepted, rejected, etc., totals for each requestoH                   type (file transfer, directory listing, image mapping,                   etc.).               17-2  Utilitiesa ,                                3. Latest RequestE                   This section provides the response status code, andMJ                   some transaction statistics, the service being accessed,K                   originating host and HTTP request. Note that long request K                   strings may be truncated (indicated by a bolded elipsis).   I                The following shows example output (after overnight server                 testing):                                                                                    N                                                                Utilities  17-3 2  -            ]                  Port: 80   HTTPDMON v1.8.0 AXP (HTTPd v5.3)   Thursday, 19-NOV-1998 07:50:44/  D                  Process: HTTPd:80  PID: 204035CD  User: HTTP$SERVERG                       Up: 0 14:09:23.71  CPU: 0 06:30:49.59  Restart: 0OY                  Pg.Flts: 600  Pg.Used: 4%  WsSize: 11680 (5840kB)  WsPeak: 7584 (3792kB) V                      AST:    4/600   BIO:    2/512   BYT:      0/145696  DIO:    0/512V                      ENQ:    1/600   FIL:    2/100   PRC:      0/50       TQ:    0/200  \                  Connect: 209681  SSL: 0 (0%)  Acc/Rej/Bsy: 209681 / 0 / 0  Cur/Peak: 0 / 15U                    Parse: 225411  Error: 0  Forbidden: 0  Redirect-Rem/Loc: 1 / 15729iF                   DELETE: 0  GET: 203521  HEAD: 21887  POST: 3  PUT: 0M                    Admin: 0  Cache: 0 / 104831 (0)  DECnet-CGI/OSU: 0 - 0 / 08a                      DCL: 34681  CGI/plus: 20971 / 20968 (20819)  Spawn/Cur: 1611 / 0  Dir: 10483 U                     File: 5242 (0)  IsMap: 0  Menu: 0  Put: 3  SSI: 26208  Upd: 15737B  S                      1xx: 0  2xx: 196993  3xx: 1  4xx: 10487  5xx: 2209  (0 errors)0@                       Rx: 18,388,687  Tx: 2,086,659,608  (bytes)  V                     Time: 19 04:27:45  Status: 200  Rx: 92  Tx: 25678  Duration: 7.204A                  Service: http://beta.wasd.dsto.defence.gov.au:80_I                     Host: beta.wasd.dsto.defence.gov.au (131.185.250.201) ;                  Request: GET /ht_root/exercise/shtml.shtmlo  D                The "/HELP" qualifier provides a brief usage summary.  H                This information is, in part, obtained from the following                logical names:   "                o  HTTPDport$COUNT1  "                o  HTTPDport$COUNT2                  o  HTTPDport$PID   #                o  HTTPDport$REQUEST   G                The server counter values are carried over when a server_G                (re)starts (provided the system has stayed up). To reset K                the counters use the on-line server administration menu (see_                Chapter 11).I  J                If [DNSlookup] is disabled for the HTTP server the HTTPDMONJ                utility attempts to resolve the numeric address into a hostI                name. This may be disabled using the /NORESOLVE qualifier.   -             17.6 Server Workout (stress-test)e  K                The WWWRKOUT ("World Wide Web Workout") utility exercises anvH                HTTP server, both in the number of concurrent connectionsF                maintained and in the number of back-to-back sequentialI                connection requests and data transfers. A native UCX imagef8                and a separate NETLIB image are provided.               17-4  Utilities                  H                This utility can be used to stress-test the WASD VMS HTTPG                server (or any other), or to make comparisons between it J                and other servers. When stress-testing a server, evaluatingG                performance or just using it to try and break a test-bed H                server, it is best used from multiple, autonomous systems                concurrent.  H                It sets up and maintains a specified number of concurrentK                connections to a server. It reads a buffer of data from eacheJ                connection in turn, where data is waiting (does not block),I                until the document transfer is complete and the connectionoE                closed by the server. It then closes the local end andyI                immediately reuses the now-free socket to initiate anotheriL                sequence. If enabled (it is by default), the utility attemptsJ                to reflect the real-world in varying the data transfer rateG                for each connection, by setting the number of bytes read I                during each read loop differently for each connection. Allp,                transfered data is discarded.  F                The data transfer rate for each connection is displayedH                at connection close. It is by default it is the effectiveJ                transfer rate, that is the rate from opening the connectionK                to closing it, and so includes request processing time, etc.oJ                If the "/NOEFFECTIVE" qualifier is employed it measures the0                document data transfer rate only.  F                Although a single document path may be specified on theJ                command line it is preferable to supply a range of documentK                paths, one per line in a plain text file. Each document pathtJ                and/or type specified should be different to the others, toM                exercise the server and file system cache. Any number of pathstL                may be specified in the file. If the file is exhausted beforeL                the specified number of connections have been established theK                file contents are recycled from the first path. If a path orSL                a file of paths is not specified the utility just continually-                requests the welcome document.   K                To assess a server's total throughput choose paths that lead K                to large documents (> 50K), where the overhead of connectioneF                setup, rule processing and transfer initiation are lessI                significant than the data transfer itself. The buffer size/M                variation functionality should be disabled using the "/NOVARY" K                qualifier when assessing data transfer rates. Responsiveness E                is better assessed using small documents (< 2K), where G                the overhead of the non-data-transfer activities is moret                significant.   E                WWWRKOUT [server_host_name[:port]] [path] [qualifiers]   J                o  /[NO]BREAK will randomly break a small number of connec-M                   tions during the data transfer (tests server recovery underr&                   those circumstances)  N                                                                Utilities  17-5 _  _            K                o  /BUFFER= number of bytes to be read from server each time K                   (default is 1024, will be modified by the default "/VARY"                    qualifier)  M                o  /COUNT= total number of connections and requests to be done_"                   (default is 100)  L                o  /[NO]EFFECTIVE measures data transfer rate from request toJ                   close (if "/NOEFFECTIVE" is applied the rate is measured+                   during data transfer only   B                o  /FILEOF= file name containing paths to documents  7                o  /HELP display brief usage informationy  /                o  /OUTPUT= file name for outputo  @                o  /PATH= single path to document to be retrieved  F                o  /PORT= IP port number of HTTP server (default is 80)  0                o  /SERVER= HTTP server host name  M                o  /SIMULTANEOUS= number of simultaneous connections to be set 4                   up at any one time (default is 10)  G                o  /[NO]VARY varies the size of the read buffer for eachi.                   connection (default is vary)                  Examples:                     $ WWWRKOUT=                   $ WWWRKOUT www.server.host "/web/home.html" C                   $ WWWRKOUT www.server.host:8080 /FILEOF=PATHS.TXT1b                   $ WWWRKOUT /SERVER=www.server.host /PORT=8080 /NOBREAK /NOVARY /FILEOF=PATHS.TXTX                   $ WWWRKOUT www.server.host:8080 /FILEOF=PATHS.TXT /NOEFFECTIVE /NOVARY_                   $ WWWRKOUT www.server.host /FILEOF=PATHS.TXT /COUNT=500 /SIMUL=20 /BUFFER=512   D                The "/HELP" qualifier provides a brief usage summary.                                   17-6  Utilitiesc