home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 35 Internet / 35-Internet.zip / gosrv250.zip / gogopher.doc < prev    next >
Text File  |  1997-02-07  |  12KB  |  281 lines

  1.                                                                GoServe 2.50
  2. How to start using GoServe as a Gopher server
  3. """""""""""""""""""""""""""""""""""""""""""""
  4.  
  5. Copyright (c) IBM Corporation, 1994, 1995.  All rights reserved.
  6.  
  7.  
  8. Introduction
  9. """"""""""""
  10. 'GoServe' is a multi-purpose server for OS/2, which supports the
  11. 'Gopher' client-server protocol (as well as the World-Wide Web
  12. protocol).  The Gopher protocol is described in documents distributed by
  13. the University of Minnesota Microcomputer and Workstation Networks
  14. Center.
  15.  
  16. Providing that you already have TCP/IP installed and started, GoServe
  17. can be running and serving files across a network in minutes.
  18.  
  19. This document describes how to use GoServe as a Gopher server, and
  20. includes instructions on how to set up your own main menu.  GOGOPHER.ZIP
  21. includes a working sample main menu and customization filter, together
  22. with other sample data.
  23.  
  24. Note: It is assumed that you have some familiarity with Gopher, and have
  25. (and know how to use) a Gopher client.
  26.  
  27.  
  28. Quick start
  29. """""""""""
  30. Assuming you have unzipped GOSERV.ZIP into the directory of your choice
  31. (for example, D:\GOSERVE), then:
  32.  
  33.   1. Open an OS/2 window
  34.  
  35.   2. Unzip the included file GOGOPHER.ZIP to a different directory.  To
  36.      use the default setup, put this 'data directory' on the same drive
  37.      as the first directory, and call it GOGOPHER (for example,
  38.      D:\GOGOPHER).
  39.  
  40.   3. The sample files include two menu templates; you must generate
  41.      working menu files from these which include your network address.
  42.      To do this, run the GOSMENU.CMD command against the two templates,
  43.      using these two commands:
  44.  
  45.         gosmenu mainmenu.men
  46.         gosmenu test.men
  47.  
  48.      Assuming no errors were reported there should now be two new files
  49.      in the directory (MAINMENU.70 and TEST.70).
  50.  
  51.   4. Change your current directory back to the GoServe directory (for
  52.      example, D:\GOSERVE)
  53.  
  54.   5. Start GoServe with the parameter "gopher", for example using:
  55.  
  56.        start goserve gopher
  57.  
  58. You should then see a GoServe window (titled 'GoServe [Gopher]') appear.
  59. If there are no error messages, the server is now active, and you should
  60. be able to connect to the sample pages with any Gopher client.  For
  61. example, if the name of your machine is "fred.hursley.ibm.com", specify
  62. this as the name for Gopher to use.  The OS/2 Gopher client (available
  63. separately) may be started with this name as a command line parameter,
  64. thus:
  65.  
  66.   start gopher fred.hursley.ibm.com
  67.  
  68. If GOPHER.EXE is neither in the current directory nor is in a directory
  69. on your PATH, you will need to include its directory information in the
  70. command, for example:
  71.  
  72.   start e:\tools\gopher fred.hursley.ibm.com
  73.  
  74. Alternatively, you should be able to use a World-Wide Web client by, for
  75. example, specifying a URL of "gopher://fred.hursley.ibm.com/".
  76.  
  77. If you don't know the name of your machine, try the command "hostname"
  78. from an OS/2 prompt.
  79.  
  80. --- Setting up an icon for GoServe ---
  81.  
  82. To set up an icon (program reference object) for a GoServe gopher
  83. server and (optionally) ensure that GoServe is started automatically
  84. when OS/2 is booted:
  85.  
  86.   1. With your current directory being the GoServe directory (for
  87.      example, D:\GOSERVE), run the command:
  88.  
  89.        makeicon gopher
  90.  
  91.      This should make an icon called 'GoServe - Gopher' appear on the
  92.      Desktop.  You can Move or drag it to another folder if you wish.
  93.      The server can now be started by clicking on the new icon (you may
  94.      want to check that this works).
  95.  
  96.   2. Open the Startup folder (this may be on the Desktop or in the 'OS/2
  97.      System' folder).
  98.  
  99.   3. Make a shadow of the GoServe icon in the Startup folder.  To do
  100.      this, hold down the Ctrl+Shift keys and then drag the icon to the
  101.      Startup folder, drop it, and release Ctrl+Shift.  (See the OS/2
  102.      documentation if you need more details.)
  103.  
  104. With the shadow in the Startup folder, the server will be started
  105. automatically whenever OS/2 is booted or rebooted.
  106.  
  107.  
  108. Your own main menu
  109. """"""""""""""""""
  110. The sample filter can be used to serve different menus and files without
  111. any changes or programming.  All you need to do is change the data
  112. files.
  113.  
  114. Here's what you need to do to set up your own 'main menu', given that
  115. the sample described above works:
  116.  
  117.   1. Make a new directory for your own Gopher data (for example,
  118.      called D:\GODATA).
  119.  
  120.   2. Copy the files from the sample directory to your new directory,
  121.      using (for example):
  122.  
  123.        copy d:\gogopher\*.* d:\godata
  124.  
  125.      This leaves the original files unchanged, as a backup.
  126.  
  127.   3. Modify the file ABOUT.DOC in your new directory, to refer to your
  128.      own address and so on.  To start with, to see if it works, it's
  129.      probably best to change a few words only.  For example, change the
  130.      line
  131.  
  132.        Administrator: Your Name Here
  133.  
  134.      to something more helpful.
  135.  
  136.   4. If GoServe is not already running, start it as before (don't forget
  137.      the 'GOPHER' parameter, if starting from a command prompt).
  138.  
  139.      Choose 'Directory selection' from the 'Options' menu, and use the
  140.      dialog there to change the data directory to be your new directory
  141.      (for example, to D:\GODATA).
  142.  
  143.   5. Try your favourite Gopher client, connecting to your machine as
  144.      before, and it should now display your main menu; selecting 'About
  145.      this Gopher server' should then display your new ABOUT.DOC.
  146.  
  147.   6. All you have to do now is modify the data to your liking.
  148.      To add documents or menus to the main menu, you will need to edit
  149.      the file MAINMEN.MEN -- see below for details of the format.
  150.  
  151. All of the details above can be customized if you wish, but you will
  152. probably need to learn more about GoServe and Rexx to change things
  153. effectively.  Please see GOSERVE.DOC for more information.
  154.  
  155.  
  156. An overview on how GoServe works
  157. """"""""""""""""""""""""""""""""
  158. (To make sense of this, you may need to read GOSERVE.DOC too.)
  159.  
  160. Whenever a client connects to your machine, it sends a 'request string'.
  161. GoServe receives the string and passes it to a 'filter'.  This filter (a
  162. program, written in Rexx) checks that the request is valid, and normally
  163. responds with a file (such as an document or a menu file).  It is the
  164. filter's responsibility to choose or create the file, given the incoming
  165. request string.
  166.  
  167. A sample filter (GoFilter.70) is provided--see commentary in that
  168. program for details.  In brief, it asks the server for the name of the
  169. data directory, checks for certain errors, and then processes the
  170. request according to the contents of the request string.
  171.  
  172. Notes:
  173.  
  174.   1. The sample filter gets the root, or home, directory for the data it
  175.      is to serve by calling the DATADIR() function.  The value this
  176.      returns is set by GoServe (which, in turn, is derived from the
  177.      GoServe startup parameter or the Directory Selection dialog).
  178.  
  179.   2. A default menu is provided if none is specified.  Conventionally,
  180.      this is called 'mainmenu.70' (you can change this if you wish).
  181.      A sample 'mainmenu.men', from which 'mainmenu.70' can be generated,
  182.      is provided.
  183.  
  184.   3. Certain special 'test and control' selectors are supported by the
  185.      sample filter (for example, return server statistics).  In the
  186.      sample filter, these are only allowed from a client with the same
  187.      address as the server, or those listed in the filter.  Other
  188.      possibilities include not checking the client's address [so anyone
  189.      can use them], or, conversely, using a privately-selected selector
  190.      string for the controls--which would act as a password.  See
  191.      GOSERVE.DOC for more information on control options.
  192.  
  193.   4. File names in selectors or the FILE command can be specified with
  194.      either forward slashes or backslashes as directory separators.
  195.      Forward slashes are recommended, as some Unix-based clients may not
  196.      correctly handle backslashes.
  197.  
  198.  
  199. Data organization and setup
  200. """""""""""""""""""""""""""
  201. It is recommended that the control and execution files be placed in a
  202. directory separate from your data, perhaps called GOSERVE.  This may be
  203. the same directory as is already being used for running a Web server,
  204. as the control files (Filter, audit files, etc.) will have a different
  205. extension (.70).
  206.  
  207. Note that the filter must be in the working directory for GoServe,
  208. though you may change its name (an extension matching the port is
  209. recommended).  If you make changes to the default filter, it's a good
  210. idea to change its name, too, so if you install a new version of GoServe
  211. your filter will not be overwritten by the new default filter.
  212.  
  213. The sample filter assumes that the data are held in a tree starting at
  214. the directory known by GoServe as the data directory (by default,
  215. GoServe assumes that is the directory '\gogopher' on the same drive as
  216. the working directory).  You should normally change this, using GoServe,
  217. to point to a different subdirectory tree that holds your own data.
  218. This tree can be on any drive and start at any depth (it may even start
  219. at the root directory of a disk).
  220.  
  221. Note that the sample filter allows unrestricted access to all files in
  222. the subtree starting at your data directory.
  223.  
  224. For more details, see GOSERVE.DOC.
  225.  
  226.  
  227. GOSMENU.CMD
  228. """""""""""
  229. The GoServe package includes a simple utility in the GoGopher collection
  230. that makes it easier to create 'canonical' Gopher menu files.  See the
  231. start of GOSMENU.CMD for details.  A 'menu template' file, perhaps
  232. called MAINMENU.MEN, might look like this:
  233.  
  234.   Sample main menu
  235.   ; rexx.central.edu 70
  236.   0 About this Gopher server; about.doc
  237.   1 IBM Almaden Gopher server;; index.almaden.ibm.com
  238.   1 Test and control menu; test.70
  239.  
  240. The first line is a description; the second gives the field separator
  241. character (which will become Tab in the generated menu), together with
  242. the default server address and port.  (If the last two are not
  243. specified, GOSMENU will try and determine the address from TCP/IP, and
  244. will assume the port is 70.)
  245.  
  246. Subsequent lines are menu lines, as required by the Gopher protocol.
  247. Lines whose first character is a blank are ignored (that is, they are
  248. not included in the menu file).  If the first character is a 0, the menu
  249. line refers to a document; a 1 indicates a menu is expected; 9 indicates
  250. a binary file (such as a Zip file), and so on.
  251.  
  252. Running GOSMENU against this file (with a different output filename)
  253. like this:
  254.  
  255.   gosmenu mainmenu.men mainmenu.70
  256.  
  257. will create a 'canonical' menu file, with real tab characters instead of
  258. semicolons, address and port added where required, and extra blanks
  259. removed.  The Gopher protocol suggests that the first (description)
  260. field be no more than 70 characters, and requires that the entire menu
  261. line (including address and port) fit within 255 characters.
  262.  
  263. Notes:
  264.  
  265.   1. The default output filename for GOSMENU.CMD is constructed by
  266.      replacing the extension of the input filename by '70', so the
  267.      sample command could have been simply:
  268.  
  269.        gosmenu mainmenu.men
  270.  
  271.      Or, of course, the file MAINMENU.MEN could simply have been dropped
  272.      on a Program Reference object that starts GOSMENU.CMD
  273.  
  274.   2. It is recommended that 'active' menu files be identified by an
  275.      extension which is the Gopher port for which they are to be used.
  276.  
  277. - - - - -
  278.  
  279. Mike Cowlishaw, IBM UK Laboratories
  280. mfc@vnet.ibm.com
  281.