home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 35 Internet / 35-Internet.zip / goinf252.zip / GoServe.INF (.txt)
OS/2 Help File  |  2001-07-24  |  116KB  |  3,101 lines

  1.  
  2. ΓòÉΓòÉΓòÉ 1. Credits ΓòÉΓòÉΓòÉ
  3.  
  4.                    GoServe -- A Web and Gopher Server for OS/2
  5.                    """""""""""""""""""""""""""""""""""""""""""
  6.                                       GoServe 2.52
  7.  
  8.         Copyright (c) IBM Corporation, 1993, 1998.  All rights reserved.
  9.                        Mike Cowlishaw, IBM UK Laboratories
  10.                                  mfc@uk.ibm.com
  11.                                     - - - - -
  12.  
  13. About 
  14.  
  15.  
  16. ΓòÉΓòÉΓòÉ 2. Introduction ΓòÉΓòÉΓòÉ
  17.  
  18. Two popular protocols for providing information on the Internet are the 
  19. HyperText Transfer Protocol (HTTP, used by World Wide Web clients) and Gopher 
  20. (used by both Web and Gopher clients). 
  21.  
  22. 'GoServe' is a multi-purpose server for OS/2 which supports both these 
  23. protocols.  The emphasis in the design of GoServe has been to make it easy to 
  24. become an information provider for the Internet, while not inhibiting full use 
  25. of the protocols by sophisticated users. 
  26.  
  27. Providing that you already have TCP/IP installed, GoServe can be running and 
  28. serving files across a network in minutes; no re-boot or editing of 
  29. configuration files is necessary.  The GoServe package includes 'quick start' 
  30. instructions and working samples for both Web and Gopher servers. 
  31.  
  32. GoServe processes requests from Web or Gopher clients using a Rexx script to 
  33. allow for customization.  A server can handle requests from many clients, using 
  34. OS/2 threads and script caching for efficiency. Multiple servers can be started 
  35. (using different ports), and an audit trail of requests and actions can be 
  36. recorded.  When running as a Web server, much of the complexity of the Web 
  37. protocol is handled automatically; many GoServe users will only need to be 
  38. concerned about the data being provided, and need not be concerned about the 
  39. mechanism. 
  40.  
  41. While running, a graphical display of GoServe activity is shown (the "Graphical 
  42. Webspinner Interface"?), with optional response-time graphing and audible 
  43. indication of connections.  For control, various restrictions may be employed 
  44. to limit the load on the server machine. GoServe operations can be controlled 
  45. remotely, if desired, using any Web client (or an OS/2 CMD program). 
  46.  
  47. GoServe is a 32-bit OS/2 application, which requires OS/2 2.x or OS/2 Warp. 
  48. GoServe requires IBM TCP/IP for OS/2, or equivalent, to be installed and 
  49. operational (either on a real network or using the loopback driver).  GoServe 
  50. may be used as both a Web server and a Gopher server on the same server 
  51. machine, on one or more ports for each, if required. 
  52.  
  53.  
  54. ΓòÉΓòÉΓòÉ 3. Getting started ΓòÉΓòÉΓòÉ
  55.  
  56. This document describes all aspects of the use of GoServe as a Web or Gopher 
  57. server.  If you are a new user, you should first read one of: 
  58.  
  59.      GoHTTP.doc -- for getting started setting up a Web server 
  60.  
  61.      GoGopher.doc -- for getting started setting up a Gopher server. 
  62.  
  63.  Both of these guide you through setting up a working server.  It's recommended 
  64.  that you do this before reading more of the technical details in this 
  65.  document.  This document assumes that you are familiar with Web or Gopher 
  66.  concepts, and have access to (and know how to use) a Web or Gopher client. 
  67.  
  68.  
  69. ΓòÉΓòÉΓòÉ 3.1. --- Resources --- ΓòÉΓòÉΓòÉ
  70.  
  71. This document, the latest GoServe package, and other relevant links, 
  72. information, and programs are available at the GoServe Web page at: 
  73. http://www2.hursley.ibm.com/goserve/ 
  74.  
  75. Several GoServe users have contributed some very useful extensions to GoServe, 
  76. and there's a mailing list too.  See, for example: 
  77.  
  78.      Don Meyer's CGI, Image Map, and forms support for GoServe, at: 
  79.         http://w3.ag.uiuc.edu/DLM/GoHTTP/GoHTTP.html 
  80.  
  81.      Lew Waber's mail support and other enhancements, at: 
  82.         http://lwaber.swmed.edu/goserve.htm 
  83.  
  84.      Daniel Hellerstein's SRE-http filter, with CGI, redirection, server side 
  85.       includes, multiple realms and hosts, HTTP 1.1 support, etc., at: 
  86.         http://rpbcam.econ.ag.gov/srefilter 
  87.  
  88.      The OS/2 Forum Austria Extended GoServe Filter, at: 
  89.         http://www.os2forum.or.at/software/local/ofaegf/ 
  90.  
  91.      Ken Kavanagh's GoServe mailing list; the place to 'meet' other GoServe 
  92.       users and share GoServe hints and tips; for details, see: 
  93.         http://www.lionsgate.com/lists/goserve/ 
  94.  
  95.  All of these are linked from the main GoServe page. 
  96.  
  97.  
  98. ΓòÉΓòÉΓòÉ 4. How GoServe is used ΓòÉΓòÉΓòÉ
  99.  
  100. GoServe is an ordinary 32-bit OS/2 application program (it has no special 
  101. privileges, and uses only public interfaces to OS/2 and to TCP/IP).  When 
  102. starting GoServe, you should specify as a parameter the protocol that the 
  103. server is to use (HTTP or GOPHER). 
  104.  
  105. Once started, GoServe sets up a TCP/IP socket on the 'well-known' port for the 
  106. protocol selected (this can be altered using a different startup parameter), 
  107. then waits for requests from clients.  When a request from a client arrives, it 
  108. is recorded in the audit file (if desired) and then the GoServe filter for the 
  109. port is called. 
  110.  
  111. The GoServe filter is a program written in Rexx, which is given details of the 
  112. client and the request string.  The filter decides on the information (usually 
  113. a file, containing a document or other data) to be sent to the client, and 
  114. returns details to GoServe.  GoServe then sends the HTTP response and the data 
  115. to the client and closes the TCP/IP connection. 
  116.  
  117. Each incoming request is given a new OS/2 thread for communication, filter 
  118. processing, and response.  GoServe handles all the details of threads and 
  119. TCP/IP communications, so you need only be concerned with the filter (which can 
  120. often simply be the sample filter, unchanged) and the data (documents, images, 
  121. etc.). 
  122.  
  123. GoServe is designed to perform well, even on inexpensive hardware.  Some of the 
  124. default settings, however, are chosen for safety rather than best performance. 
  125. To maximise performance and throughput, you may wish to turn on File command 
  126. caching, Connection maintenance, and Lazy auditing (see below for details). 
  127. GoServe also runs faster with its display window minimized. 
  128.  
  129.  
  130. ΓòÉΓòÉΓòÉ 5. Installation ΓòÉΓòÉΓòÉ
  131.  
  132. If you followed either of the 'getting started' documents, you will have 
  133. already installed GoServe.  In general, only two files (plus data) are needed 
  134. to run GoServe as a Web or Gopher server: the GOSERVE.EXE program file, and the 
  135. appropriate Rexx filter.  The default filter name has filename GOFILTER, with 
  136. an extension that is the TCP/IP port number to be used (for example, 
  137. 'GOFILTER.80' for the filter for a default Web server, or 'GOFILTER.70' for the 
  138. filter for a Gopher server).  The filter must be in the working directory for 
  139. GoServe. 
  140.  
  141. It is recommended that GOSERVE.EXE and the Rexx filter be placed in one 
  142. directory (for example, 'D:\GoServe'), and data for the server be placed in a 
  143. different directory.  By default, the latter is expected to be on the same 
  144. drive as the GoServe directory, and named '\gohttp' for a Web server or 
  145. '\gogopher' for a Gopher server. 
  146.  
  147. Both the data directory and the filter name can easily be changed by using the 
  148. GoServe options notebook or by a command line option, if required. 
  149.  
  150. In all cases, the Rexx filter must be in the working directory for GoServe. 
  151. The working directory is also used by GoServe for the GOSERVE.INI file (which 
  152. holds user settings, such as window position and audit selections), and for any 
  153. Audit and Audit Archive files. 
  154.  
  155. When you unzip the GOSERV.ZIP file, you should find the following files: 
  156.  
  157.  goserve.doc    -- this document 
  158.  gohttp.doc     -- how to get started as a Web server 
  159.  gogopher.doc   -- how to get started as a Gopher server 
  160.  goserve.exe    -- the server program 
  161.  gofilter.80    -- sample (working) filter for HTTP 
  162.  gofilter.70    -- sample filter for Gopher 
  163.  goremote.80    -- sample filter for WWW remote control of GoServe 
  164.  moveaud.cmd    -- sample remote control command 
  165.  makeicon.cmd   -- installation aid 
  166.  gohttp.zip     -- sample pages, etc., for a Web server [unzip to a separate 
  167.                 directory, perhaps D:\GoHTTP].  This also includes the GoServe 
  168.                 Web documentation in HTML. 
  169.  gogopher.zip   -- sample menus, etc., for a Gopher server [unzip to a separate 
  170.                 directory, perhaps D:\GoGopher] 
  171.  license.txt    -- IBM license agreement for OS/2 Tools 
  172.  
  173.  Please see the 'how to get started' documents for step-by-step instructions 
  174.  for installation. 
  175.  
  176.  
  177. ΓòÉΓòÉΓòÉ 5.1. --- Uninstalling GoServe --- ΓòÉΓòÉΓòÉ
  178.  
  179. To uninstall GoServe, it is only necessary to delete the directories used by 
  180. GoServe, with their contents.  No changes are made to the OS/2 system.  (Note 
  181. that prior to version 1.74, GoServe saved settings in OS2.INI.  Later versions 
  182. automatically migrate this information to the GoServe working directory.) 
  183.  
  184.  
  185. ΓòÉΓòÉΓòÉ 5.2. --- Requirements --- ΓòÉΓòÉΓòÉ
  186.  
  187. GoServe is a 32-bit OS/2 application, which requires OS/2 2.x or OS/2 Warp. 
  188. For OS/2 Warp, version 1.31 (or later) of GoServe is needed.  GoServe requires 
  189. TCP/IP for OS/2, or equivalent, to be installed and operational (either on a 
  190. real network or using the loopback driver). Only the TCP/IP base kit should be 
  191. needed, or the OS/2 Warp Internet Access Kit from the Bonuspak.  Over time, 
  192. CSDs for TCP/IP become available--if TCP/IP problems are suspected, always try 
  193. the latest CSD. 
  194.  
  195.  
  196. ΓòÉΓòÉΓòÉ 5.3. --- Running GoServe 'stand-alone' --- ΓòÉΓòÉΓòÉ
  197.  
  198. GoServe and Web Explorer can be run on a stand-alone machine that is not 
  199. connected to a network, provided that TCP/IP is installed and the loopback 
  200. driver is started.  This is especially useful for developing Web pages offline, 
  201. or for demonstrations.  To do this, two additions are needed to a standard 
  202. TCP/IP installation (such as the OS/2 Warp Internet Access Kit): 
  203.  
  204.    1. To the file called 'HOSTS' (no extension) in your \TCPIP\ETC directory 
  205.       add the line: 
  206.  
  207.                    127.0.0.1  loopy
  208.  
  209.       where 'loopy' is the name by which you want your machine to be known when 
  210.       using the loopback connection.  This name can be a single word (e.g., 
  211.       'loopy'), or an internet-style name (e.g., 'loopy.my.org').  It's a good 
  212.       idea to have both formats, on two lines: 
  213.  
  214.                    127.0.0.1  loopy.my.org
  215.                    127.0.0.1  loopy
  216.  
  217.       Note:  if you are running Warp Connect, the directory should be 
  218.       \MPTN\ETC.  In general, check the value of the ETC environment variable 
  219.       to find out where the HOST file should be placed. 
  220.  
  221.       If there is no \xxx\ETC\HOSTS file, create one. 
  222.  
  223.    2. Before running GoServe, execute the command: 
  224.  
  225.                    ifconfig lo 127.0.0.1
  226.  
  227.       This only needs to be run once, so can be run from STARTUP.CMD or from 
  228.       any command referenced in your Startup folder.  Note that the second word 
  229.       is the lowercase of the two letters 'L' and 'O'. 
  230.  
  231.  Once set up, you can then connect to GoServe on your own machine using (for 
  232.  example) the URL: 
  233.  
  234.     http://loopy
  235.  
  236.  With recent TCP/IP versions you can carry out step 2 above using the TCP/IP 
  237.  configuration notebook.  On the 'Network' page, click on 'loopback interface', 
  238.  then check 'Enable interface' and 'Manually, using', then enter '127.0.0.1' as 
  239.  the 'IP address'. 
  240.  
  241.  The loopback address will be active even when connected to a network, so you 
  242.  can always connect to GoServe running on the same machine using the loopback 
  243.  name that you chose, provided that your browser does not have a proxy or SOCKS 
  244.  server enabled (the proxy won't be able to find your local loopback address). 
  245.  
  246.  Even if you are not connected to a network, your browser should not have a 
  247.  proxy or SOCKS server enabled (or it will try and use the network to find it 
  248.  before checking the HOSTS file). 
  249.  
  250.  
  251. ΓòÉΓòÉΓòÉ 6. Filter programs ΓòÉΓòÉΓòÉ
  252.  
  253. Filter programs are written in Rexx.  Based on the arguments they are passed, 
  254. they decide on the document or other data to be sent to the client and then 
  255. issue a command or return a result that defines that data (usually a file) to 
  256. the server.  GoServe then handles the transmission of the data to the client. 
  257.  
  258. All requests are passed to the Rexx filter, so for every request you have full 
  259. control over the response by modifying the filter as required. By default, 
  260. GoServe will never send data to a client without the filter being involved. 
  261.  
  262. The filter is cached (that is, it and its tokenized version are only read from 
  263. disk when changed) and is executed on the same thread as the incoming request 
  264. (not as a separate process).  This is very efficient; informal measurements 
  265. suggest that only a small percentage of the total response time of a simple 
  266. request is spent in running the filter.  For example, the total time to run the 
  267. sample filter on a 486/50MHz PC has been measured under OS/2 2.11 and OS/2 Warp 
  268. to be as little as 11ms. 
  269.  
  270. For examples of filters and forms processing, please see the sample filters in 
  271. the GoHTTP or GoGopher collections.  The following is specific technical 
  272. information on how the filters work.  Three argument strings are passed to the 
  273. filter: 
  274.  
  275.    1. The source of the request.  This has five words [more words could be 
  276.       added at the end in the future], separated by one or more blanks: 
  277.  
  278.           the Internet address of the server for this request (in numeric 
  279.            form).  This is normally constant, unless you have more than one 
  280.            network defined; for example, a 'real' network and a loopback 
  281.            configuration, or more than one network adapter card. 
  282.  
  283.           the server's port number used for the connection. 
  284.  
  285.           the transaction number (a number, incremented for each new 
  286.            connection, that starts at 0 when GoServe is started). 
  287.  
  288.           the Internet address of the client (in numeric form).  Note that 
  289.            this may not be the address of the end-user's machine, if the 
  290.            connection is made through a proxy or firewall. 
  291.  
  292.           the client's port number used for the connection. 
  293.  
  294.                            Example: "9.15.11.189 80 101 9.20.25.65 1987"
  295.  
  296.    2. The request string. 
  297.  
  298.           For a Web server, this string is the HTTP request string, exactly as 
  299.            received from the client.  This comprises three words: the request 
  300.            verb (e.g., 'GET'), the URI (Universal Resource Identifier) or 
  301.            partial URI, and the HTTP protocol identifier (e.g., 'HTTP/1.0'). 
  302.            The third word may be absent when older (HTTP/0.9) clients connect. 
  303.            A URI of just '/' indicates the initial contact from a client, and 
  304.            the filter would normally respond with a default document ("home 
  305.            page"). 
  306.  
  307.            Partial URIs are (or should be) the request string from a Web 'href' 
  308.            attribute previously sent to the client, unchanged [except that 
  309.            extra data, such as incoming data from forms, may be suffixed, and a 
  310.            leading slash, '/', may be added].  For more information on URIs, 
  311.            see the technical details available on the Web.  A good place to 
  312.            start is the Web information based at 'http://www.w3.org/'. 
  313.  
  314.           For a Gopher server, the request string is any data received from 
  315.            the client up to (but not including) a Tab, Carriage Return, or Line 
  316.            Feed.  An empty request string indicates the initial contact from a 
  317.            client, and the filter would normally respond with a default Gopher 
  318.            menu.  Otherwise, it will (or should) be the request string from a 
  319.            Gopher menu line previously sent to the client, unchanged. 
  320.  
  321.       You have complete freedom in setting request strings in Web documents and 
  322.       Gopher menus, and in deciding how the filter should respond depending on 
  323.       the string received.  Very often, the name of a file is used, and that 
  324.       file is sent to the client.  [Note: it is recommended that fully 
  325.       qualified filenames NOT be used for request strings.] 
  326.  
  327.    3. The extended request string. 
  328.  
  329.           For an HTTP server, this string is the "packed" URI or partial URI. 
  330.            This is the second word of the request string, with escape sequences 
  331.            (e.g., '%7e') converted to a single byte, and with any leading slash 
  332.            ('/'), if present, removed. 
  333.  
  334.           For a Gopher server, this is the 'Gopher+' data.  Some Gopher 
  335.            clients can add additional information to a request, attached to the 
  336.            request string after a Tab character.  GoServe discards the Tab 
  337.            character and presents the remainder as the third argument to the 
  338.            filter.  See Gopher protocol documents for more information on how 
  339.            the extended selector string is used. 
  340.  
  341.  The filter can specify that GoServe send either a file or a single string to 
  342.  the client, or request certain other GoServe operations. All these operations 
  343.  are effected in the usual Rexx way, by using commands, which are described 
  344.  later in this document.  Other commands allow more detailed control of the 
  345.  server. 
  346.  
  347.  The filter may also return a result string to GoServe; this, too, is treated 
  348.  as a command.  [In early versions of GoServe, this was the only way to execute 
  349.  a GoServe command, so early GoServe filters only use that mechanism.] 
  350.  
  351.  In addition to the commands, GoServe provides several special-purpose 
  352.  functions for dealing with incoming requests.  For example, the PACKUR(string) 
  353.  function takes a string which has been encoded for safe transmission, and 
  354.  reduces escape sequences (such as '%7E') to the character encoding that they 
  355.  represent (in this case, '~'). 
  356.  
  357.  Any failure of the filter (such as a syntax error) is considered catastrophic 
  358.  and will cause GoServe to end, to reduce the risk of unauthorized data 
  359.  transmission by a buggy filter.  Notes: 
  360.  
  361.    1. Remember that GoServe will run multiple copies of the filter at once, on 
  362.       different threads, if more than one client connects at the same time.  If 
  363.       building temporary files, use the transaction number (or request number) 
  364.       and port as part of the file name. 
  365.  
  366.    2. The results of SAY instructions (or tracing) in the filter program may be 
  367.       seen using the PMprintf package.  However, Rexx interactive tracing is 
  368.       not supported.  PMprintf should be available from the same source as 
  369.       GoServe, or from the GoServe Web page at: 
  370.       http://www2.hursley.ibm.com/goserve/ 
  371.  
  372.    3. You may change the name of the filter when starting GoServe or by using 
  373.       the 'Filter selection' options page.  The filter must always be in the 
  374.       working directory for GoServe.  If you make changes to the default 
  375.       filter, it's a good idea to change its name, too, so if you install a new 
  376.       version of GoServe your filter will not be overwritten by the new default 
  377.       filter. 
  378.  
  379.    4. External subroutines, written in Rexx, are easily called from the filter 
  380.       simply by using their name in a CALL instruction or function call.  The 
  381.       names should not match that of a Rexx built-in function, and the routine 
  382.       should normally be in a file with the same extension (e.g, '.80') as the 
  383.       filter and in the same directory. 
  384.  
  385.    5. You can execute OS/2 commands from the filter using the Address CMD 
  386.       instruction, for example: 
  387.  
  388.                    address cmd
  389.                    'start e foo.bar'
  390.                    'call d:\foobar\test.cmd argstring'
  391.  
  392.       Use caution when calling external programs before the response is 
  393.       complete: any slowness directly affects the response time to the client 
  394.       and its user.  Note also that separate processes (including external 
  395.       commands) are not terminated automatically by GoServe if a connection 
  396.       times out. 
  397.  
  398.       Finally, when executing commands, do not build any part of the command 
  399.       string from data received from the client; this could allow execution of 
  400.       arbitrary commands on your server (for example, if an '&' command 
  401.       separator character were included in the data). 
  402.  
  403.    6. By default, each copy of a filter may have up to five files open at once. 
  404.       This limit may be increased using the Limits selection dialog (see "The 
  405.       Limits options pages"). 
  406.  
  407.    7. A new version of the filter is only cached (loaded) when GoServe is idle, 
  408.       and has been idle for 5-10 seconds.  Therefore, if you change the filter 
  409.       while GoServe is running, the changes may not be used until the first 
  410.       client connects after a time when there have been no clients connected 
  411.       for ten seconds. 
  412.  
  413.    8. For more information on Rexx, try connecting to the Rexx Language page 
  414.       at: 
  415.       http://rexx.hursley.ibm.com/rexx/ 
  416.  
  417.    9. For more information on OS/2, start at the IBM home page 
  418.       (http://www.ibm.com), and use the Search option to search for OS/2. 
  419.  
  420.       Links to these and other useful pages may be found on the GoServe home 
  421.       page at: 
  422.       http://www2.hursley.ibm.com/goserve/ 
  423.  
  424.  
  425. ΓòÉΓòÉΓòÉ 7. Filter commands ΓòÉΓòÉΓòÉ
  426.  
  427. Commands may be executed by GoServe filters at any time, using the usual Rexx 
  428. command syntax (a clause that is just an expression).  In addition, any string 
  429. returned by the filter will be executed as a command. 
  430.  
  431. For simplicity and efficiency, most requests can be satisfied by executing a 
  432. single command which sends some data (often a file) to the client and then 
  433. closes the connection (unless it is persistent, see below).  These commands 
  434. (CLOSE, CONTROL, FILE, NODATA, STRING, and VAR) are known as 'completion 
  435. commands'; that is, after executing the command, the response to the client 
  436. will have been sent and will be complete. 
  437.  
  438. Only one completion command may be executed for each request received; once a 
  439. completion command has been executed, no further commands (except CLOSE) will 
  440. be accepted for the transaction until a new request is received, which can only 
  441. occur if the connection is persistent. 
  442.  
  443. In some situations, it is useful to be able to build up the response from more 
  444. than one data source; in this case, the SEND command is used to start the 
  445. sending of the response.  One or more of the completion commands are then used 
  446. to send the data (in this case, the connection is not closed after the 
  447. commands), and then the connection is closed by using the SEND COMPLETE 
  448. command. 
  449.  
  450. When completion commands are executed, GoServe (actually, TCP/IP) will normally 
  451. collect the data from them in a buffer and send packets of data when enough has 
  452. been collected.  GoServe can be made to send the data immediately the commands 
  453. are executed by using the command SET NETBUFFER OFF. 
  454.  
  455. If the filter ends without error or sending any data and without executing or 
  456. returning any completion command, the server will generate one (currently 
  457. "String [No information available]"). 
  458.  
  459. Errors and failures in commands are reported by a non-zero return code (which 
  460. is placed in the Rexx variable RC), and also may raise the ERROR or FAILURE 
  461. condition if enabled by SIGNAL ON or CALL ON in the filter. Command errors are 
  462. also audited unless Error auditing has been turned off.  For details on the 
  463. possible return codes, see "Command return codes". 
  464.  
  465. The total length of a command is limited to 1000 characters. 
  466.  
  467. The most important commands are the completion commands, though there are 
  468. others which will be useful to filter writers.  The commands follow in 
  469. alphabetical order; note that keywords and file specifications may be in lower, 
  470. upper, or mixed case. 
  471.  
  472.  
  473. ΓòÉΓòÉΓòÉ 7.1. AUDIT command ΓòÉΓòÉΓòÉ
  474.  
  475. Syntax: 
  476.  
  477.   AUDIT string
  478.  
  479. The string supplied will be written to the Audit file as a 'user audit' line. 
  480. See "The audit mechanism" for a description of auditing. 
  481.  
  482.  
  483. ΓòÉΓòÉΓòÉ 7.2. CLOSE command ΓòÉΓòÉΓòÉ
  484.  
  485. Syntax: 
  486.  
  487.   CLOSE
  488.  
  489. This command will cause GoServe to end, with return code set to 1, when all 
  490. current connections have been completed.  No new connections will be accepted. 
  491.  
  492. CLOSE is permitted after a completion command, so a response may be sent before 
  493. the close.  If one has not been sent, an acknowledgement is sent to the client, 
  494. and the connection is then closed, so CLOSE is then a completion command. 
  495.  
  496.  
  497. ΓòÉΓòÉΓòÉ 7.3. CONTROL command ΓòÉΓòÉΓòÉ
  498.  
  499. Syntax: 
  500.  
  501.   CONTROL [NOWAIT] [VAR varname] options
  502.  
  503. A GoServe control action (such as moving the audit file, resetting counters, or 
  504. requesting statistics) is initiated, and a result string is either placed in a 
  505. Rexx variable or returned to the client. 
  506.  
  507. This is used for controlling the GoServe server from the filter, either 
  508. directly or on request from a remote client or from another process on the same 
  509. machine -- for information on ways to do this, see "Remote control of GoServe". 
  510. The possible options are: 
  511.  
  512.      MOVEAUDIT 
  513.  
  514.  The audit file is copied to the archive file (just as though the 'Move audit 
  515.  to archive' Actions menu item had been selected). 
  516.  
  517.      RESET [BYTES] [PEAK] [RESPONSE] [TRANSACTIONS] [LIMITS] [ERRORS] [ALL] 
  518.  
  519.  The specified GoServe counters and statistics are reset (after auditing, if 
  520.  appropriate).  Any or all of the keywords may be given, in any order.  Each 
  521.  works in the same way as the corresponding Actions menu item; RESPONSE refers 
  522.  to the response time record. 
  523.  
  524.  If ALL is used, all of the items are reset, and a record of the time is kept; 
  525.  this time will be shown on the display window and in any statistics requests. 
  526.  
  527.      SAY string 
  528.  
  529.  The given string is returned; this can be used as a simple 'Loopback test'. 
  530.  
  531.      STATISTICS 
  532.  
  533.  Current statistics and settings are returned.  These include: 
  534.  
  535.    1. Transaction, error, limits, byte, and client counts, with response time 
  536.       averages 
  537.  
  538.    2. Certain settings and options (not including audit selections) 
  539.  
  540.    3. The local time of certain events (if an event has not occurred, it is 
  541.       shown as the GoServe start time). 
  542.  
  543.  The result of a CONTROL command is a single string, which may include multiple 
  544.  lines, separated by Carriage Return-Line Feed (CR-LF, ASCII '0d0a'x) 
  545.  sequences.  The exact format is not defined.  The result string is either 
  546.  placed in a variable or returned to the client: 
  547.  
  548.      If 'VAR varname' was specified, the result string is placed in the named 
  549.       Rexx variable.  The name of the variable is used just as if it appeared 
  550.       in the filter program (for example, the name 'local.j' might have the 
  551.       value of J substituted in the name). 
  552.  
  553.      If 'VAR' was not specified, a document containing the string is returned 
  554.       to the client (just as though the STRING command were used), so in this 
  555.       case, CONTROL is a completion command. 
  556.  
  557.  The NOWAIT keyword may be used to force the current connection to be closed 
  558.  after any response is sent, even if a persistent connection had been 
  559.  requested. 
  560.  
  561.  
  562. ΓòÉΓòÉΓòÉ 7.4. EXTRACT command ΓòÉΓòÉΓòÉ
  563.  
  564. Syntax: 
  565.  
  566.   EXTRACT items
  567.  
  568. Extracts the state of one or more GoServe settings for use in a Rexx filter. 
  569. 'items' is a list of one or more keywords, as specified in the QUERY and SET 
  570. commands.  The values of the specified items are placed into Rexx variables of 
  571. the same name. 
  572.  
  573. For example: 
  574.  
  575.   'extract diag diag2'
  576.   say 'DIAG flag is' diag', DIAG2 flag is' diag2
  577.   'set diag2 invert'
  578.   'extract diag2'
  579.   say 'DIAG2 flag is now' diag2
  580.  
  581.  
  582. ΓòÉΓòÉΓòÉ 7.5. FILE command ΓòÉΓòÉΓòÉ
  583.  
  584. Syntax: 
  585.  
  586.   FILE [ERASE] [NOWAIT] [TYPE content-type] [BINARY|TEXT] [NOCACHE] NAME filespec
  587.  
  588. The file named by 'filespec' will be sent to the client.  'filespec' should 
  589. normally be a fully qualified name (if it is not, GoServe would look for it in 
  590. the GoServe working directory).  Either forward or backward slashes may be used 
  591. as directory separators; the OS/2 file systems accept either. 
  592.  
  593. After this command has ended, the connection to the client is closed, so this 
  594. is a completion command. 
  595.  
  596. The optional keywords may be specified, in any order, and have the following 
  597. effects: 
  598.  
  599.      ERASE -- the file is a temporary file, and should be erased after being 
  600.       sent.  [The transaction or request number and port can be used for 
  601.       generating a safe name for a temporary file.] 
  602.  
  603.      NOWAIT -- forces the current connection to be closed after any response 
  604.       is sent, even if a persistent connection had been requested. 
  605.  
  606.      TYPE -- [HTTP protocol only] the file will be prefixed by an HTTP "OK" 
  607.       response line and an HTTP header, including the content length derived 
  608.       from measuring the file.  The value of the TYPE option ('content-type') 
  609.       should be a Internet Media Type such as "text/html" or "image/gif", of up 
  610.       to 120 characters and with no embedded spaces. See notes below for more 
  611.       information. 
  612.  
  613.       The TYPE option may only be used if GoServe is started with the HTTP 
  614.       parameter (HTTP headers are not used by Gopher), and should normally 
  615.       always be used when running as a Web server. 
  616.  
  617.      BINARY -- [default for HTTP] the file is a binary file, and form the 
  618.       entire response to the client.  GoServe will close the TCP/IP connection 
  619.       as soon as the complete file has been sent. 
  620.  
  621.       A Gopher server should use this option for all files that are not simple 
  622.       text or menus, for example ".ZIP" files, etc. 
  623.  
  624.      TEXT -- [default for Gopher] the file is a text file: any trailing DOS 
  625.       end-of-file character will not be sent to the client. 
  626.  
  627.       If running as a Gopher server, a Gopher terminator line (just a period) 
  628.       will be sent at the end of the document, before the connection is closed. 
  629.  
  630.      NOCACHE -- prevents this FILE command being cached (that is, this command 
  631.       will not be associated with a request).  See "File command cache" for 
  632.       more details. 
  633.  
  634.  Here are some examples: 
  635.  
  636.    1. Returning an HTML file to a Web client: 
  637.  
  638.                file type text/html name d:/gohttp/index.htm
  639.  
  640.    2. Returning a temporary image file to a Web client: 
  641.  
  642.                file erase type image/gif name d:/gohttp/$7681.80
  643.  
  644.    3. Returning a .ZIP file to a Gopher client: 
  645.  
  646.                file binary name d:/gogopher/gogopher.zip
  647.  
  648.  Notes: 
  649.  
  650.    1. The filespec may not include an 'upwards reference' sequence ("..\" or 
  651.       "../"), as such a sequence could possibly allow clients access to any 
  652.       file on the server machine. 
  653.  
  654.    2. All data sent to a client with an HTTP header should be described by a 
  655.       Content-Type field in the header; GoServe will therefore only generate a 
  656.       header automatically if the TYPE option was specified or the HEADER 
  657.       command has been used to add header lines.  In this latter case, it is 
  658.       the responsibility of the filter to supply the Content-Type field if the 
  659.       TYPE option was not used. 
  660.  
  661.    3. Internet Media Types were formerly known as MIME (Multipurpose Internet 
  662.       Mail Extensions) Content Types.  MIME is described in RFC 1521 and RFC 
  663.       1522.  The media types are used in the HTTP protocol so that clients can 
  664.       determine how to process data received from servers.  Some common types 
  665.       are listed in the sample filter. 
  666.  
  667.  
  668. ΓòÉΓòÉΓòÉ 7.6. HEADER command ΓòÉΓòÉΓòÉ
  669.  
  670. Syntax: 
  671.  
  672.   HEADER [NOAUTO|NOTIME] [{ADD|DROP} value]
  673.  
  674. Adds a header line to the HTTP response header, or drops one already added. 
  675. Header lines added by this command are sent to the client after header lines 
  676. generated automatically by GoServe.  They are all sent before any data; all 
  677. HEADER commands must precede any commands that send data.  For example: 
  678.  
  679.   HEADER ADD Title: My own title
  680.  
  681. Blanks following the keyword ADD or DROP are removed by GoServe, so 
  682. continuation header lines must be started with the tab ('09'x) character. 
  683.  
  684. If DROP is used, only the field identifier (up to and including the colon) 
  685. should be specified.  The first header line that matches (of the lines added 
  686. using HEADER ADD) is dropped, together with any following continuation lines; 
  687. automatically generated header lines are not affected.  A case-insensitive 
  688. comparison is used for determining a match. 
  689.  
  690. NOAUTO may be used either alone on the command or in conjunction with the ADD 
  691. or DROP form.  If any HEADER command specifies NOAUTO, no header lines will be 
  692. automatically generated by GoServe (except the final empty line); all lines 
  693. must be explicitly defined using HEADER ADD.  For example: 
  694.  
  695.   HEADER NOAUTO ADD Server: Special/0.01
  696.   HEADER        ADD Title: Two-line header
  697.  
  698. NOTIME may be used either alone on the command or in conjunction with the ADD 
  699. or DROP form.  If any HEADER command specifies NOTIME, no header lines that 
  700. start with 'Expires:' or 'Last-Modified:' will be automatically generated by 
  701. GoServe.  For example: 
  702.  
  703.   HEADER NOTIME
  704.   HEADER NOTIME ADD Last-Modified: Mon, 23 Dec 1996 19:40:20 GMT
  705.  
  706. At least one keyword must be used on the HEADER command.  The HEADER command 
  707. has no effect under the Gopher protocol (though the command syntax is checked). 
  708. It also has no effect if the incoming request uses HTTP/0.9 -- in this case, 
  709. the protocol does not permit a header to be returned, as it would be treated as 
  710. part of the data. 
  711.  
  712.  
  713. ΓòÉΓòÉΓòÉ 7.7. NODATA command ΓòÉΓòÉΓòÉ
  714.  
  715. Syntax: 
  716.  
  717.   NODATA [NOWAIT] [NORESPONSE]
  718.  
  719. No data are to be sent; the response is complete.  For an HTTP/1.0 or later 
  720. request, only a response line and header will be sent.  For a Gopher (or 
  721. HTTP/0.9) request, the connection will simply be closed (unless it is 
  722. persistent, see below).  This command is intended to be used when only a 
  723. header, or nothing at all, is to be returned to the client. 
  724.  
  725. If NORESPONSE is specified, then no response line and header will be sent 
  726. either, even for an HTTP/1.0 or later request; the connection will be closed 
  727. (unless persistent).  This option could be used for testing, or if (say) a 
  728. faulty client was sending repeat messages. 
  729.  
  730. The NOWAIT keyword may be used to force the current connection to be closed 
  731. after any response is sent, even if a persistent connection had been requested. 
  732.  
  733. NODATA is a completion command. 
  734.  
  735.  
  736. ΓòÉΓòÉΓòÉ 7.8. QUERY command ΓòÉΓòÉΓòÉ
  737.  
  738. Syntax: 
  739.  
  740.   QUERY items
  741.  
  742. Queries the state of various GoServe settings.  'items' is a list of one or 
  743. more keywords.  The name and value of each item is displayed using PMprintf; to 
  744. see the results the PMprintf console must be active. PMprintf should be 
  745. available from the same source as GoServe, or from the GoServe Web page at 
  746. http://www2.hursley.ibm.com/goserve/ 
  747.  
  748. Any item that can be set by the SET command may also be queried.  The value of 
  749. any item that may be set or queried may also be obtained by a Rexx filter, 
  750. using the EXTRACT command to place the values in Rexx variables.  PMprintf is 
  751. not needed in order to use the EXTRACT command. 
  752.  
  753. Valid items are: 
  754.  
  755.      BYTESREAD -- the number of bytes received from the network, so far during 
  756.       the current transaction. 
  757.  
  758.      BYTESREADTOTAL -- the total number of bytes received from the network. 
  759.       You may need to increase the Rexx NUMERIC DIGITS setting if you wish to 
  760.       do arithmetic on this count.  16 digits should be sufficient. 
  761.  
  762.      BYTESSENT -- the number of bytes sent to the network, so far during the 
  763.       current transaction. 
  764.  
  765.      BYTESSENTTOTAL -- the total number of bytes sent to the network. You may 
  766.       need to increase the Rexx NUMERIC DIGITS setting if you wish to do 
  767.       arithmetic on this count.  16 digits should be sufficient. 
  768.  
  769.      CLIENTADDR -- the client's address used for the connection, in numeric 
  770.       form (for example, 12.34.56.78).  For a symbolic name for the address, 
  771.       see the CLIENTNAME function. 
  772.  
  773.      CLIENTMETHOD -- the method (verb) being invoked by the client (on the 
  774.       HTTP request, or "GET" if a Gopher request).  For example, "GET" or 
  775.       "POST". 
  776.  
  777.      CLIENTPORT -- the client's port number used for the connection. 
  778.  
  779.      CLIENTPROTOCOL -- the protocol being used by the client (on the HTTP 
  780.       request, or "GOPHER" if a Gopher request).  For example, "HTTP/1.0". 
  781.  
  782.      CLIENTS -- the number of clients currently connected. 
  783.  
  784.      ELAPSED -- the elapsed time, in seconds, since the current transaction 
  785.       started (that is, when the network connection was accepted).  Any decimal 
  786.       part will not have trailing zeroes. 
  787.  
  788.      ERRORS -- the count of errors detected. 
  789.  
  790.      GMTOFFSET -- the GMT offset (in seconds).  If GMTSET is OFF, this will be 
  791.       0. 
  792.  
  793.      GMTSET -- GMT is available [ON if available, else OFF]. 
  794.  
  795.      LASTACCEPT -- timestamp of the last accepted connection [format: 
  796.       yyyy.mm.dd hh:mm:ss]. 
  797.  
  798.      LASTIDLE -- timestamp of when GoServe last entered an idle state, with no 
  799.       connections [format: yyyy.mm.dd hh:mm:ss]. 
  800.  
  801.      LASTRESET -- timestamp of the last CONTROL RESET ALL command [format: 
  802.       yyyy.mm.dd hh:mm:ss]. 
  803.  
  804.      LASTSECOND -- time now, in the same format [yyyy.mm.dd hh:mm:ss] as the 
  805.       other LASTxxxx items. 
  806.  
  807.      LASTSTART -- timestamp of when this instance of GoServe was started 
  808.       [format: yyyy.mm.dd hh:mm:ss]. 
  809.  
  810.      LIMITS -- the count of limits exceeded (that is, the count of 
  811.       transactions that were ended due to a limit being exceeded).  The limits 
  812.       counted are the total connection timeout (LIMITTIMETOTAL), the incoming 
  813.       data measures (LIMITBODY and LIMITHEADER), and maximum clients exceeded 
  814.       (LIMITCLIENTS).  The latter is only counted once for each non-idle burst 
  815.       of connections. 
  816.  
  817.      PEAKCLIENTS -- the maximum number of clients that were connected 
  818.       simultaneously. 
  819.  
  820.      READWAITTIME -- average read wait time (seconds). 
  821.  
  822.      REQUEST -- the unique number for this HTTP request.  This is incremented 
  823.       as each HTTP request is read.  This can differ from the TRANSACTION 
  824.       (connection) number if a connection fails to send a request, or if there 
  825.       is more than one request in a transaction. 
  826.  
  827.      REQUESTS -- the number of HTTP requests read since GoServe was started, 
  828.       or since the last CONTROL RESET ALL or CONTROL RESET TRANSACTIONS. 
  829.  
  830.      RESPONSEOVER -- number of connections over which RESPONSETIME and 
  831.       READWAITTIME have been averaged. 
  832.  
  833.      RESPONSETIME -- average response time (seconds). 
  834.  
  835.      SELECTOR -- the selector string (Universal Resource Indicator, for HTTP). 
  836.  
  837.      SERVERADDR -- the server's address used for the connection, in numeric 
  838.       form (for example, 11.22.33.44).  For a symbolic name for the address, 
  839.       see the SERVERNAME function. 
  840.  
  841.      SERVERPORT -- the server's port number used for the connection (for 
  842.       example, 80 for default HTTP). 
  843.  
  844.      SERVERPROTOCOL -- the protocol understood by the server (for example, 
  845.       "HTTP/1.0", or "GOPHER" if running as a Gopher server). 
  846.  
  847.      SERVERSOFTWARE -- the level of the server software (for example 
  848.       "GoServe/2.40").  This is the same as returned by the function call 
  849.       SERVER("HTTP"). 
  850.  
  851.      TRANSACTION -- the unique number for this transaction (connection). This 
  852.       is incremented as each client connects to the server.  This can differ 
  853.       from the REQUEST number if a connection fails to send a request, or if 
  854.       there is more than one request in a transaction. Note that a filter may 
  855.       be called more than once during one connection (though not concurrently). 
  856.  
  857.      TRANSACTIONS -- the number of transactions since GoServe was started, or 
  858.       since the last CONTROL RESET ALL or CONTROL RESET TRANSACTIONS. 
  859.  
  860.  
  861. ΓòÉΓòÉΓòÉ 7.9. READ command ΓòÉΓòÉΓòÉ
  862.  
  863. Syntax: 
  864.  
  865.   READ [BODY|HEADER|CHUNK size] {VAR varname | FILE [APPEND] NAME filespec}
  866.  
  867. Reads (receives) information from an HTTP client.  Either the header lines (if 
  868. HEADER is specified) or the body data are read (if BODY or CHUNK is specified). 
  869. The default source is BODY. 
  870.  
  871. If CHUNK is specified, the keyword must be followed by a non-negative integer 
  872. size, and this is the number of bytes that will be read from the body.  If BODY 
  873. is specified, the size is taken from the Content-Length field in the header. 
  874. Then: 
  875.  
  876.      If 'VAR varname' was specified, the header or body data are placed in the 
  877.       named Rexx variable, as a single string.  The name of the variable is 
  878.       used just as if it appeared in the filter program (for example, the name 
  879.       'local.j' might have the value of J substituted in the name). 
  880.  
  881.      If 'FILE NAME filespec' was specified, the data are written directly to 
  882.       the file named by 'filespec'.  'filespec' should normally be a fully 
  883.       qualified name (if it is not, GoServe will write the file in its working 
  884.       directory).  'filespec' may not include an 'upwards reference' sequence 
  885.       ("..\" or "../"), as such a sequence could possibly allow clients to 
  886.       modify any file on the server machine. 
  887.  
  888.       The named file is overwritten unless APPEND is specified (in which case 
  889.       the data are written following the end of any existing data). 
  890.  
  891.  The READ command has no effect under the Gopher protocol, or if the client did 
  892.  not send an HTTP/1.0 or later request (though in both cases the command syntax 
  893.  is checked). 
  894.  
  895.  
  896. ΓòÉΓòÉΓòÉ 7.10. RESPONSE command ΓòÉΓòÉΓòÉ
  897.  
  898. Syntax: 
  899.  
  900.   RESPONSE responseline
  901.  
  902. Specify an explicit HTTP response (status) line.  This replaces the default 
  903. 'OK' response generated by GoServe, and should be of the form "HTTP/v.v nnn 
  904. description", where 'v.v' refers to the HTTP version, 'nnn' is a 3-digit 
  905. response code number, and 'description' is text (for example, the default is 
  906. "HTTP/1.0 200 OK"). 
  907.  
  908. HTTP only allows certain code numbers to be used, so refer to the HTTP 
  909. specification before using this command.  The text should be short, and is 
  910. rarely seen, so GoServe will truncate the response line to 100 characters if 
  911. necessary.  If RESPONSE is executed more than once, the last-executed command 
  912. value is used. 
  913.  
  914. The RESPONSE command has no effect under the Gopher protocol (though the 
  915. command syntax is checked).  It also has no effect if the incoming request uses 
  916. HTTP/0.9 -- in this case, the protocol does not permit a response line to be 
  917. returned, as it would be treated as part of the data.  If used, it must precede 
  918. any commands that send data. 
  919.  
  920.  
  921. ΓòÉΓòÉΓòÉ 7.11. SEND command ΓòÉΓòÉΓòÉ
  922.  
  923. Syntax: 
  924.  
  925.   SEND [TYPE content-type] [BINARY|TEXT] [AS name]
  926.   SEND COMPLETE [NOWAIT]
  927.  
  928. SEND and SEND COMPLETE are used to start and end a response which is composed 
  929. of more than one piece of data.  The response is started by the SEND command 
  930. (without the COMPLETE keyword) and, if using HTTP, the HTTP header is sent at 
  931. that point. 
  932.  
  933. After a SEND command, the completion commands (FILE, VAR, STRING, etc.) no 
  934. longer cause the response to be completed, nor do they have any HTML wrapper or 
  935. HTTP header, etc., added.  Instead, the plain data generated by the command (or 
  936. the response to CLOSE or CONTROL, or nothing for NODATA) is sent to the client. 
  937.  
  938. Following any data commands, SEND COMPLETE is used to indicate that the 
  939. response is complete, and will write a 'C' audit line if the appropriate 
  940. auditing is in effect (see "The audit mechanism").  The NOWAIT keyword may be 
  941. used on SEND COMPLETE to force the current connection to be closed after any 
  942. response is sent, even if a persistent connection had been requested. 
  943.  
  944. SET NETBUFFER can be used to control whether data are buffered (collected into 
  945. packets) before being sent or are sent immediately. NETBUFFER is ON by default. 
  946.  
  947. The optional keywords on the SEND command to start the response may be 
  948. specified in any order, and have the following effects: 
  949.  
  950.      TYPE -- [HTTP protocol only] the data will be prefixed by an HTTP "OK" 
  951.       response line and an HTTP header.  The value of the TYPE option 
  952.       ('content-type') should be a Internet Media Type such as "text/html" or 
  953.       "image/gif", of up to 120 characters and with no embedded spaces. See the 
  954.       notes under "FILE command" for more information. 
  955.  
  956.       The TYPE option may only be used if GoServe is started with the HTTP 
  957.       parameter (HTTP headers are not used by Gopher), and should normally 
  958.       always be used when running as a Web server. 
  959.  
  960.      BINARY -- [default for HTTP] the data that follow are to be used 'as-is'. 
  961.       A Gopher server should use this option for all data that are not simple 
  962.       text or menus. 
  963.  
  964.      TEXT -- [default for Gopher] the data are text.  If running as a Gopher 
  965.       server, a Gopher terminator line (just a period) will be sent at the end 
  966.       of the document, when SEND COMPLETE is executed. 
  967.  
  968.      AS -- the 'name' given should be used in the audit file when SEND 
  969.       COMPLETE is executed.  This can be used to create a more meaningful audit 
  970.       record.  The 'name' must be a single word (no embedded blanks) of up to 
  971.       50 characters. 
  972.  
  973.  Here is an example of returning an HTML document to a Web client, including a 
  974.  file in the middle. 
  975.  
  976.     /* This is Rexx code */
  977.     'send type text/html as MultiDoc'
  978.     'string <!doctype html public "-//IETF//DTD HTML 2.0//EN">'
  979.     'string <html><head><title>Multiple...</title></head>'
  980.     'string <body><h2>Here is a test file:</h2><hr>'
  981.     'file name test.dat'
  982.     'string <hr></body></html>'
  983.     'send complete'               /* complete and audit the send */
  984.  
  985.  See GOFILTER.80 for an example of a more dynamic document, in the DOPUSH 
  986.  function. 
  987.  
  988.  Notes: 
  989.  
  990.    1. All data sent to a client with an HTTP header should be described by a 
  991.       Content-Type field in the header; GoServe will therefore only generate a 
  992.       header automatically if the TYPE option was specified or the HEADER 
  993.       command has been used to add header lines.  In this latter case, it is 
  994.       the responsibility of the filter to supply the Content-Type field if the 
  995.       TYPE option was not used. 
  996.  
  997.    2. The TYPE and AS options are associated with the SEND command, not the 
  998.       included data (as the header is sent immediately).  Therefore, TYPE and 
  999.       AS are not allowed on the FILE or VAR commands once SEND has been used. 
  1000.  
  1001.    3. BINARY and TEXT are, however, permitted on FILE and VAR after a SEND (for 
  1002.       example, a file included may be a text file with a trailing DOS 
  1003.       end-of-file character, and another might be binary). A gopher server will 
  1004.       add a terminating period line only if the most recent specification was 
  1005.       TEXT (on SEND, FILE, or VAR). 
  1006.  
  1007.    4. A 'C' audit line indicates normal completion (see "The audit mechanism"), 
  1008.       and once SEND has been used it is only written when SEND COMPLETE is 
  1009.       executed.  If no SEND COMPLETE is executed. GoServe will close the 
  1010.       connection automatically, but no 'C' audit line will be written. 
  1011.  
  1012.  
  1013. ΓòÉΓòÉΓòÉ 7.12. SET command ΓòÉΓòÉΓòÉ
  1014.  
  1015. Syntax: 
  1016.  
  1017.   SET item newvalue
  1018.  
  1019. Changes the state of various GoServe settings.  'item' is one of the listed 
  1020. keywords.  The value of any item that can be set by the SET command can also be 
  1021. queried using the QUERY command, or obtained by a Rexx filter using the EXTRACT 
  1022. command. 
  1023.  
  1024. Flags (items that are either ON or OFF) can also be set to INVERT, which 
  1025. changes the state of the flag from ON to OFF or vice versa. 
  1026.  
  1027. Valid items are: 
  1028.  
  1029.      AUDITACCEPT -- Audit accepted connections [ON/OFF].  See "The audit 
  1030.       mechanism" for more details on this and the other audit settings. 
  1031.  
  1032.      AUDITCOMPLETE -- Audit completed connections [ON/OFF]. 
  1033.  
  1034.      AUDITERROR -- Audit errors (for example, in commands) [ON/OFF]. 
  1035.  
  1036.      AUDITFAIL -- Audit errors that stop the server [ON/OFF]. 
  1037.  
  1038.      AUDITGMT -- Use GMT in the audit file [ON/OFF].  This may only be set ON 
  1039.       if GMT is available (that is, GMTSET is ON). 
  1040.  
  1041.      AUDITINFO -- Audit informational lines, such as statistics [ON/OFF]. 
  1042.  
  1043.      AUDITLAZY -- Lazy audit, for fewer writes to the audit file [ON/OFF]. 
  1044.  
  1045.      AUDITLIMIT -- Audit limits lines, when transactions are halted due to a 
  1046.       timeout, an incoming data limit exceeded, or maxmium clients exceeded. 
  1047.       The latter is only audited once for each non-idle burst of connections 
  1048.       [ON/OFF]. 
  1049.  
  1050.      AUDITSELECT -- Audit selectors (this is the request string, as is passed 
  1051.       as the second argument to the filter) [ON/OFF]. 
  1052.  
  1053.      AUDITUSER -- Audit user audit lines, from the AUDIT command [ON/OFF]. 
  1054.  
  1055.      DATADIR -- data directory name (path).  This must be a path (including a 
  1056.       drive specification) that refers to an existing directory.  When changed, 
  1057.       this takes effect immediately; that is, subsequent calls to the DATADIR 
  1058.       function (or the use of QUERY DATADIR or EXTRACT DATADIR) in this and 
  1059.       other transactions will return the new directory information. 
  1060.  
  1061.      DIAG -- diagnostic tracing [ON/OFF]. 
  1062.  
  1063.      DIAG2 -- verbose diagnostic tracing [ON/OFF]. 
  1064.  
  1065.      DIAGMSG -- diagnostic PM message tracing [ON/OFF]. 
  1066.  
  1067.      FASTFILE -- file command cache enable [ON/OFF].  When ON, the file 
  1068.       command cache is active (see "File command cache"). 
  1069.  
  1070.      FASTFILTER -- file command cache filter control [ON/OFF].  When ON, the 
  1071.       GoServe filter will be called even if a cached FILE command was used (see 
  1072.       "File command cache"). 
  1073.  
  1074.      FILTER -- the name of the Rexx filter.  This must be a filename with no 
  1075.       path referring to a file in the GoServe working directory; a default 
  1076.       extension of PORT will be added if needed.  When changed, the new filter 
  1077.       will be used for subsequent transactions. 
  1078.  
  1079.      HIDDEN -- main window state [ON/OFF].  If HIDDEN is changed from OFF to 
  1080.       ON, the GoServe main window is minimized.  If changed from ON to OFF, the 
  1081.       main window is restored and surfaced. 
  1082.  
  1083.      LIMITBODY -- maximum size (in thousands of bytes) of body data that will 
  1084.       be accepted [0 through 1E+6]. 
  1085.  
  1086.      LIMITCLIENTS -- maximum number of client connections allowed concurrently 
  1087.       [1 through 1E+6]. 
  1088.  
  1089.      LIMITFILES -- maximum number of open files allowed, per client connection 
  1090.       [1 through 100]. 
  1091.  
  1092.      LIMITHEADER -- maximum size (in thousands of bytes) of header data that 
  1093.       will be accepted [1 through 1E+6]. 
  1094.  
  1095.      LIMITSTARTWAIT -- maximum time, in seconds, for which GoServe will wait 
  1096.       on startup for TCP/IP to become operational, while retrying appropriate 
  1097.       TCP/IP calls as necessary [0 through 1E+9]. 
  1098.  
  1099.      LIMITTIMEINACTIVE -- maximum time, in seconds, for which GoServe will 
  1100.       allow a client to remain connected but inactive (that is, without sending 
  1101.       or reading data) [0 through LIMITTIMETOTAL]. 
  1102.  
  1103.      LIMITTIMETOTAL -- maximum time, in seconds, for which GoServe will allow 
  1104.       a client to remain connected, even if active [LIMITTIMEINACTIVE through 
  1105.       1E+9]. 
  1106.  
  1107.      LIMITTIMEWAIT -- maximum time, in seconds, for which GoServe will keep a 
  1108.       client connection open waiting for a new request after the client has 
  1109.       sent a 'Connection: keep-alive' header with the previous request [0 
  1110.       through 1E+9]. 
  1111.  
  1112.      LIMITWARNING -- the percentage of maximum clients over which the GoServe 
  1113.       main window bar chart will show a visible warning [0 through 100]. 
  1114.  
  1115.      MENUBAR -- show menu bar on GoServe main window [ON/OFF]. 
  1116.  
  1117.      NETBUFFER -- turns network buffering on or off for the current 
  1118.       transaction (the default is ON); see "SEND command" for more details 
  1119.       [ON/OFF].  Currently, SET NETBUFFER may be used to change the setting 
  1120.       only once per transaction. 
  1121.  
  1122.      RESPONSEGOAL -- sets the response time goal, in seconds.  This affects 
  1123.       the coloring of the response time graph, etc. [0 through 1.000]. 
  1124.  
  1125.      RESPONSEGOALSHOW -- if set, the response time shown on the GoServe main 
  1126.       window will be colored green if it is less than or equal to RESPONSEGOAL, 
  1127.       yellow/orange if less than or equal to twice that, or red otherwise 
  1128.       [ON/OFF]. 
  1129.  
  1130.      SOUNDS -- audible indication of incoming connections [ON/OFF]. 
  1131.  
  1132.      SOUNDALL -- sounds for all connections.  If ON, give audible indication 
  1133.       of all incoming connections; if OFF, only indicate when leaving the idle 
  1134.       state.  The SOUNDS setting must be ON for any sounds to be generated. 
  1135.  
  1136.      SURFACE -- surface GoServe main window on startup [ON/OFF]. 
  1137.  
  1138.      TRACE -- copy audit lines to PMprint window [ON/OFF]. 
  1139.  
  1140.      TEST -- enable test or experimental functions [ON/OFF]. 
  1141.  
  1142.  
  1143. ΓòÉΓòÉΓòÉ 7.13. STRING command ΓòÉΓòÉΓòÉ
  1144.  
  1145. Syntax: 
  1146.  
  1147.   STRING string
  1148.  
  1149. The single string is returned to the client, with suitable preamble and 
  1150. termination, depending on the protocol being used. 
  1151.  
  1152. The STRING command can be used to return a simple message to the client. 
  1153. Multiple lines can be sent, if necessary, by embedding a CR-LF sequence 
  1154. ('0d0a'x) to separate lines.  A CR-LF is not needed at the end of the string, 
  1155. as CR-LF is always added by the STRING command. 
  1156.  
  1157. After this command has ended, the connection to the client is closed, so this 
  1158. is a completion command. 
  1159.  
  1160.  
  1161. ΓòÉΓòÉΓòÉ 7.14. VAR command ΓòÉΓòÉΓòÉ
  1162.  
  1163. Syntax: 
  1164.  
  1165.   VAR [NOWAIT] [TYPE content-type] [BINARY|TEXT] [AS name] NAME varname
  1166.  
  1167. The contents of the Rexx variable named by 'varname' will be sent to the 
  1168. client.  'varname' is a symbolic name, as it would be written in the filter, 
  1169. and should be no more than 50 characters long.  The variable named must have 
  1170. been assigned a value, or an error will be returned. 
  1171.  
  1172. After this command has ended, the connection to the client is closed, so this 
  1173. is a completion command. 
  1174.  
  1175. The optional keywords may be specified, in any order, and have the following 
  1176. effects: 
  1177.  
  1178.      NOWAIT -- forces the current connection to be closed after any response 
  1179.       is sent, even if a persistent connection had been requested. 
  1180.  
  1181.      TYPE -- [HTTP protocol only] the data will be prefixed by an HTTP "OK" 
  1182.       response line and an HTTP header, including the length of the variable. 
  1183.       The value of the TYPE option ('content-type') should be a Internet Media 
  1184.       Type such as "text/html" or "image/gif", of up to 120 characters and with 
  1185.       no embedded spaces.  See the notes under "FILE command" for more 
  1186.       information. 
  1187.  
  1188.       The TYPE option may only be used if GoServe is started with the HTTP 
  1189.       parameter (HTTP headers are not used by Gopher), and should normally 
  1190.       always be used when running as a Web server. 
  1191.  
  1192.      BINARY -- [default for HTTP] the data are binary, and form the entire 
  1193.       response to the client.  GoServe will close the TCP/IP connection to 
  1194.       indicate that all the data have been sent. 
  1195.  
  1196.       A Gopher server should use this option for all data that are not simple 
  1197.       text or menus. 
  1198.  
  1199.      TEXT -- [default for Gopher] the data are text.  If running as a Gopher 
  1200.       server, a Gopher terminator line (just a period) will be sent at the end 
  1201.       of the document, before the connection is closed. 
  1202.  
  1203.      AS -- the 'name' given should be used in the audit file instead of the 
  1204.       name of the variable.  This can be used to create a more meaningful audit 
  1205.       record when (for example) the variable contains a modified version of a 
  1206.       file.  The 'name' must be a single word (no embedded blanks) of up to 50 
  1207.       characters. 
  1208.  
  1209.  Here are some examples (see also GOREMOTE.80): 
  1210.  
  1211.    1. Returning an HTML document to a Web client: 
  1212.  
  1213.                    /* This is Rexx code */
  1214.                    doc='<html> .... </html>'          /* may be large */
  1215.                    'var type text/html name doc'      /* return the data */
  1216.                    return
  1217.  
  1218.    2. Returning some binary data to a Web client: 
  1219.  
  1220.                    /* This is Rexx code */
  1221.                    data='001122334455'x               /* may be large, '00'x is OK */
  1222.                    'var type application/octet-stream name data'  /* this sends it */
  1223.                    return
  1224.  
  1225.  Notes: 
  1226.  
  1227.    1. The filter must be active when the VAR command is executed (or the 
  1228.       variable will not exist).  Therefore this command cannot be passed back 
  1229.       to the server by a RETURN instruction for later execution. 
  1230.  
  1231.    2. All data sent to a client with an HTTP header should be described by a 
  1232.       Content-Type field in the header; GoServe will therefore only generate a 
  1233.       header automatically if the TYPE option was specified or the HEADER 
  1234.       command has been used to add header lines.  In this latter case, it is 
  1235.       the responsibility of the filter to supply the Content-Type field if the 
  1236.       TYPE option was not used. 
  1237.  
  1238.  
  1239. ΓòÉΓòÉΓòÉ 7.15. WAIT command ΓòÉΓòÉΓòÉ
  1240.  
  1241. Syntax: 
  1242.  
  1243.   WAIT SECONDS time
  1244.  
  1245. The WAIT SECONDS command may be used to pause a transaction for up to 
  1246. 999999.999 seconds.  'time' is the wait time in seconds; it may have a decimal 
  1247. part of up to three digits. 
  1248.  
  1249. If a limit (such as a timeout) is exceeded during a WAIT, the command will 
  1250. return immediately.  Except in this case, WAIT will not return without error in 
  1251. less than the requested time, but may take longer if some other activity on the 
  1252. computer delays it. 
  1253.  
  1254.  
  1255. ΓòÉΓòÉΓòÉ 8. Command return codes ΓòÉΓòÉΓòÉ
  1256.  
  1257. When commands end, they report any errors or failures by setting the Rexx 
  1258. variable RC.  A value of zero indicates normal execution (no error or failure 
  1259. was found), a positive value indicates an error, and a negative value a 
  1260. failure.  All command errors and failures are audited with audit type 'E' (if 
  1261. auditing of errors is enabled). 
  1262.  
  1263. The possible values for command return codes follow. 
  1264.  
  1265. Errors 
  1266.  
  1267. Failures 
  1268.  
  1269.  
  1270. ΓòÉΓòÉΓòÉ 8.1. --- Errors --- ΓòÉΓòÉΓòÉ
  1271.  
  1272. Errors indicate that the command was in error (perhaps a syntax error) or the 
  1273. data it processed was in error.  The following errors may occur: 
  1274.  
  1275.  [11]      Response already completed 
  1276.  [12]      Command not allowed now 
  1277.  [21]      Missing keyword in command 
  1278.  [22]      Bad keyword in command 
  1279.  [23]      Bad value in command 
  1280.  [24]      Junk on end of command 
  1281.  [25]      Header key not found 
  1282.  [26]      Unknown SET/QUERY/EXTRACT item 
  1283.  [31]      Unable to open file 
  1284.  [32]      Unable to read file 
  1285.  [33]      Unable to write file 
  1286.  [34]      Unable to write audit 
  1287.  [40]      Bad variable name 
  1288.  [41]      Could not set variable 
  1289.  [42]      Could not get variable 
  1290.  [50]      Missing Content-Length 
  1291.  [51]      Bad Content-Length 
  1292.  [52]      Zero Content-Length 
  1293.  [53]      Multiple READ BODY requested 
  1294.  
  1295.  
  1296. ΓòÉΓòÉΓòÉ 8.2. --- Failures --- ΓòÉΓòÉΓòÉ
  1297.  
  1298. Failures are indicated when a command encounters an unexpected or serious 
  1299. condition, such as a failure of the TCP/IP network or some limit being 
  1300. exceeded.  The following failures may be reported: 
  1301.  
  1302.  [-1]      Inactive timeout exceeded 
  1303.  [-2]      Total timeout exceeded 
  1304.  [-3]      Header bytes limit exceeded 
  1305.  [-4]      Body bytes limit exceeded 
  1306.  [-5]      Out of memory 
  1307.  [-6]      Failure reading from network 
  1308.  [-7]      Failure sending to network 
  1309.  [-8]      Unknown command 
  1310.  
  1311.  
  1312. ΓòÉΓòÉΓòÉ 9. Filter functions ΓòÉΓòÉΓòÉ
  1313.  
  1314. In addition to GoServe commands, filters may use certain routines provided by 
  1315. GoServe.  These may be invoked either as functions or by the CALL instruction, 
  1316. and are listed in the following sections. 
  1317.  
  1318.  
  1319. ΓòÉΓòÉΓòÉ 9.1. CACHED function ΓòÉΓòÉΓòÉ
  1320.  
  1321. Syntax: 
  1322.  
  1323.   CACHED([option])
  1324.  
  1325. This returns information about any previous cached command.  If 'option' is 
  1326. omitted or begins with the character 'N' (either case) then this returns '1' if 
  1327. a cached FILE command was executed for the current request before the filter 
  1328. was invoked, or '0' otherwise. 
  1329.  
  1330. If 'option' begins with the character 'R' (either case) then this returns the 
  1331. returncode from the cached command that was executed, or zero if none was 
  1332. executed (cached()=0).  For example: 
  1333.  
  1334.   say cached() cached('rc')
  1335.  
  1336. might display "1 31" if the cached command failed to find the file. 
  1337.  
  1338.  
  1339. ΓòÉΓòÉΓòÉ 9.2. CLIENTNAME function ΓòÉΓòÉΓòÉ
  1340.  
  1341. Syntax: 
  1342.  
  1343.   CLIENTNAME()
  1344.  
  1345. This returns the primary host name of the client (for example, 
  1346. 'roman.therenet.org'), or if that should not be available, the name in numeric 
  1347. form (e.g., 12.34.56.78). 
  1348.  
  1349. Note that determining the client name may involve a significant delay while the 
  1350. network is asked to resolve it.  To minimize response time to the user, it is 
  1351. best to ask for the client name after sending the response data.  Note also 
  1352. that the client name will not be that of the user agent if the user connects 
  1353. through a 'proxy' server or firewall. 
  1354.  
  1355.  
  1356. ΓòÉΓòÉΓòÉ 9.3. COMPLETED function ΓòÉΓòÉΓòÉ
  1357.  
  1358. Syntax: 
  1359.  
  1360.   COMPLETED()
  1361.  
  1362. This returns '1' if a completion command that closed the connection to the 
  1363. client has already been executed successfully during this transaction, or '0' 
  1364. otherwise. 
  1365.  
  1366.  
  1367. ΓòÉΓòÉΓòÉ 9.4. DATADIR function ΓòÉΓòÉΓòÉ
  1368.  
  1369. Syntax: 
  1370.  
  1371.   DATADIR()
  1372.  
  1373. This returns the data directory name (e.g., 'd:/gohttp/') set up by using the 
  1374. DATADIR option when starting GoServe or by using the DataDir options page. 
  1375. (Once changed, GoServe records the data directory associated with each port.) 
  1376.  
  1377. The directory name will always end in a '/', and will use '/' as the directory 
  1378. separator, "URI-style". 
  1379.  
  1380.  
  1381. ΓòÉΓòÉΓòÉ 9.5. EXTRACT function ΓòÉΓòÉΓòÉ
  1382.  
  1383. Syntax: 
  1384.  
  1385.   EXTRACT(item)
  1386.  
  1387. This returns the value of a GoServe setting.  'item' should be a single word, 
  1388. which could be used as an item in the EXTRACT (or QUERY) commands. The value of 
  1389. the item is returned (instead of setting a variable of the same name, as with 
  1390. the EXTRACT command).  If the item is not a single word or is not a known 
  1391. GoServe setting, then it is returned unchanged. 
  1392.  
  1393.  
  1394. ΓòÉΓòÉΓòÉ 9.6. GMTOFFSET function ΓòÉΓòÉΓòÉ
  1395.  
  1396. Syntax: 
  1397.  
  1398.   GMTOFFSET()
  1399.  
  1400. This returns the current offset from Greenwich Mean Time (GMT), in seconds.  A 
  1401. positive result indicates that your local time is ahead of GMT by that amount. 
  1402.  
  1403. If GMT cannot be computed because the TZ environment variable was not set, the 
  1404. function returns a question mark (the character '?').  See "Setting the TZ 
  1405. environment variable" for more information. 
  1406.  
  1407.  
  1408. ΓòÉΓòÉΓòÉ 9.7. PACKUR function ΓòÉΓòÉΓòÉ
  1409.  
  1410. Syntax: 
  1411.  
  1412.   PACKUR(string)
  1413.  
  1414. Takes a single string, expressed according to the Universal Resource (UR) 
  1415. specification (RFC 1630), as an argument and returns a packed string.  That is, 
  1416. hexadecimal escape sequences (such as '%7E') are reduced to the character 
  1417. encoding that they represent (in this case, '~'). 
  1418.  
  1419. PACKUR is especially useful for processing the incoming data from a form, in 
  1420. which UR encoding is used.  See the sample GOFILTER.80 for an example of this 
  1421. use. 
  1422.  
  1423.  
  1424. ΓòÉΓòÉΓòÉ 9.8. PACK64 function ΓòÉΓòÉΓòÉ
  1425.  
  1426. Syntax: 
  1427.  
  1428.   PACK64(string)
  1429.  
  1430. Takes a single string, expressed according to the MIME "Base64" specification 
  1431. (in RFC 1521), as an argument and returns the decoded (packed) string.  Each 
  1432. four bytes in 'string' is packed to three bytes in the result (except possibly 
  1433. for the last four bytes); 'string' must be a multiple of 4 bytes.  If any 
  1434. deviation from these specifications (or from the RFC 1521 "Base64" character 
  1435. set) is found, the null string is returned. 
  1436.  
  1437. PACK64 is useful for processing the incoming user/password data encoded for the 
  1438. HTTP 'basic access authentication scheme' -- see the HTTP documentation for 
  1439. details. 
  1440.  
  1441.  
  1442. ΓòÉΓòÉΓòÉ 9.9. REQFIELD function ΓòÉΓòÉΓòÉ
  1443.  
  1444. Syntax: 
  1445.  
  1446.   REQFIELD(identifier [, count])
  1447.  
  1448. Searches the HTTP request header for a line that starts with the specified 
  1449. identifier, and returns the value for that identifier. Continuations are 
  1450. included in the value (if the continuation was indicated by the tab character, 
  1451. the tab character is replaced with a space). 
  1452.  
  1453. The identifier may optionally end with a colon, and the search is 
  1454. case-insensitive.  If no matching identifier is found (or if there is no HTTP 
  1455. request header), the null string is returned. 
  1456.  
  1457. The second, optional, argument determines which value is returned if more than 
  1458. one line starts with the given identifier: if no count is given, the last 
  1459. matching line is used.  If a count is given, then it identifies which of the 
  1460. values is to be returned.  For example, 
  1461.  
  1462.   reqfield("accept", 3)
  1463.  
  1464. would return the value of the third 'Accept:' line in the header (perhaps 
  1465. "text/html"); if there was no third 'Accept:' line, then the null string would 
  1466. be returned. 
  1467.  
  1468.  
  1469. ΓòÉΓòÉΓòÉ 9.10. SERVER function ΓòÉΓòÉΓòÉ
  1470.  
  1471. Syntax: 
  1472.  
  1473.   SERVER([option])
  1474.  
  1475. This returns the name of the server software.  If 'option' is omitted or begins 
  1476. with the character 'N' (either case) then this is the full name of the server 
  1477. software, followed by a comma, the word 'version', and the version number of 
  1478. the server.  For example, 'GoServe for OS/2, version 1.88'. 
  1479.  
  1480. If 'option' begins with the character 'H' (either case) then the HTTP short 
  1481. name is returned, for example, 'GoServe/1.88'.  This is the same as the value 
  1482. returned in the HTTP header field "Server:". 
  1483.  
  1484.  
  1485. ΓòÉΓòÉΓòÉ 9.11. SERVERNAME function ΓòÉΓòÉΓòÉ
  1486.  
  1487. Syntax: 
  1488.  
  1489.   SERVERNAME()
  1490.  
  1491. This returns the primary host name of the server (for example, 
  1492. 'fred.mynet.org'), or if that should not be available, the name in numeric form 
  1493. (e.g., 12.34.56.78). 
  1494.  
  1495. If the latter case, your TCP/IP installation probably needs adjustment. For 
  1496. example, if running in loopback mode and not on a real network, your HOSTS file 
  1497. in TCPIP\ETC should contain your host name.  Check also to see what your TCP/IP 
  1498. HOSTNAME command (from an OS/2 prompt) returns; again, it should be a full 
  1499. symbolic name (not the numeric form).  (This may not work on Warp Connect.) 
  1500.  
  1501. Note that determining the server name may involve a significant delay if the 
  1502. network has to be asked to resolve it.  It may vary from transaction to 
  1503. transaction if multiple networks are connected to the server. 
  1504.  
  1505.  
  1506. ΓòÉΓòÉΓòÉ 10. Running GoServe ΓòÉΓòÉΓòÉ
  1507.  
  1508. GoServe may be started in any of the usual ways, such as from an OS/2 command 
  1509. line or from a Program Reference object.  You should always specify the 
  1510. protocol to be used (HTTP or GOPHER) as a parameter to the command.  GoServe 
  1511. defaults to the Gopher protocol at present. 
  1512.  
  1513. This section describes first the user interface to GoServe, and then details 
  1514. the parameters that may be used when starting GoServe. 
  1515.  
  1516.  
  1517. ΓòÉΓòÉΓòÉ 10.1. The GoServe window ΓòÉΓòÉΓòÉ
  1518.  
  1519. Once GoServe has started, a PM window should appear.  By default, a menu bar is 
  1520. displayed giving access to the 'Options' notebook and an 'Actions' drop-down 
  1521. menu.  Access to these is also provided at all times by a pop-up menu if you 
  1522. click on the window with the context menu mouse button (usually button 2). 
  1523.  
  1524. To change the background color of the window, select the color of your choice 
  1525. from the OS/2 color palette, drag it to the GoServe window, and drop it.  The 
  1526. color should change immediately. 
  1527.  
  1528. The window is used to display a summary of the current and past activity of 
  1529. GoServe.  If it is large enough, it will include at the top a bar display that 
  1530. shows any client activity (the full width of the bar corresponds to the maximum 
  1531. number of clients allowed).  A half-height grey bar indicates the peak activity 
  1532. seen since GoServe was started. This may be reset to zero by selecting 'Reset 
  1533. peak indicator' from the Actions menu, and will be shown in purple if any 
  1534. errors have been counted.  The second line of the window gives the total number 
  1535. of transactions (connections) initiated since GoServe started, and the average 
  1536. response time of the last 100 transactions.  The color of this number changes 
  1537. to indicate whether the response time goal is being attained; you can change 
  1538. the goal (or turn off the coloring in the main window) using the 'Response' 
  1539. page of the Options notebook.  The response time is replaced by a count of 
  1540. limits exceeded, or a count of errors, if any of these have occurred. 
  1541.  
  1542. If room, the second line shows on the right the instantaneous count of 
  1543. connected clients and the peak number recorded since GoServe started (if more 
  1544. than one). 
  1545.  
  1546. The transaction count may be reset to zero by selecting 'Reset transaction 
  1547. count' from the Actions menu).  Similarly, the response time record, error 
  1548. count, limits count, and peak count may also be reset to zero. 
  1549.  
  1550. The third line shows the number of bytes, thousands of bytes, or millions of 
  1551. bytes sent and received since GoServe started.  These counts may be reset to 
  1552. zero by selecting 'Reset byte counts' from the Actions menu.  The Actions menu 
  1553. also offers 'Reset all counts', which resets all of the counters. 
  1554.  
  1555. The fourth line of the window displays two timestamps; on the left is shown the 
  1556. time when GoServe last entered the 'idle' state (that is, was waiting for 
  1557. clients).  On the right is the time when GoServe was started (or when the last 
  1558. 'Reset All' was done). 
  1559.  
  1560. Some or all of these items will be omitted if the window is too small for 
  1561. satisfactory display. 
  1562.  
  1563.  
  1564. ΓòÉΓòÉΓòÉ 10.2. The Options notebook ΓòÉΓòÉΓòÉ
  1565.  
  1566. If 'Options' is selected from the menu bar or pop-up menu, the Options notebook 
  1567. is opened.  This has the following pages: 
  1568.  
  1569.    1. 'Response' shows response time statistics, and lets you control the 
  1570.       display and coloring of the statistics. 
  1571.  
  1572.       At the top of the page, a bar chart shows the distribution of the 
  1573.       response times for recent requests, and (if there have been any requests) 
  1574.       the average response time.  This bar chart is redrawn automatically 
  1575.       whenever the number of connections returns to idle, or you can refresh it 
  1576.       manually by clicking on (selecting) the chart. 
  1577.  
  1578.       You can change the time-scale of this chart using the buttons at the 
  1579.       bottom right of the box.  Any measurements that would be "off-scale" (to 
  1580.       the right of the chart) are included in the bar at the far right of the 
  1581.       chart. 
  1582.  
  1583.       The lower part of the page lets you set a response time goal using a 
  1584.       slider control; responses made within the specified time are displayed on 
  1585.       the bar chart in green; responses made within twice that time are shown 
  1586.       in an orangey-brown, and responses outside that limit are shown in a 
  1587.       medium-dark red.  The exact colors used will depend on your display. 
  1588.  
  1589.       The average response time shown on the page is colored according to the 
  1590.       the same rules, as is the less precise average response time shown on the 
  1591.       main window, if 'Color on main window' is checked. 
  1592.  
  1593.       See "Response time recording" for more details. 
  1594.  
  1595.    2. 'General' lets you change certain aspects of the appearance of the main 
  1596.       window, and control sounds made by the server. 
  1597.  
  1598.       Two 'Main Window' check-boxes are provided: 
  1599.  
  1600.           'Show menu bar' controls whether the menu bar is included in the 
  1601.            display.  To make menu selections when there is no menu bar, click 
  1602.            anywhere on the GoServe window with the context menu button, in the 
  1603.            usual Workplace Shell manner (this works even if the menu bar is 
  1604.            visible). 
  1605.  
  1606.           'Surface on startup' lets you choose whether GoServe surfaces its 
  1607.            window when started (if not minimized when shut down). 
  1608.  
  1609.       The 'Sounds on connections' checkbox requests that sounds be made (using 
  1610.       the PC speaker) when a client browser connects to the server.  Radio 
  1611.       buttons let you choose whether to hear a note (on an ascending scale, 
  1612.       depending on the number of connections) for every connection, or to hear 
  1613.       a note only when the server moves from being idle to being busy (one or 
  1614.       more connections). 
  1615.  
  1616.       The 'File command cache' controls are used for a performance 
  1617.       optimization.  See "File command cache" for details before using this 
  1618.       option. 
  1619.  
  1620.    3. 'Audit' lets you control the auditing of transactions (which events are 
  1621.       to be audited, whether timestamps in the file are in local time or GMT, 
  1622.       and how frequently the audit file is to be written). See "The audit 
  1623.       mechanism" for more details. 
  1624.  
  1625.    4. 'Limits' (two pages) is used to control the operating limits of the 
  1626.       server.  See "The Limits options pages" for details. 
  1627.  
  1628.    5. 'DataDir' lets you specify a new data directory name (path).  This name 
  1629.       is made available to the Rexx filter via the DataDir() function, and may 
  1630.       be used by the filter to find the data to be served.  (But note that the 
  1631.       filter may ignore this information, if appropriate.) 
  1632.  
  1633.       GoServe will convert backslashes ('\') in the name to URI form (forward 
  1634.       slashes, '/'), and will add a trailing '/' if one is not present.  For 
  1635.       example, entering 'd:\myhome' would result in the directory specification 
  1636.       'd:/myhome/' being passed to the filter via the DATADIR() function.  This 
  1637.       page checks that a drive is specified so it is not accidentally omitted. 
  1638.  
  1639.    6. 'Filter' lets you specify a new filter name.  This must be a simple 
  1640.       filename and extension (the extension will default to the port number, if 
  1641.       omitted). 
  1642.  
  1643.       The filter must be in the GoServe working (current) directory, so no 
  1644.       drive or directory path should be specified.  For example, if you enter 
  1645.       'myfilter.80', this would result in the filter 'd:\goserve\myfilter.80' 
  1646.       being used, if 'd:\goserve' is the working directory.  The filter must 
  1647.       exist in the GoServe working directory in order for a new name to be 
  1648.       accepted. 
  1649.  
  1650.  
  1651. ΓòÉΓòÉΓòÉ 10.3. --- The Apply button --- ΓòÉΓòÉΓòÉ
  1652.  
  1653. The 'Limits', 'DataDir', and 'Filter' pages let you choose when to apply the 
  1654. change or changes that you make, by clicking on the 'Apply' button (or pressing 
  1655. the Enter key).  The Apply button is only enabled when you have made a change 
  1656. and all fields on the page are valid.  If you leave a page (or close the 
  1657. notebook) when the Apply button is enabled, the changes will be applied 
  1658. automatically at that time. 
  1659.  
  1660.  
  1661. ΓòÉΓòÉΓòÉ 10.4. The Limits options pages ΓòÉΓòÉΓòÉ
  1662.  
  1663. The 'Limits' pages in the Options notebook let you change various limits which 
  1664. apply to running GoServe.  The limits are grouped into three sets: limits 
  1665. affecting clients, timeouts, and (on the second page) limits restricting 
  1666. incoming data. 
  1667.  
  1668.  
  1669. ΓòÉΓòÉΓòÉ 10.5. --- Clients limits --- ΓòÉΓòÉΓòÉ
  1670.  
  1671. The 'Clients' set has three limits: 
  1672.  
  1673.    1. 'Maximum at once' -- the maximum number of client connections allowed 
  1674.       concurrently [default 20].  Additional requests for connection will be 
  1675.       refused.  This count lets you limit the maximum load on your server, 
  1676.       which is especially useful if it is also being used as a personal 
  1677.       workstation.  Note that some Web clients, such as Web Explorer, may make 
  1678.       four or more connections at the same time, to download inline graphics in 
  1679.       parallel. 
  1680.  
  1681.       This limit, when exceeded, is only counted and audited once for each 
  1682.       non-idle burst of connections. 
  1683.  
  1684.    2. 'Show warning at' -- the percentage at which the bar chart will show a 
  1685.       red warning indicator [default 75%].  This gives a visual indication of 
  1686.       heavy use of your server at a given instant (the peak use is also shown 
  1687.       on the bar display). 
  1688.  
  1689.    3. 'Open files per client' -- the maximum number of open files allowed, per 
  1690.       client filter [default 5].  Increase this if you expect your GoServe 
  1691.       filter to have more than five files open at a time. 
  1692.  
  1693.  
  1694. ΓòÉΓòÉΓòÉ 10.6. --- Timeouts --- ΓòÉΓòÉΓòÉ
  1695.  
  1696. The 'Timeouts' set has four limits; the first two timeout settings control the 
  1697. time at which any uncompleted response may be terminated automatically by 
  1698. GoServe's "watchdog" thread, the third controls how long GoServe will wait (if 
  1699. requested) for additional requests on a persistent connection, and the last 
  1700. determines how long GoServe will wait, on startup, for TCP/IP to become 
  1701. available: 
  1702.  
  1703.    1. 'End client after inactive' -- the "inactive timeout", in seconds. A 
  1704.       connection will be closed if the specified time passes without any data 
  1705.       being received or transmitted over the connection.  The default is 60 
  1706.       seconds. 
  1707.  
  1708.    2. 'End client after total' -- the "total timeout", in seconds.  A 
  1709.       connection will be closed if the specified time passes since the client 
  1710.       connected to the port, even if there appears to be activity. This value 
  1711.       must not be less than the inactive timeout, and defaults to 1200 seconds. 
  1712.       As a rule of thumb, this timeout might be set to a number of seconds 
  1713.       equal to or larger than the size of your largest data file, expressed in 
  1714.       kilobytes.  This allows for transmission of the file over a slow link 
  1715.       running at one kilobyte per second.  Multiply this by three or four if 
  1716.       network delays are common. 
  1717.  
  1718.    3. 'Connection maintain' -- the "wait timeout", in seconds.  This is is the 
  1719.       time for which GoServe will wait for a new request after responding to a 
  1720.       request that included a 'Connection: keep-alive' header.  Note that 
  1721.       expiry of this timeout, when a request is not received, is considered 
  1722.       normal; it is therefore not audited as a limit exceeded or an error. 
  1723.  
  1724.       The default is 0 seconds, which means that GoServe will never accept more 
  1725.       than one request per connection.  To accept multiple requests per 
  1726.       connection, set this to a non-zero value.  Suggested values might be 
  1727.       10-15 seconds (to handle most cases of embedded images in HTML pages, for 
  1728.       example) or 60-120 seconds (to handle most cases of multiple pages being 
  1729.       requested by the same client). 
  1730.  
  1731.    4. 'Wait for TCP/IP start' -- the "start timeout", in seconds.  This is the 
  1732.       time for which GoServe will wait on startup for TCP/IP to become 
  1733.       operational, while retrying appropriate TCP/IP calls as necessary 
  1734.       [default 600 seconds].  This allows asynchronous starting of TCP/IP and 
  1735.       GoServe.  A value of 0 seconds means immediate timeout (that is, no 
  1736.       retrys are performed, and GoServe will not start if an error is found). 
  1737.       No TCP/IP retry is attempted if the requested port is in use (that is, it 
  1738.       is likely that another copy of GoServe is already running). 
  1739.  
  1740.  Notes on timeouts: 
  1741.  
  1742.    1. For the first two timeouts, a value of zero seconds may be specified to 
  1743.       indicate an indefinite time (that is, the timeout check is not made). 
  1744.       You should only set both timeouts to zero if the filter is trusted, the 
  1745.       data it accesses is always available locally, and all clients used with 
  1746.       the server have a timeout mechanism. 
  1747.  
  1748.    2. Also for the first two timeouts, when the timeout takes place there may 
  1749.       be some delay (typically up to 10 seconds) before the transaction is 
  1750.       interrupted.  If the Rexx filter is still running, it will have the HALT 
  1751.       condition raised during this process; the HALT condition may be trapped 
  1752.       by CALL ON HALT or SIGNAL ON HALT for necessary cleanup which should 
  1753.       normally be followed by an immediate EXIT. 
  1754.  
  1755.  
  1756. ΓòÉΓòÉΓòÉ 10.7. --- Incoming data --- ΓòÉΓòÉΓòÉ
  1757.  
  1758. The 'Incoming data' set is on the second Limits page (use the rightmost button 
  1759. at the bottom of the first page, or Alt+Page Down, to get to it). It has two 
  1760. limits which restrict how much incoming data will be accepted by the server 
  1761. (per request): 
  1762.  
  1763.    1. 'Header size' -- the maximum size (in thousands of bytes) of header that 
  1764.       will be accepted in one request.  The transaction will be ended if a 
  1765.       header is received that exceeds the specified size; this gives some 
  1766.       protection against a client that sends an invalid or never-ending header. 
  1767.       This limit is used whenever a header is read, either automatically or 
  1768.       because of the READ command.  The default is 10 thousand bytes (10kB). 
  1769.  
  1770.    2. 'Body data size' -- the maximum size (in thousands of bytes) of body data 
  1771.       that will be accepted in one request.  The transaction will be ended if a 
  1772.       client sends data that exceeds the specified size, and an attempt is made 
  1773.       to read it using the READ command. The default is 50 thousand bytes 
  1774.       (50kB). 
  1775.  
  1776.  
  1777. ΓòÉΓòÉΓòÉ 10.8. Parameters on the GoServe command ΓòÉΓòÉΓòÉ
  1778.  
  1779. Keyword parameters may be used when starting GoServe to set the protocol (one 
  1780. only) and the TCP/IP port used, the default data directory, the action taken 
  1781. after a serious failure, and reuse of a port.  They may be specified in any 
  1782. order: 
  1783.  
  1784.      The 'HTTP' parameter 
  1785.  
  1786.       This indicates that GoServe is being used as a World Wide Web server, 
  1787.       using the Hypertext Transfer Protocol (HTTP).  When this is specified, 
  1788.       the default port number is 80, the well-known port for HTTP (this may be 
  1789.       overridden as usual by the PORT parameter), and other enhancements are 
  1790.       enabled, including: 
  1791.  
  1792.         -  The TYPE option may (and should) be used on FILE responses from the 
  1793.            filter. 
  1794.  
  1795.         -  Automatic processing of both incoming and outgoing HTTP headers is 
  1796.            enabled (see "Automatic HTTP processing"). 
  1797.  
  1798.         -  Tab characters have no special significance in request strings; the 
  1799.            third argument passed to the filter is a 'clean' URI (see "Filter 
  1800.            programs"). 
  1801.  
  1802.         -  STRING and CONTROL command responses are returned as HTML documents. 
  1803.  
  1804.      The 'GOPHER' parameter 
  1805.  
  1806.       This indicates that GoServe is being used as a Gopher server, using the 
  1807.       Gopher Protocol.  When this is specified, the default port number is 70, 
  1808.       the well-known port for Gopher (this may be overridden as usual by the 
  1809.       PORT parameter).  The Gopher termination sequence (a line containing just 
  1810.       a single '.') is added to TEXT files and STRING and CONTROL responses. 
  1811.  
  1812.      The 'PORT n' parameter 
  1813.  
  1814.       The default port number for the selected protocol may be changed for 
  1815.       special applications by using the PORT parameter when starting GoServe, 
  1816.       for example: 
  1817.  
  1818.                   start goserve http port 801
  1819.  
  1820.       Servers started with different ports are independent; they use different 
  1821.       filter programs, and maintain a different collection of options, window 
  1822.       position information, audit file, etc. 
  1823.  
  1824.       Note that the port number is used as the required or default file 
  1825.       extension for some files, such as the filter, programs called from the 
  1826.       filter, and the audit/log files.  This is so that the files for different 
  1827.       ports don't conflict when in the same directory. Therefore, if you use 
  1828.       port numbers greater than 999, you must be sure that the working 
  1829.       directory for GoServe is on a disk that supports extensions of more than 
  1830.       three characters (for example, an HPFS disk). 
  1831.  
  1832.      The 'DATADIR d' parameter 
  1833.  
  1834.       This sets the data directory name (path) that will be used for this port 
  1835.       from the word following the keyword DATADIR.  This name will be used 
  1836.       until the name is changed using the 'DataDir' Options notebook page or by 
  1837.       starting GoServe with a different DATADIR parameter.  The name should 
  1838.       normally include the drive on which the data are to be found. 
  1839.  
  1840.       The data directory name is not used directly by GoServe, but is made 
  1841.       available to the filter program via the DataDir() function--hence 
  1842.       allowing one filter to handle different data directories without 
  1843.       "hard-coding" their names in the filter. 
  1844.  
  1845.       GoServe will convert backslashes ('\') in the name to URI form (forward 
  1846.       slashes, '/'), and will add a trailing '/' if one is not present.  For 
  1847.       example, 
  1848.  
  1849.                   start goserve http datadir d:\myhome
  1850.  
  1851.       would result in the directory specification 'd:/myhome/' being passed to 
  1852.       the filter via the DATADIR() function. 
  1853.  
  1854.      The 'FILTER f' parameter 
  1855.  
  1856.       This sets the filter name that will be used for this port from the word 
  1857.       following the keyword FILTER.  This name will be used until the name is 
  1858.       changed using the 'Filter' options notebook page or by starting GoServe 
  1859.       with a different FILTER parameter.  The filter must be in the GoServe 
  1860.       working (current) directory, so no drive or directory path should be 
  1861.       specified.  For example: 
  1862.  
  1863.                   start goserve http filter myfilter.80
  1864.  
  1865.       would result in the filter 'd:\goserve\myfilter.80' being used, if 
  1866.       'D:\goserve' is the working directory.  If no file extension is specified 
  1867.       (that is, no period is found in the name), the port will be added as the 
  1868.       extension. 
  1869.  
  1870.      The 'QUIETFAIL' parameter 
  1871.  
  1872.       Certain "catastrophic" errors (such as memory allocation errors, or a 
  1873.       syntax error in the Rexx filter) are considered failures by GoServe; that 
  1874.       is, they cause a message dialog to be displayed on the screen--once the 
  1875.       message is acknowledged, GoServe ends. 
  1876.  
  1877.       The QUIETFAIL parameter can be used to prevent the failure message dialog 
  1878.       being displayed: 
  1879.  
  1880.                   start goserve http quietfail
  1881.  
  1882.       In this case, GoServe will end immediately after a failure (after 
  1883.       attempting to audit the failure, as usual). 
  1884.  
  1885.      The 'REUSE' parameter 
  1886.  
  1887.       This allows reuse of the requested port, even if some other application 
  1888.       (or TCP/IP) has not released it.  TCP/IP may hold on to a port for two or 
  1889.       three minutes after an application (or GoServe itself) releases it. 
  1890.  
  1891.  GoServe also accepts some experimental keyword parameters: 
  1892.  
  1893.      'TRACE' copies audit information to the PMprintf window (without GoServe 
  1894.       timestamps); this does not affect auditing to the audit file.  This lets 
  1895.       you watch a trace of incoming requests, actions, and errors as they 
  1896.       happen without needing to look at the audit file itself. 
  1897.  
  1898.      'TEST' controls experimental features (such as sending a Message-ID 
  1899.       header) and also adds an extra Test page to the options notebook. The 
  1900.       Test features are undefined (that is, they may be removed in future 
  1901.       versions of GoServe). 
  1902.  
  1903.      'DIAG' shows TRACE information together with additional details of 
  1904.       GoServe operation (also using PMprintf).  This diagnostic information is 
  1905.       intended for development use and may change over time.  If you are 
  1906.       observing unexpected GoServe behaviour, the DIAG option may show helpful 
  1907.       information.  'DIAG2' and 'DIAGMSG' may provide even more verbose 
  1908.       diagnostic information.  'DIAG' implies 'REUSE'. 
  1909.  
  1910.  Any number of GoServe parameters may be specified, in any order.  If a 
  1911.  parameter with a value is specified more than once, the last value is used. 
  1912.  
  1913.  
  1914. ΓòÉΓòÉΓòÉ 10.9. GoServe return codes ΓòÉΓòÉΓòÉ
  1915.  
  1916. When GoServe ends, a return code is returned to the caller (for example, when 
  1917. invoked from a Rexx program, this return code is placed in the Rexx variable 
  1918. RC).  The value is restricted by the operating environment to be in the range 0 
  1919. through 255; GoServe uses one of three possible values: 
  1920.  
  1921.  [0]       Normal completion (user action or OS/2 shutdown). 
  1922.  [1]       GoServe was ended by the CLOSE filter command. 
  1923.  [8]       Abnormal completion (failure), such as a syntax error in the filter. 
  1924.  
  1925.  
  1926. ΓòÉΓòÉΓòÉ 11. Greenwich Mean Time (GMT) ΓòÉΓòÉΓòÉ
  1927.  
  1928. The HTTP protocol (like most international networking protocols) requires that 
  1929. dates and times, where used, be quoted in GMT.  The personal computers on which 
  1930. OS/2 runs, however, do not require that a GMT clock be available--instead, the 
  1931. clock is usually set to local time. 
  1932.  
  1933. Various mechanisms are used in OS/2 to indicate and calculate the current 
  1934. offset from GMT.  The most common is to use an OS/2 environment variable named 
  1935. 'TZ', and for many people running GoServe this will already be set (for example 
  1936. to 'EST5EDT' for the USA East Coast).  See the separate section on setting the 
  1937. value of the TZ variable. 
  1938.  
  1939. If TZ is not set, GoServe will only use local time (and HTTP protocols and 
  1940. header fields that require GMT will not be used or generated). 
  1941.  
  1942. If the TZ variable is set, GoServe will convert from local time to GMT as 
  1943. appropriate.  It will also detect a clock dislocation (that is, when the 
  1944. time-of-day clock is changed by more than 10 seconds) automatically, and record 
  1945. and re-calculate the GMT offset when this occurs--such as when you change your 
  1946. clock for daylight-savings time. 
  1947.  
  1948. Notes: 
  1949.  
  1950.    1. You can see the offset that GoServe has computed by using the CONTROL 
  1951.       STATISTICS command or the GMTOFFSET() function. 
  1952.  
  1953.    2. Inevitably, for a few seconds between when you change the time and when 
  1954.       GoServe detects that it has been changed, incoming transactions may be 
  1955.       processed with anomalous time data; to avoid this, stop GoServe before 
  1956.       making large time adjustments and restart it afterwards. 
  1957.  
  1958.    3. Files in the PC-DOS and OS/2 FAT and HPFS file systems are timestamped 
  1959.       with the local time of creation or last modification. The time-zone and 
  1960.       daylight savings regime of that zone (and hence the GMT offset) are not 
  1961.       available.  GoServe therefore calculates the GMT timestamp of a file by 
  1962.       using the current GMT offset. 
  1963.  
  1964.    4. If you are running a machine as a dedicated Web server, you may wish to 
  1965.       set its clock to GMT and leave it set that way all year; in this case, 
  1966.       set TZ to 'GMT0'. 
  1967.  
  1968.  
  1969. ΓòÉΓòÉΓòÉ 12. Response time recording ΓòÉΓòÉΓòÉ
  1970.  
  1971. GoServe records the response times of the most recent one hundred completed 
  1972. requests. 
  1973.  
  1974. 'Response time', here, means the time from when the client connection is 
  1975. accepted to when the first data bytes are sent for the first request in a 
  1976. transaction, or (for subsequent requests during a connection) the time from 
  1977. when the previous request was completed to when the first data bytes are sent 
  1978. for the current request. 
  1979.  
  1980. The response time may include the time to receive some or all of the request 
  1981. data from the client, but excludes any time taken waiting for data to become 
  1982. available at the server.  It never includes the time taken to send the response 
  1983. (which may be very large, and dependent on network delays).  Response times of 
  1984. transactions ended due to a timeout or other limit being exceeded are not 
  1985. recorded. 
  1986.  
  1987. The average response time of those recorded, to the nearest 0.01 second, is 
  1988. shown on the main GoServe window, next to the transactions count (unless an 
  1989. error has occurred).  A more precise figure, along with the number of 
  1990. transactions over which it was recorded, is included in the CONTROL STATISTICS 
  1991. response (this figure will not reflect the response time of the transaction 
  1992. that initiates the CONTROL STATISTICS command). The same, more precise, figure 
  1993. is also shown on the 'Response' page of the Options notebook. 
  1994.  
  1995. The average read wait time (the time taken waiting for data to become available 
  1996. at the server during response time measurement) is also shown on the CONTROL 
  1997. STATISTICS result.  The sum of this and the average response time gives the 
  1998. average total elapsed response time, as observed by the server. 
  1999.  
  2000. The GoServe response time directly affects the response time seen by the person 
  2001. using the client browser, so it is desirable to keep this as low as possible; 
  2002. the 'Response goal' setting in the Options notebook is provided to make it 
  2003. easier to judge the performance of your server setup.  The read wait times are 
  2004. not included in response times so that the graph and averages only reflect 
  2005. delays that are under the control of the server. 
  2006.  
  2007. The response times record may be reset using CONTROL RESET RESPONSE (or the 
  2008. Actions menu item 'Reset response times'). 
  2009.  
  2010.  
  2011. ΓòÉΓòÉΓòÉ 13. Automatic HTTP processing ΓòÉΓòÉΓòÉ
  2012.  
  2013. GoServe automates several aspects of the HTTP/1.0 protocol. (For full details 
  2014. of the protocol, please see the HTTP specification.)  When an HTTP/1.0 request 
  2015. is received, the HTTP header lines are read automatically (if needed).  The 
  2016. Content-Length and If-Modified-Since values are extracted as appropriate. 
  2017.  
  2018. When a completion command is processed, GoServe will (if the incoming request 
  2019. was HTTP/1.0) generate an appropriate response line and HTTP header.  For 
  2020. example, for a FILE command with a given file TYPE, this will include the 
  2021. following header lines: 
  2022.  
  2023.    1. 'Server:'  The name and version of the server (e.g., 'GoServe/1.88'). 
  2024.  
  2025.    2. 'Date:'  The message origination date and time (only if GMT can be 
  2026.       determined). 
  2027.  
  2028.    3. 'Message-ID:'  A unique identifier for the message.  For example, 
  2029.       '<19950101121030.80.123@12.34.56.78>', which is the local date and time 
  2030.       that the server was started, the port which it is serving, and the 
  2031.       transaction number, followed by the primary host address.  This header is 
  2032.       not required by the HTTP protocol, and so is only sent if the GoServe 
  2033.       TEST parameter is in effect. 
  2034.  
  2035.    4. 'Content-Type:'  The value set by the TYPE parameter. 
  2036.  
  2037.    5. 'Content-Length:'  The length of the file (less 1, if TEXT was  specified 
  2038.       and the file ends in an EOF character). 
  2039.  
  2040.    6. 'Content-Transfer-Encoding:'  Currently always 'binary'. 
  2041.  
  2042.    7. 'Expires:'  Set to the current time (only if GMT is available and  ERASE 
  2043.       was specified on the FILE command). 
  2044.  
  2045.    8. 'Last-Modified:'  Set to the timestamp of the file, converted to GMT 
  2046.       (only if GMT is available and ERASE was not specified). 
  2047.  
  2048.  Finally, GoServe will not actually send the body of the file if the request 
  2049.  verb was HEAD or (if the verb was not HEAD) if the 'Last-Modified' date is 
  2050.  older or the same as the first 'If-Modified-Since' date found in the request 
  2051.  header (if any).  In this latter case, the response line will be 'HTTP/1.0 304 
  2052.  Not Modified'. 
  2053.  
  2054.  Notes: 
  2055.  
  2056.    1. If the response line has been set explicitly by the RESPONSE command, 
  2057.       this overrides any possible "Not Modified" response, and so the 
  2058.       'If-Modified-Since' check does not take place (that is, the body of the 
  2059.       response will be sent). 
  2060.  
  2061.    2. If the client does not send the header within a short time after the 
  2062.       request string, the 'If-Modified-Since' check may be bypassed. This 
  2063.       bypass is to allow for some older clients that are not fully HTTP/1.0 
  2064.       compliant, and may be removed later. 
  2065.  
  2066.    3. GoServe supports and automatically generates, where appropriate, the 
  2067.       experimental 'Connection: keep-alive' headers used for handling multiple 
  2068.       requests over one connection.  See "Persistent connections" for more 
  2069.       details. 
  2070.  
  2071.    4. GoServe does not automatically send a "MIME-Version" header field, as it 
  2072.       can make no guarantee that the message as a whole is MIME-compliant (and 
  2073.       in most cases it will not be). 
  2074.  
  2075.    5. The 'HEADER NOTIME' command may be used to inhibit the sending of the 
  2076.       'Expires:' or 'Last-Modified:' header lines. 
  2077.  
  2078.  As described elsewhere, GoServe also supports limited features of the HTTP/1.1 
  2079.  protocol, though most of the (normally automatic) actions will have to be 
  2080.  performed by the filter. 
  2081.  
  2082.  
  2083. ΓòÉΓòÉΓòÉ 14. File command cache ΓòÉΓòÉΓòÉ
  2084.  
  2085. GoServe includes an optional performance optimization that may be useful for 
  2086. heavily loaded servers or for applications where response time is critical. 
  2087. You should only use this option if (a) you are already allowing access to all 
  2088. files in your GoServe data directory, as when using the sample filter, or (b) 
  2089. you have read and understood the remainder of this section. 
  2090.  
  2091. If the file command cache is made active (by selecting the 'Active' checkbox in 
  2092. the 'File command cache' box on the 'General' page of the options notebook), 
  2093. then eligible FILE commands will be associated with the current HTTP or Gopher 
  2094. request.  If the identical request line is received later, the FILE command 
  2095. will be executed immediately, without invoking the filter. 
  2096.  
  2097. This caching avoids the overhead of calling the filter.  For the sample filter, 
  2098. this is small (less than 15ms on a 486/50MHz PC), but with more complex filters 
  2099. this can be significant. 
  2100.  
  2101. Eligible file commands are those which do not specify ERASE or NOCACHE (see 
  2102. below), do not follow a SEND command, and which are issued in response to an 
  2103. HTTP GET request or any Gopher request. 
  2104.  
  2105. Note, however, that if the file command cache is used, there is no filtering of 
  2106. the request, and so the file will be sent unconditionally (that is, no security 
  2107. checking will take place, for example). Therefore, if file caching is to be 
  2108. used, FILE commands referring to sensitive files should be protected by 
  2109. specifying the NOCACHE option on the command.  This prevents them being cached, 
  2110. and so requests for those files will always be processed by the filter. 
  2111.  
  2112. The intent of the file command cache is to minimize the response time to the 
  2113. client and the load on the server by avoiding the call to the filter.  You may, 
  2114. however, request that the filter still be called (after the cached FILE command 
  2115. has been executed) by selecting the 'Call filter anyway' radio button on the 
  2116. 'General' page or by executing 'SET FASTFILTER ON.  This may be useful when 
  2117. specialized logging is being carried out, for example.  The filter can detect 
  2118. whether a cached FILE command has already been successfully executed by using 
  2119. the COMPLETED() function call. 
  2120.  
  2121.  
  2122. ΓòÉΓòÉΓòÉ 15. The audit mechanism ΓòÉΓòÉΓòÉ
  2123.  
  2124. GoServe includes a built-in audit mechanism that records events in an audit 
  2125. file while GoServe is running.  This maintains a record of usage, and also 
  2126. records any errors or failures of the server. 
  2127.  
  2128. By default, all audit information (see details below) except selectors is 
  2129. recorded.  Choose the 'Audit' page of the Options notebook for detailed control 
  2130. over which audit information will be written to the audit file.  You should 
  2131. only select auditing of 'Selectors' if the recording of selectors (request 
  2132. strings) would not compromise confidentiality or privacy. 
  2133.  
  2134. The audit file has a fixed filename (GOAUDIT), with an extension that is the 
  2135. TCP/IP port number used (for example, 'GOAUDIT.80').  It is written in the 
  2136. working directory for GoServe.  The audit file may be read but not altered 
  2137. while GoServe is running. 
  2138.  
  2139. For reliability, the audit file is written directly to disk and not cached by 
  2140. the file system (though GoServe caches some informational lines briefly to 
  2141. improve response time).  You can select the 'Lazy audit' option for caching of 
  2142. up to five seconds, which will improve server throughput under load. 
  2143.  
  2144. Each line in the audit file starts with three words, separated by one or more 
  2145. blanks: the time (hhmmss), the audit type (one character), and the transaction 
  2146. number (a number, incremented for each connection accepted, that begins at 0 
  2147. when GoServe is started).  Additional information follows, depending on the 
  2148. audit type: 
  2149.  
  2150.  A (Accept)       - addresses of the client and (if non-prime) server (n.n.n.n) 
  2151.  C (Complete)     - response time (seconds), and description of action 
  2152.  D (Day/Time)     - current day (yyyymmdd), and description of adjustment 
  2153.  E (Error)        - description of an error in processing (e.g., timeout) 
  2154.  F (Failure)      - description of the failure (terminating error) 
  2155.  I (Information)  - description of information (statistics, etc.) 
  2156.  L (Limit)        - description of limit that has been exceeded 
  2157.  N (Network)      - description of how network or client ended transaction 
  2158.  P (Primary)      - primary server address and port (n.n.n.n nn) 
  2159.  S (Selector)     - selector received from client for each new request 
  2160.  U (User)         - description of event from User (filter) command 
  2161.  
  2162.  The 'A' audit line includes the address of the server only if this is 
  2163.  different from the primary server address shown on the 'P' line.  This may 
  2164.  occur if more than one network is active (perhaps a real network and a 
  2165.  loopback configuration, or more than one active network adapter cards). 
  2166.  
  2167.  The times (and dates) recorded in the audit file may be in GMT (the default) 
  2168.  or in local time (the default for GoServe 1.41 and earlier). The default may 
  2169.  be altered using the 'Audit Selection' dialog, but note that use of GMT is 
  2170.  only possible if GMT times are available (that is, the TZ environment variable 
  2171.  was set when GoServe was started or when a time dislocation was detected).  If 
  2172.  GMT is in use, the word 'GMT' is added after the current day on 'D' audit 
  2173.  lines. 
  2174.  
  2175.  Additional audit types may be added later.  The format of any "description" in 
  2176.  the above is not strictly defined, except that all Carriage Return, Line Feed, 
  2177.  and End of File characters (ASCII '0d'x, '0a'x, and '1a'x) are translated to 
  2178.  '[', ']' and '#' respectively to ensure audit file lines are well defined. 
  2179.  
  2180.  For example: 
  2181.  
  2182.     103701 D 0 19950620 GMT ----- GoServe 2.40 -----
  2183.     103701 P 0 9.20.1.20 80
  2184.     103726 A 1 9.20.5.59
  2185.     103726 S 1 GET / HTTP/1.0
  2186.     103727 C 1 0.9 Sent file "d:/gohttp/index.htm" [979 bytes in 0.02s]
  2187.     103727 A 2 9.20.5.59
  2188.     103727 S 2 GET /pmglobe.gif HTTP/1.0
  2189.     103728 C 2 0.95 Sent file "d:/gohttp/pmglobe.gif" [2154 bytes in 0.043s]
  2190.     103737 A 3 9.20.5.59
  2191.     103737 S 3 GET /globe?22,40 HTTP/1.0
  2192.     103738 C 3 0.9 Sent string "You clicked on the globe" [423 bytes in 0.07s]
  2193.     103745 A 4 9.20.5.59
  2194.     103745 S 4 GET /samptest.htm HTTP/1.0
  2195.     103746 C 4 1 Sent file "d:/gohttp/samptest.htm" [664 bytes in 0.012s]
  2196.     103750 A 5 9.20.5.59
  2197.     103750 S 5 GET /!statistics HTTP/1.0
  2198.     103750 C 5 0.8 Sent response "CONTROL STATISTICS" [708 bytes in 0.017s]
  2199.     103808 I 5 Bytes sent 4928 received 3045
  2200.     103808 I 5 Close
  2201.  
  2202.  Most requests will end normally, with a 'C' line in the audit file.  If an 
  2203.  error occurs, there may be one or more 'E' lines in the audit file instead. 
  2204.  If a transaction is ended by the client or network, than an 'N' line is used, 
  2205.  which is not recorded as an error.  Similarly, when a chosen limit is exceeded 
  2206.  (such as a timeout) an 'L' line is used, which also is not recorded as an 
  2207.  error.  A persistent-connection timeout is considered an uninteresting event 
  2208.  and is not audited. 
  2209.  
  2210.  The response time recorded on 'C' lines is rounded down to the nearest 
  2211.  millisecond below, and measures the total elapsed time from receiving the 
  2212.  request to the first send of data to the client.  This excludes any time spent 
  2213.  waiting for the network, but includes any time taken to receive data from the 
  2214.  network and so depends on the network as well as the speed of the processor 
  2215.  and the work done by the filter.  (See also "Response time recording" for more 
  2216.  details.) 
  2217.  
  2218.  The 'bytes' count on 'C' lines is the total number of bytes sent to the client 
  2219.  (including any overhead demanded by the protocol in use), and the time shown 
  2220.  after the bytes count is the total elapsed time for sending the response 
  2221.  (rounded down to the nearest millisecond below).  This latter depends on the 
  2222.  speed and activity of the server, client, and the network between the two.  It 
  2223.  is likely to be rather variable. 
  2224.  
  2225.  
  2226. ΓòÉΓòÉΓòÉ 15.1. --- Viewing or archiving the audit file --- ΓòÉΓòÉΓòÉ
  2227.  
  2228. To look at an 'active' audit file, use a program or command that allows shared 
  2229. reading of files.  TYPE is one such command; its output may be redirected to a 
  2230. file to take a snapshot copy of the audit file.  For example: 
  2231.  
  2232.   type goaudit.80 > snapshot.log
  2233.  
  2234. In addition, the Actions pull down menu has an item 'Move audit to archive'. 
  2235. This closes the audit file, appends it to the GoServe archive file in the 
  2236. current working directory, then erases and re-opens the audit file.  The 
  2237. GoServe filter can also initiate this action, by returning "control 
  2238. moveaudit"--see "CONTROL command" for details. 
  2239.  
  2240. The GoServe archive file has a fixed filename (GOARCH), with an extension that 
  2241. is the TCP/IP port number used (for example, 'GOARCH.80').  It is only touched 
  2242. by GoServe during a "Move audit to archive", so is readily copied, edited, or 
  2243. renamed. 
  2244.  
  2245.  
  2246. ΓòÉΓòÉΓòÉ 16. Remote control of GoServe ΓòÉΓòÉΓòÉ
  2247.  
  2248. GoServe filters (see "Filter programs") can request that GoServe perform 
  2249. certain actions, instead of just returning files or other data.  These requests 
  2250. may be used to control GoServe remotely (from another machine or from another 
  2251. process on the same machine).  Control requests can return a document 
  2252. containing one or more response lines, either showing successful completion of 
  2253. the request or indicating an error. 
  2254.  
  2255. Specifically, if the CONTROL command is used without the VAR option (either 
  2256. from within the filter program or by being returned by the filter) then the 
  2257. command action is performed and the result string is returned to the client as 
  2258. a document. 
  2259.  
  2260. More sophisticated control is possible by using the EXTRACT and SET commands to 
  2261. inspect and alter a wide variety of GoServe's internal settings. 
  2262.  
  2263. The sample pages (GOR*.HTM) and the remote control filter (GOREMOTE.80) filters 
  2264. included in the package use these commands to duplicate the functions available 
  2265. locally via the Options settings notebook.  All the information and settings 
  2266. available in the Options notebook (except the response time graph) are 
  2267. available remotely. 
  2268.  
  2269. Please note that for the Apply button to work on the remote control settings 
  2270. pages, you must first provide and enable a password in the "authorize:" 
  2271. subroutine in the main GOFILTER.80.  See that subroutine for instructions. 
  2272.  
  2273. The sample main filter also includes examples of using control commands 
  2274. initiated from standard menus or documents; these actions can be triggered 
  2275. remotely using a Gopher or Web client, as appropriate.  Rexx programs can also 
  2276. use the OS/2 TCP/IP RxSock library (included in the UN64092 CSD, August 1994, 
  2277. and also available from most OS/2 software sources) to send a specific request 
  2278. to a GoServe server.  A sample command, MOVEAUD.CMD, is included in the GoServe 
  2279. package as an indication of how this is used. 
  2280.  
  2281. The filter mechanism provides flexibility in how control requests are accepted 
  2282. and passed to GoServe, including the possibility of modification so that only 
  2283. clients with certain addresses would be able to use these options.  The sample 
  2284. Web filter includes an example of how this might be done, and the sample 
  2285. GOREMOTE.80 shows a mostly-generic example of forms processing. 
  2286.  
  2287.  
  2288. ΓòÉΓòÉΓòÉ 17. Persistent connections ΓòÉΓòÉΓòÉ
  2289.  
  2290. GoServe 2.41 (and later versions) supports an experimental implementation of 
  2291. persistent connections (discussed in detail in the HTTP working group mailing 
  2292. list in July-August 1995, and also in IETF draft form).  In brief, a client may 
  2293. request (by including the HTTP header 'Connection:' with value 'keep-alive' or 
  2294. 'maintain') that a server not close the connection after sending a response. 
  2295.  
  2296. The server may choose to ignore this, or it may hold the connection open for a 
  2297. period of time (typically 15 to 30 seconds), to allow the client to send 
  2298. further HTTP requests over the same connection.  In the latter case, the client 
  2299. is informed by the inclusion of a matching 'Connection:' header in the 
  2300. response.  At any time, the transaction can be concluded by either the client 
  2301. or server closing the connection or no longer using the 'Connection:' header in 
  2302. the request or response header. 
  2303.  
  2304. This persistent connection protocol is handled automatically by GoServe, under 
  2305. the control of the LIMITTIMEWAIT (connection maintain) setting. This setting 
  2306. limits the time that GoServe will wait for a new request after being asked to 
  2307. do so; it may be set to zero to force GoServe to accept only one request per 
  2308. connection; for the time being, this is the default setting. 
  2309.  
  2310. Notes: 
  2311.  
  2312.    1. 'Transactions' in GoServe is a count of connections, not HTTP requests. 
  2313.       The latter count is available in the CONTROL STATISTICS response (if 
  2314.       different from the transactions count) or by using QUERY REQUESTS or 
  2315.       EXTRACT REQUESTS.  The number of requests corresponds to the number of 
  2316.       'hits' in a World Wide Web context. 
  2317.  
  2318.    2. Clients connecting to a proxy instead of directly to a server must use 
  2319.       the 'Proxy-Connection: keep-alive' header instead, if a persistent 
  2320.       connection is being requested. 
  2321.  
  2322.    3. Suggested values for LIMITTIMEWAIT might be 15-30 seconds (which would 
  2323.       handle most cases of embedded images in HTML pages, for example) or 
  2324.       60-120 seconds (to handle most cases of multiple pages, with their 
  2325.       embedded images, being requested by the same client). 
  2326.  
  2327.    4. [Nov95] Current browsers use the value 'keep-alive' rather than 
  2328.       'maintain' in the connection header (the latter, from the HTTP working 
  2329.       group, is therefore probably obsolete).  For the time being, GoServe 
  2330.       supports both values and will respond with the value as received. 
  2331.  
  2332.    5. Once a connection is being maintained, GoServe will automatically SET 
  2333.       NETBUFFER OFF, so that all parts of a data stream will be sent to the 
  2334.       client immediately. 
  2335.  
  2336.    6. [Apr98] GoServe 2.52 and later versions support the HTTP 1.1 convention: 
  2337.       connections for an HTTP/1.1 request are assumed persistent, unless a 
  2338.       'Connection: close' header line is found or LIMITTIMEWAIT is 0. 
  2339.  
  2340.  
  2341. ΓòÉΓòÉΓòÉ 18. Why not CGI? ΓòÉΓòÉΓòÉ
  2342.  
  2343. Many Web servers support a protocol known as the Common Gateway Interface (CGI) 
  2344. for attaching and supporting scripts.  GoServe does not yet support this 
  2345. interface directly due to a number of difficulties with the design, of which 
  2346. the most significant (in no particular order) are: 
  2347.  
  2348.      The primary means of communicating information to scripts is by the use 
  2349.       of environment variables.  These all have to be set before the script is 
  2350.       called, and as the number of these grow the overhead approaches or 
  2351.       exceeds the cost of interpreting the script (GoServe has dozens of state 
  2352.       variables available to scripts). 
  2353.  
  2354.       For GoServe, Rexx variables could be set on startup -- but a clearer and 
  2355.       more efficient way of retrieving information is to use specialized 
  2356.       function calls (such as GoServe's REQFIELD) or general commands (such as 
  2357.       GoServe's EXTRACT, READ, and CONTROL).  With these mechanisms, data are 
  2358.       moved only when required. 
  2359.  
  2360.      Environment variables are a per-process resource in OS/2; GoServe's 
  2361.       scripts run on a per-thread basis (the script runs on the same thread 
  2362.       that handles the incoming connection, with no process overhead or 
  2363.       resource cleanup required). 
  2364.  
  2365.      The piping of the incoming data to the script would often mean that data 
  2366.       are read even when unused, hence increasing the load on the server (and, 
  2367.       in some cases, on the network and client browser). 
  2368.  
  2369.      For some servers, the output sent to the client is dependent on the name 
  2370.       of the script (for example, scripts whose name begins with "nph-" may 
  2371.       have their output treated differently from other scripts).  This means 
  2372.       that arbitrary script names cannot be supported. 
  2373.  
  2374.      Server directives (commands sent to the server) are sent using the same 
  2375.       namespace (header lines) as the header information being sent to the 
  2376.       client.  Separating this information, as in GoServe, leads to a more 
  2377.       reliable and extensible protocol. 
  2378.  
  2379.      CGI binary executables are loaded from .EXEs rather than as functions in 
  2380.       a DLL (which would be at least twenty times faster). 
  2381.  
  2382.      CGI does not define a channel between the script and the server while the 
  2383.       script is running.  Hence, dynamic information (such as connections and 
  2384.       load) known to the server cannot be made available to the script during 
  2385.       processing. 
  2386.  
  2387.      Standard output is used as a data channel to the server; this means that 
  2388.       the only data channel to the user (Webspinner) is standard error, which 
  2389.       is inappropriate for informative or status information, often used while 
  2390.       developing scripts.  It also means that data are processed more often 
  2391.       than needed. 
  2392.  
  2393.  For these reasons, it seemed unlikely that CGI scripts could be supported with 
  2394.  acceptable efficiency by GoServe.  GoServe's filters provide equivalent 
  2395.  function, and the processing logic will be essentially unchanged, so ports of 
  2396.  the algorithms required are easy. 
  2397.  
  2398.  If necessary (for example, to use an existing CGI script), the CGI interface 
  2399.  can be simulated by a GoServe filter.  Porting the script will, however, give 
  2400.  much better response times in many cases. 
  2401.  
  2402.  
  2403. ΓòÉΓòÉΓòÉ 19. Setting the TZ environment variable ΓòÉΓòÉΓòÉ
  2404.  
  2405. GoServe currently computes GMT from the local time-of-day clock (set by the 
  2406. TIME and DATE commands) and the setting of the TZ environment variable.  The 
  2407. simple form of the value of TZ (which is suitable for use in the USA or other 
  2408. countries that change to and from daylight savings time at the same time as the 
  2409. USA) is as shown in: 
  2410.  
  2411.   SET TZ=EST5EDT
  2412.  
  2413. where EST is the standard time zone name (this must be exactly three 
  2414. characters), EDT is the daylight savings time zone name (also exactly three 
  2415. characters), and 5 is the difference between the standard time zone and GMT, 
  2416. measured in hours West of GMT.  The second time zone name can be omitted if no 
  2417. daylight savings adjustment is used. 
  2418.  
  2419. The format of the GMT offset is 
  2420.  
  2421.   [+|-]hh[:mm[:ss]]
  2422.  
  2423. that is, the sign (and minutes and seconds) are optional. 
  2424.  
  2425. Note that the sign of the GMT offset used in the TZ variable is opposite to 
  2426. that used for calculating the local time, given GMT, as returned by the GoServe 
  2427. GMTOFFSET() function. 
  2428.  
  2429. The simple form of TZ setting assumes the USA default of 1 hour daylight 
  2430. savings change which starts at 01:00 on the first Sunday in April, and ends at 
  2431. 02:00 on the last Sunday of October. 
  2432.  
  2433. For other countries, the full form of the TZ value has to be used.  More 
  2434. formally, this is: 
  2435.  
  2436.   SET TZ=SSS[+|-]hh[:mm[:ss]]DDD,sm,sw,sd,st,em,ew,ed,et,shift
  2437.  
  2438. Where 'SSS', 'hh', 'mm', 'ss', and 'DDD' are the values as in the simple form. 
  2439. In the long form, all the other values must be specified, as follows. 
  2440.  
  2441. 'sm', 'sw', 'sd', and 'st' define the start time for daylight savings 
  2442. adjustment, where: 
  2443.  
  2444.      'sm' is the starting month (1 to 12) 
  2445.  
  2446.      'sw' is the starting week (1 to 4 counting from the beginning, or -1 to 
  2447.       -4 counting from the end).  0 indicates that a particular day of the 
  2448.       month is to be specified 
  2449.  
  2450.      'sd' is the starting day (0 to 6 [where 0 is Sunday] if 'sw' is non-zero, 
  2451.       or 1 to 31 if 'sw' is 0) 
  2452.  
  2453.      'st' is the starting time in seconds from midnight (e.g., 3600 for 
  2454.       01:00). 
  2455.  'em', 'ew', 'ed', and 'et' define the end time for daylight savings, and take 
  2456.  the same values. 
  2457.  
  2458.  'shift' is the shift in daylight time change, in seconds (e.g., 3600 if one 
  2459.  hour is to be added during daylight savings time). 
  2460.  
  2461.  For example, for the UK in 1997, the setting was: 
  2462.  
  2463.     SET TZ=GMT0BST,3,0,30,3600,10,0,26,7200,3600
  2464.  
  2465.  Note that there appears to be no provision for time zone names of more than 
  2466.  three characters (blanks are allowed, so fewer than three characters are OK). 
  2467.  
  2468.  
  2469. ΓòÉΓòÉΓòÉ 20. --- GoHTTP.doc --- ΓòÉΓòÉΓòÉ
  2470.  
  2471.  
  2472. ΓòÉΓòÉΓòÉ 20.1. Credits ΓòÉΓòÉΓòÉ
  2473.  
  2474.                    How to start using GoServe as a Web server
  2475.                    """""""""""""""""""""""""""""""""""""""""""
  2476.                                       GoServe 2.52
  2477.  
  2478.         Copyright (c) IBM Corporation, 1994, 1997.  All rights reserved.
  2479.                        Mike Cowlishaw, IBM UK Laboratories
  2480.                                 mfc@vnet.ibm.com
  2481.                                     - - - - -
  2482.  
  2483. About 
  2484.  
  2485.  
  2486. ΓòÉΓòÉΓòÉ 20.2. Introduction ΓòÉΓòÉΓòÉ
  2487.  
  2488. 'GoServe' is a multi-purpose server for OS/2, which supports the HyperText 
  2489. Transfer Protocol (HTTP), used by the World-Wide Web (often known as 'the Web' 
  2490. or 'WWW'). 
  2491.  
  2492. Providing that you already have TCP/IP installed and started, GoServe can be 
  2493. running and serving documents and other files across a network in minutes. 
  2494. There are no configuration files to be edited first. 
  2495.  
  2496. This document describes how to use GoServe as a Web server, and includes 
  2497. instructions on how to set up your own home page.  GOHTTP.ZIP includes a 
  2498. working home page and customization filter, together with several other sample 
  2499. pages.  The GoServe Web documentation is also included, linked to the sample 
  2500. home page. 
  2501.  
  2502. Note:  It is assumed that you have some familiarity with the Web, and have (and 
  2503. know how to use) a Web client, such as Web Explorer. 
  2504.  
  2505.  
  2506. ΓòÉΓòÉΓòÉ 20.3. Quick start ΓòÉΓòÉΓòÉ
  2507.  
  2508. Assuming you have unzipped GOSERV.ZIP into the directory of your choice (for 
  2509. example, D:\GOSERVE), then: 
  2510.  
  2511.    1. Open an OS/2 window 
  2512.  
  2513.    2. Unzip the included file GOHTTP.ZIP to a different directory.  To use the 
  2514.       default setup, put this 'data directory' on the same drive as the first 
  2515.       directory, and call it GOHTTP (for example, D:\GOHTTP). 
  2516.  
  2517.    3. Change your current directory back to the GoServe directory (for example, 
  2518.       D:\GOSERVE) 
  2519.  
  2520.    4. Start GoServe with the parameter "http", for example using: 
  2521.  
  2522.                    start goserve http
  2523.  
  2524.  You should then see a GoServe window (titled 'GoServe [HTTP]') appear. If 
  2525.  there are no error messages, the server is now active, and you should be able 
  2526.  to connect to the sample pages with any Web browser (available as a separate 
  2527.  program).  For example, if the name of your machine is "fred.hursley.ibm.com" 
  2528.  (use the "hostname" command, while connected to your network, to find it out 
  2529.  if you don't know it) then specifying a URL of "http://fred.hursley.ibm.com/" 
  2530.  should display the sample home page. 
  2531.  
  2532.  
  2533. ΓòÉΓòÉΓòÉ 20.3.1. --- Setting up an icon for GoServe --- ΓòÉΓòÉΓòÉ
  2534.  
  2535. To set up an icon (program reference object) for a GoServe Web server and 
  2536. (optionally) ensure that GoServe is started automatically when OS/2 is booted: 
  2537.  
  2538.    1. With your current directory being the GoServe directory (for example, 
  2539.       D:\GOSERVE), run the command: 
  2540.  
  2541.                    makeicon http
  2542.  
  2543.       This should make an icon called 'GoServe - Web' appear on the Desktop. 
  2544.       You can Move or drag it to another folder if you wish. The server can now 
  2545.       be started by clicking on the new icon (you may want to check that this 
  2546.       works). 
  2547.  
  2548.    2. Open the Startup folder (this may be on the Desktop or in the 'OS/2 
  2549.       System' folder). 
  2550.  
  2551.    3. Make a shadow of the GoServe icon in the Startup folder.  To do this, 
  2552.       hold down the Ctrl+Shift keys and then drag the icon to the Startup 
  2553.       folder, drop it, and release Ctrl+Shift.  (See the OS/2 documentation if 
  2554.       you need more details.) 
  2555.  
  2556.  With the shadow in the Startup folder, the server will be started 
  2557.  automatically whenever OS/2 is booted or rebooted. 
  2558.  
  2559.  
  2560. ΓòÉΓòÉΓòÉ 20.4. Your own home page ΓòÉΓòÉΓòÉ
  2561.  
  2562. The sample filter can be used to serve files such as HTML documents, images, 
  2563. and so on, without any changes or programming.  All you need to do is change 
  2564. the data files. 
  2565.  
  2566. Here's what you need to do to set up your own 'home page', given that the 
  2567. sample page above works: 
  2568.  
  2569.    1. Make a new directory for your own World-Wide Web data (for example, 
  2570.       called D:\WWWHOME). 
  2571.  
  2572.    2. Copy the file D:\GOHTTP\INDEX.HTM to your new directory, and modify it to 
  2573.       make your 'home page'.  To start with, to see if it works, it's probably 
  2574.       best to change a few words only.  For example, change the line 
  2575.  
  2576.                    Welcome to this sample home page.
  2577.  
  2578.       to something different. 
  2579.  
  2580.       If you leave any references in it to any of the other sample files, 
  2581.       you'll need to copy those over, too, for the links to work. 
  2582.  
  2583.    3. If GoServe is not already running, start it as before (don't forget the 
  2584.       'HTTP' parameter, if starting from a command prompt). 
  2585.  
  2586.       Choose 'Directory selection' from the 'Options' menu, and use the dialog 
  2587.       there to change the data directory to be your new directory (for example, 
  2588.       to D:\WWWHOME). 
  2589.  
  2590.    4. Try your favourite WWW client, connecting to your machine as before, and 
  2591.       it should now display your new home page. 
  2592.  
  2593.    5. All you have to do now is modify the home page to your liking. Most of 
  2594.       the tags needed (<h1> indicates Header level 1, etc.) are quite simple to 
  2595.       use, but you'll probably want to find an introduction to the tag language 
  2596.       (HTML, the HyperText Markup Language).  A good place to start is the Web 
  2597.       "home" at CERN: http://info.cern.ch/ 
  2598.  
  2599.  All of the details above can be customized if you wish, but you will probably 
  2600.  need to learn more about GoServe and Rexx to change things effectively. 
  2601.  Please see GOSERVE.DOC for more information. 
  2602.  
  2603.  This document, the latest GoServe package, and other relevant links, 
  2604.  information, and programs are available at the GoServe Web page at 
  2605.  http://www2.hursley.ibm.com/goserve/ 
  2606.  
  2607.  
  2608. ΓòÉΓòÉΓòÉ 20.5. An overview on how GoServe works ΓòÉΓòÉΓòÉ
  2609.  
  2610. (To make sense of this, you may need to read GOSERVE.DOC too.) 
  2611.  
  2612. Whenever a client connects to your machine, it sends a 'request string'. 
  2613. GoServe receives the string and passes it to a 'filter'.  This filter (a 
  2614. program, written in Rexx) checks that the request is valid, and normally 
  2615. responds with a file (such as an HTML document or a GIF image file).  It is the 
  2616. filter's responsibility to choose or create the file, given the incoming 
  2617. request string. 
  2618.  
  2619. A sample filter (GoFilter.80) is provided--see commentary in that program for 
  2620. details.  In brief, it asks the server for the name of the data directory, 
  2621. checks for certain errors, and then processes the request according to the verb 
  2622. (method) specified in the request.  Notes: 
  2623.  
  2624.    1. The sample filter gets the root, or home, directory for the data it is to 
  2625.       serve by calling the DATADIR() function.  The value this returns is set 
  2626.       by GoServe (which, in turn, is derived from the GoServe startup parameter 
  2627.       or the Directory Selection dialog). 
  2628.  
  2629.    2. Only the most common verbs are handled by the sample filter: 
  2630.  
  2631.           GET is the most common ('send me some data') request.  In most 
  2632.            cases, this sends back a file to the client, using the GoServe FILE 
  2633.            command. 
  2634.  
  2635.           HEAD is the same as GET, except that the data are not sent back to 
  2636.            the client.  GoServe automatically ensures that only 'header' lines, 
  2637.            which describe the data, are sent.  HTTP requires that all servers 
  2638.            handle both GET and HEAD verbs. 
  2639.  
  2640.           POST is used by a client when data are to be sent to the server (for 
  2641.            example, text filled in for a Form, or a "post" to a newsgroup). 
  2642.            When the data is known to be short (fewer than 250 characters), GET 
  2643.            may be used instead; the specification of which method to use is 
  2644.            included in the <form ...> tag of the source document. 
  2645.  
  2646.    3. A default document is provided if none is specified. Conventionally, this 
  2647.       is called 'index.htm' or 'index.html'; a sample 'index.htm' is provided 
  2648.       (you can rename this to 'index.html' if you are using an HPFS disk). 
  2649.  
  2650.    4. The TYPE option, where specified on a FILE response, indicates that the 
  2651.       server should prefix an HTTP 'OK' response and header to the beginning of 
  2652.       the file returned.  The TYPE option is followed by the MIME type (e.g., 
  2653.       text/html or image/gif) of the file being returned.  Web servers should 
  2654.       normally always specify a TYPE on a FILE command. 
  2655.  
  2656.    5. Requests should be specified in URI form in that forward slashes should 
  2657.       be used instead of backslashes to indicate directories.  For example, 
  2658.       with the sample setup, the tag <a href="fred/%7Edata.htm"> would cause 
  2659.       the filter to receive the URI '/fred/%7Edata.htm'.  The packed URI (third 
  2660.       argument string) would then be 'fred/~data.htm'. The filter then prefixes 
  2661.       the home directory name, resulting in a file specification such as 
  2662.       'd:/gohttp/fred/~data.htm'.  This would refer to the OS/2 file 
  2663.       'd:\gohttp\fred\~data.htm'.  GoServe (actually the OS/2 I/O routines) 
  2664.       will make the appropriate '/' to '\' adjustments. 
  2665.  
  2666.    6. Errors are signalled to the client by sending back files that start with 
  2667.       the appropriate HTTP header line; these are generated by an internal 
  2668.       subroutine, which can be modified for more detailed or personal error 
  2669.       messages.  This subroutine could be made external if the TEMPFILE value 
  2670.       is passed as an argument when it is called. 
  2671.  
  2672.    7. The sample 'globemap' routine shows how the coordinates of a click on an 
  2673.       active image can be processed.  This particular routine returns the 
  2674.       coordinates as a percentage of half the image size, relative to the 
  2675.       middle and with map-style coordinates (X is positive to the East, Y is 
  2676.       positive to the North). 
  2677.  
  2678.    8. Certain special 'test and control' requests are supported by the sample 
  2679.       filter (for example, return server statistics).  In the sample filter, 
  2680.       these are only allowed from a client with the same address as the server. 
  2681.       Other possibilities include allowing 'ANY' as the allowed name [so anyone 
  2682.       can use them], or, conversely, using a privately-selected URL for the 
  2683.       controls--which would act as a password.  See GOSERVE.DOC for more 
  2684.       information on control options. 
  2685.  
  2686.    9. HTTP defines a simple 'basic' access control mechanism, and an example of 
  2687.       using this is included in the filter and sample pages. When used, the 
  2688.       person using the browser is prompted for a userid and password; the 
  2689.       filter checks the validity of this. 
  2690.  
  2691.  
  2692. ΓòÉΓòÉΓòÉ 20.6. Data organization and setup ΓòÉΓòÉΓòÉ
  2693.  
  2694. It is recommended that the control and execution files be placed in a directory 
  2695. separate from your data, perhaps called GOSERVE.  This may be the same 
  2696. directory as is already being used for running a Gopher server, as the control 
  2697. files (Filter, audit files, etc.) will normally have a different extension 
  2698. (.80). 
  2699.  
  2700. Note that the filter must be in the working directory for GoServe, though you 
  2701. may change its name (an extension matching the port is recommended).  If you 
  2702. make changes to the default filter, it's a good idea to change its name, too, 
  2703. so if you install a new version of GoServe your filter will not be overwritten 
  2704. by the new default filter. 
  2705.  
  2706. The sample filter assumes that the data are held in a tree starting at the 
  2707. directory known by GoServe as the data directory (by default, GoServe assumes 
  2708. that is the directory '\gohttp' on the same drive as the working directory). 
  2709. You should normally change this, using GoServe, to point to a different 
  2710. subdirectory tree that holds your own data.  This tree can be on any drive and 
  2711. start at any depth (it may even start at the root directory of a disk). 
  2712.  
  2713. Note that the sample filter allows unrestricted access to all files in the 
  2714. subtree starting at your data directory. 
  2715.  
  2716. For more details, see GOSERVE.DOC. 
  2717.  
  2718.  
  2719. ΓòÉΓòÉΓòÉ 21. --- GoGopher.doc --- ΓòÉΓòÉΓòÉ
  2720.  
  2721.  
  2722. ΓòÉΓòÉΓòÉ 21.1. Credits ΓòÉΓòÉΓòÉ
  2723.  
  2724.                   How to start using GoServe as a Gopher server
  2725.                  """"""""""""""""""""""""""""""""""""""""""""""
  2726.                                       GoServe 2.52
  2727.  
  2728.         Copyright (c) IBM Corporation, 1994, 1995.  All rights reserved.
  2729.                        Mike Cowlishaw, IBM UK Laboratories
  2730.                                 mfc@vnet.ibm.com
  2731.                                     - - - - -
  2732.  
  2733. About 
  2734.  
  2735.  
  2736. ΓòÉΓòÉΓòÉ 21.2. Introduction ΓòÉΓòÉΓòÉ
  2737.  
  2738. 'GoServe' is a multi-purpose server for OS/2, which supports the 'Gopher' 
  2739. client-server protocol (as well as the World-Wide Web protocol).  The Gopher 
  2740. protocol is described in documents distributed by the University of Minnesota 
  2741. Microcomputer and Workstation Networks Center. 
  2742.  
  2743. Providing that you already have TCP/IP installed and started, GoServe can be 
  2744. running and serving files across a network in minutes. 
  2745.  
  2746. This document describes how to use GoServe as a Gopher server, and includes 
  2747. instructions on how to set up your own main menu.  GOGOPHER.ZIP includes a 
  2748. working sample main menu and customization filter, together with other sample 
  2749. data. 
  2750.  
  2751. Note:  It is assumed that you have some familiarity with Gopher, and have (and 
  2752. know how to use) a Gopher client. 
  2753.  
  2754.  
  2755. ΓòÉΓòÉΓòÉ 21.3. Quick start ΓòÉΓòÉΓòÉ
  2756.  
  2757. Assuming you have unzipped GOSERV.ZIP into the directory of your choice (for 
  2758. example, D:\GOSERVE), then: 
  2759.  
  2760.    1. Open an OS/2 window 
  2761.  
  2762.    2. Unzip the included file GOGOPHER.ZIP to a different directory.  To use 
  2763.       the default setup, put this 'data directory' on the same drive as the 
  2764.       first directory, and call it GOGOPHER (for example, D:\GOGOPHER). 
  2765.  
  2766.    3. The sample files include two menu templates; you must generate working 
  2767.       menu files from these which include your network address. To do this, run 
  2768.       the GOSMENU.CMD command against the two templates, using these two 
  2769.       commands: 
  2770.  
  2771.                     gosmenu mainmenu.men
  2772.                     gosmenu test.men
  2773.  
  2774.       Assuming no errors were reported there should now be two new files in the 
  2775.       directory (MAINMENU.70 and TEST.70). 
  2776.  
  2777.    4. Change your current directory back to the GoServe directory (for example, 
  2778.       D:\GOSERVE) 
  2779.  
  2780.    5. Start GoServe with the parameter "gopher", for example using: 
  2781.  
  2782.                    start goserve gopher
  2783.  
  2784.  You should then see a GoServe window (titled 'GoServe [Gopher]') appear. If 
  2785.  there are no error messages, the server is now active, and you should be able 
  2786.  to connect to the sample pages with any Gopher client.  For example, if the 
  2787.  name of your machine is "fred.hursley.ibm.com", specify this as the name for 
  2788.  Gopher to use.  The OS/2 Gopher client (available separately) may be started 
  2789.  with this name as a command line parameter, thus: 
  2790.  
  2791.     start gopher fred.hursley.ibm.com
  2792.  
  2793.  If GOPHER.EXE is neither in the current directory nor is in a directory on 
  2794.  your PATH, you will need to include its directory information in the command, 
  2795.  for example: 
  2796.  
  2797.     start e:\tools\gopher fred.hursley.ibm.com
  2798.  
  2799.  Alternatively, you should be able to use a World-Wide Web client by, for 
  2800.  example, specifying a URL of "gopher://fred.hursley.ibm.com/". 
  2801.  
  2802.  If you don't know the name of your machine, try the command "hostname" from an 
  2803.  OS/2 prompt. 
  2804.  
  2805.  
  2806. ΓòÉΓòÉΓòÉ 21.3.1. --- Setting up an icon for GoServe --- ΓòÉΓòÉΓòÉ
  2807.  
  2808. To set up an icon (program reference object) for a GoServe gopher server and 
  2809. (optionally) ensure that GoServe is started automatically when OS/2 is booted: 
  2810.  
  2811.    1. With your current directory being the GoServe directory (for example, 
  2812.       D:\GOSERVE), run the command: 
  2813.  
  2814.                    makeicon gopher
  2815.  
  2816.       This should make an icon called 'GoServe - Gopher' appear on the Desktop. 
  2817.       You can Move or drag it to another folder if you wish. The server can now 
  2818.       be started by clicking on the new icon (you may want to check that this 
  2819.       works). 
  2820.  
  2821.    2. Open the Startup folder (this may be on the Desktop or in the 'OS/2 
  2822.       System' folder). 
  2823.  
  2824.    3. Make a shadow of the GoServe icon in the Startup folder.  To do this, 
  2825.       hold down the Ctrl+Shift keys and then drag the icon to the Startup 
  2826.       folder, drop it, and release Ctrl+Shift.  (See the OS/2 documentation if 
  2827.       you need more details.) 
  2828.  
  2829.  With the shadow in the Startup folder, the server will be started 
  2830.  automatically whenever OS/2 is booted or rebooted. 
  2831.  
  2832.  
  2833. ΓòÉΓòÉΓòÉ 21.4. Your own main menu ΓòÉΓòÉΓòÉ
  2834.  
  2835. The sample filter can be used to serve different menus and files without any 
  2836. changes or programming.  All you need to do is change the data files. 
  2837.  
  2838. Here's what you need to do to set up your own 'main menu', given that the 
  2839. sample described above works: 
  2840.  
  2841.    1. Make a new directory for your own Gopher data (for example, called 
  2842.       D:\GODATA). 
  2843.  
  2844.    2. Copy the files from the sample directory to your new directory, using 
  2845.       (for example): 
  2846.  
  2847.                    copy d:\gogopher\*.* d:\godata
  2848.  
  2849.       This leaves the original files unchanged, as a backup. 
  2850.  
  2851.    3. Modify the file ABOUT.DOC in your new directory, to refer to your own 
  2852.       address and so on.  To start with, to see if it works, it's probably best 
  2853.       to change a few words only.  For example, change the line 
  2854.  
  2855.                    Administrator: Your Name Here
  2856.  
  2857.       to something more helpful. 
  2858.  
  2859.    4. If GoServe is not already running, start it as before (don't forget the 
  2860.       'GOPHER' parameter, if starting from a command prompt).  Choose 
  2861.       'Directory selection' from the 'Options' menu, and use the dialog there 
  2862.       to change the data directory to be your new directory (for example, to 
  2863.       D:\GODATA). 
  2864.  
  2865.    5. Try your favourite Gopher client, connecting to your machine as before, 
  2866.       and it should now display your main menu; selecting 'About this Gopher 
  2867.       server' should then display your new ABOUT.DOC. 
  2868.  
  2869.    6. All you have to do now is modify the data to your liking. To add 
  2870.       documents or menus to the main menu, you will need to edit the file 
  2871.       MAINMEN.MEN -- see below for details of the format. 
  2872.  
  2873.  All of the details above can be customized if you wish, but you will probably 
  2874.  need to learn more about GoServe and Rexx to change things effectively. 
  2875.  Please see GOSERVE.DOC for more information. 
  2876.  
  2877.  
  2878. ΓòÉΓòÉΓòÉ 21.5. An overview on how GoServe works ΓòÉΓòÉΓòÉ
  2879.  
  2880. (To make sense of this, you may need to read GOSERVE.DOC too.) 
  2881.  
  2882. Whenever a client connects to your machine, it sends a 'request string'. 
  2883. GoServe receives the string and passes it to a 'filter'.  This filter (a 
  2884. program, written in Rexx) checks that the request is valid, and normally 
  2885. responds with a file (such as an document or a menu file).  It is the filter's 
  2886. responsibility to choose or create the file, given the incoming request string. 
  2887.  
  2888. A sample filter (GoFilter.70) is provided--see commentary in that program for 
  2889. details.  In brief, it asks the server for the name of the data directory, 
  2890. checks for certain errors, and then processes the request according to the 
  2891. contents of the request string. 
  2892.  
  2893. Notes: 
  2894.  
  2895.    1. The sample filter gets the root, or home, directory for the data it is to 
  2896.       serve by calling the DATADIR() function.  The value this returns is set 
  2897.       by GoServe (which, in turn, is derived from the GoServe startup parameter 
  2898.       or the Directory Selection dialog). 
  2899.  
  2900.    2. A default menu is provided if none is specified.  Conventionally, this is 
  2901.       called 'mainmenu.70' (you can change this if you wish). A sample 
  2902.       'mainmenu.men', from which 'mainmenu.70' can be generated, is provided. 
  2903.  
  2904.    3. Certain special 'test and control' selectors are supported by the sample 
  2905.       filter (for example, return server statistics).  In the sample filter, 
  2906.       these are only allowed from a client with the same address as the server, 
  2907.       or those listed in the filter.  Other possibilities include not checking 
  2908.       the client's address [so anyone can use them], or, conversely, using a 
  2909.       privately-selected selector string for the controls--which would act as a 
  2910.       password.  See GOSERVE.DOC for more information on control options. 
  2911.  
  2912.    4. File names in selectors or the FILE command can be specified with either 
  2913.       forward slashes or backslashes as directory separators. Forward slashes 
  2914.       are recommended, as some Unix-based clients may not correctly handle 
  2915.       backslashes. 
  2916.  
  2917.  
  2918. ΓòÉΓòÉΓòÉ 21.6. Data organization and setup ΓòÉΓòÉΓòÉ
  2919.  
  2920. It is recommended that the control and execution files be placed in a directory 
  2921. separate from your data, perhaps called GOSERVE.  This may be the same 
  2922. directory as is already being used for running a Web server, as the control 
  2923. files (Filter, audit files, etc.) will have a different extension (.70). 
  2924.  
  2925. Note that the filter must be in the working directory for GoServe, though you 
  2926. may change its name (an extension matching the port is recommended).  If you 
  2927. make changes to the default filter, it's a good idea to change its name, too, 
  2928. so if you install a new version of GoServe your filter will not be overwritten 
  2929. by the new default filter. 
  2930.  
  2931. The sample filter assumes that the data are held in a tree starting at the 
  2932. directory known by GoServe as the data directory (by default, GoServe assumes 
  2933. that is the directory '\gogopher' on the same drive as the working directory). 
  2934. You should normally change this, using GoServe, to point to a different 
  2935. subdirectory tree that holds your own data. This tree can be on any drive and 
  2936. start at any depth (it may even start at the root directory of a disk). 
  2937.  
  2938. Note that the sample filter allows unrestricted access to all files in the 
  2939. subtree starting at your data directory. 
  2940.  
  2941. For more details, see GOSERVE.DOC. 
  2942.  
  2943.  
  2944. ΓòÉΓòÉΓòÉ 21.7. GOSMENU.CMD ΓòÉΓòÉΓòÉ
  2945.  
  2946. The GoServe package includes a simple utility in the GoGopher collection that 
  2947. makes it easier to create 'canonical' Gopher menu files.  See the start of 
  2948. GOSMENU.CMD for details.  A 'menu template' file, perhaps called MAINMENU.MEN, 
  2949. might look like this: 
  2950.  
  2951.   Sample main menu
  2952.   ; rexx.central.edu 70
  2953.   0 About this Gopher server; about.doc
  2954.   1 IBM Almaden Gopher server;; index.almaden.ibm.com
  2955.   1 Test and control menu; test.70
  2956.  
  2957. The first line is a description; the second gives the field separator character 
  2958. (which will become Tab in the generated menu), together with the default server 
  2959. address and port.  (If the last two are not specified, GOSMENU will try and 
  2960. determine the address from TCP/IP, and will assume the port is 70.) 
  2961.  
  2962. Subsequent lines are menu lines, as required by the Gopher protocol. Lines 
  2963. whose first character is a blank are ignored (that is, they are not included in 
  2964. the menu file).  If the first character is a 0, the menu line refers to a 
  2965. document; a 1 indicates a menu is expected; 9 indicates a binary file (such as 
  2966. a Zip file), and so on. 
  2967.  
  2968. Running GOSMENU against this file (with a different output filename) like this: 
  2969.  
  2970.   gosmenu mainmenu.men mainmenu.70
  2971.  
  2972. will create a 'canonical' menu file, with real tab characters instead of 
  2973. semicolons, address and port added where required, and extra blanks removed. 
  2974. The Gopher protocol suggests that the first (description) field be no more than 
  2975. 70 characters, and requires that the entire menu line (including address and 
  2976. port) fit within 255 characters. 
  2977.  
  2978. Notes: 
  2979.  
  2980.    1. The default output filename for GOSMENU.CMD is constructed by replacing 
  2981.       the extension of the input filename by '70', so the sample command could 
  2982.       have been simply: 
  2983.  
  2984.                    gosmenu mainmenu.men
  2985.  
  2986.       Or, of course, the file MAINMENU.MEN could simply have been dropped on a 
  2987.       Program Reference object that starts GOSMENU.CMD 
  2988.  
  2989.    2. It is recommended that 'active' menu files be identified by an extension 
  2990.       which is the Gopher port for which they are to be used. 
  2991.  
  2992.  
  2993. ΓòÉΓòÉΓòÉ 22. License ΓòÉΓòÉΓòÉ
  2994.  
  2995.   *********************************************************************
  2996.  
  2997.  
  2998.                   IBM License Agreement for OS/2 Tools
  2999.        -----------------------------------------------------------------
  3000.  
  3001.  
  3002.        IF YOU DOWNLOAD OR USE THIS PROGRAM YOU AGREE TO THESE TERMS.
  3003.  
  3004.        International Business Machines Corporation grants you a license
  3005.        to use the Program only in the country where you acquired it. The
  3006.        Program is copyrighted and licensed (not sold). We do not
  3007.        transfer title to the Program to you. You obtain no rights other
  3008.        than those granted you under this license.
  3009.  
  3010.        Under this license, you may:
  3011.  
  3012.        1. use the Program on one or more machines at a time;
  3013.        2. make copies of the Program for use or backup purposes within
  3014.           your Enterprise;
  3015.        3. modify the Program and merge it into another program; and
  3016.        4. make copies of the original file you downloaded and distribute
  3017.           it, provided that you transfer a copy of this license to the
  3018.           other party. The other party agrees to these terms by its
  3019.           first use of the Program.
  3020.  
  3021.        You must reproduce the copyright notice and any other legend of
  3022.        ownership on each copy or partial copy, of the Program.
  3023.  
  3024.        You may NOT:
  3025.  
  3026.        1. sublicense, rent, lease, or assign the Program; and
  3027.        2. reverse assemble, reverse compile, or otherwise translate the
  3028.           Program.
  3029.  
  3030.        We do not warrant that the Program is free from claims by a third
  3031.        party of copyright, patent, trademark, trade secret, or any other
  3032.        intellectual property infringement.
  3033.  
  3034.        Under no circumstances are we liable for any of the following:
  3035.  
  3036.        1. third-party claims against you for losses or damages;
  3037.        2. loss of, or damage to, your records or data; or
  3038.        3. economic consequential damages (including lost profits or
  3039.           savings) or incidental damages, even if we are informed of
  3040.           their possibility.
  3041.  
  3042.        Some jurisdictions do not allow these limitations or exclusions,
  3043.        so they may not apply to you.
  3044.  
  3045.        We do not warrant uninterrupted or error free operation of the
  3046.        Program. We have no obligation to provide service, defect
  3047.        correction, or any maintenance for the Program. We have no
  3048.        obligation to supply any Program updates or enhancements to you
  3049.        even if such are or later become available.
  3050.  
  3051.  
  3052.        IF YOU DOWNLOAD OR USE THIS PROGRAM YOU AGREE TO THESE TERMS.
  3053.  
  3054.        THERE ARE NO WARRANTIES, EXPRESS OR IMPLIED, INCLUDING THE
  3055.        IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
  3056.        PARTICULAR PURPOSE.
  3057.  
  3058.        Some jurisdictions do not allow the exclusion of implied
  3059.        warranties, so the above exclusion may not apply to you.
  3060.  
  3061.        You may terminate this license at any time. We may terminate this
  3062.        license if you fail to comply with any of its terms. In either
  3063.        event, you must destroy all your copies of the Program.
  3064.  
  3065.        You are responsible for the payment of any taxes resulting from
  3066.        this license.
  3067.  
  3068.        You may not sell, transfer, assign, or subcontract any of your
  3069.        rights or obligations under this license. Any attempt to do so is
  3070.        void.
  3071.  
  3072.        Neither of us may bring a legal action more than two years after
  3073.        the cause of action arose.
  3074.  
  3075.        If you acquired the Program in the United States, this license is
  3076.        governed by the laws of the State of New York. If you acquired
  3077.        the Program in Canada, this license is governed by the laws of
  3078.        the Province of Ontario. Otherwise, this license is governed by
  3079.        the laws of the country in which you acquired the Program.
  3080.  
  3081.        3/92
  3082.  
  3083. ---------------------------------------------------------------------------
  3084.  
  3085.  
  3086. ΓòÉΓòÉΓòÉ <hidden>  ΓòÉΓòÉΓòÉ
  3087.  
  3088.  
  3089. With the exception of very minor changes to the arrangement of whitespace and 
  3090. slight grammatical corrections (indicated by blue-on-red text), the source for 
  3091. this copy of the GoServe documentation is the exact text from the (.doc) 
  3092. documents supplied with the GoServe v2.52 distribution (see Credits section at 
  3093. start of the document).  I have simply compiled the text as a native OS/2 Book 
  3094. document (.inf file).  The source code has been provided to the credited author 
  3095. of GoServe.  I can be contacted via eMail to Bruce.Judd@ite-engineering.com. 
  3096. Please do so if you find any deviation from the original documention. 
  3097. Version history: 
  3098.  
  3099.      8-Mar-2001 . v 2001.01 : Initial compilation 
  3100.      24-Jul-2001 . v 2001.02 : Updated contact eMail address 
  3101.