home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Internet Tools 1993 July / Internet Tools.iso / RockRidge / info-service / gopher / Unix / gopher+1.2b4 / doc / server.doc < prev    next >
Encoding:
Text File  |  1993-02-11  |  7.5 KB  |  209 lines

  1. ------------ 
  2. Note, this document is getting out of date.  The most
  3. current information is in the gopherd man page
  4. ------------
  5.  
  6.  
  7.  
  8.          Internet Gopher Server Documentation
  9.                University of Minnesota
  10.  
  11.  
  12. I. Overview of the Internet Gopher Server.
  13.  
  14. The Internet Gopher is a distributed document delivery service.  It
  15. allows a neophyte user to access various types of data residing on
  16. multiple hosts in a seamless fashion.  This is accomplished by
  17. presenting the user a hierarchical arrangement of documents and by
  18. using a client-server communications model.  The Internet Gopher
  19. Server accepts simple queries, and responds by sending the client a
  20. document. 
  21.  
  22. The document types that are currently supported are:
  23.  
  24.     1. Generic Text Files.
  25.     2. Directories/Links.
  26.     3. CSO Phone Book Services.
  27.     4. Full Text Indexes.
  28.  
  29. The document types that are experimental and subject to change.
  30.  
  31.     1. Digitized sounds.
  32.  
  33. Currently the Internet Gopher Server software supports Text Files,
  34. Directories and Sounds.  Full text indices generated using NeXT
  35. Digital Librarian and WAIS are supported.  A CSO implementation is
  36. available from the University of Illinois on uxc.cso.uiuc.edu as
  37. /pub/qi.tar.Z.
  38.  
  39.  
  40. III. Setting Up Your Server.
  41. ----------------------------
  42.  
  43. Setting up a gopher server is similar to setting up an anonymous ftp
  44. site.  The first step is to compile the server.  When that's done make
  45. a directory to hold the data.  If you want, you can even use your
  46. present anonymous ftp directory.  (The server masks out the usr/,
  47. bin/, dev/, /tmp, and etc/ directories.  It also doesn't show core
  48. files either :-O).  Once your data directory is set up you can start
  49. the gopher server.
  50.  
  51. Normally you would do this as root, since gopherd does a chroot to the
  52. gopher directory by default (like anonymous ftp).  Thus the only
  53. information that is transmitted to the outside world is what's in the
  54. gopher-data directory.  You can use the -c option to start the daemon.
  55. In this case, gopher will not do a chroot.  Instead it uses secure
  56. versions of file opening system calls.  This works quite well and
  57. allows you to place sybolic links in your gopher data directory
  58.  
  59. So, say that your gopher data resides in a directory called
  60. /home/gopher-data.  To start the gopher daemon you would type in the
  61. following:
  62.  
  63.    mkdir /home/gopher-data
  64.    /usr/local/etc/gopherd /home/gopher-data 70
  65.  
  66. To start it up without a chroot() you could do the following:
  67.  
  68.    mkdir /home/gopher-data
  69.    /usr/local/etc/gopherd -c -u lindner /home/gopher-data  70
  70.  
  71. The gopher daemon forks off and will then start accepting connections.
  72. You can easily test the server by using telnet to connect to the port
  73. specified on the command line.  Once connected, type return.  A list
  74. of things in the gopher-data directory should be returned.  For
  75. instance let's say that the server was started on the machine
  76. "gopher".  To test it you'd do the following: 
  77.  
  78. mudhoney[6:18pm]-=> telnet gopher 70
  79. Trying 128.101.95.29 ...
  80. Connected to gopher.micro.umn.edu.
  81. Escape character is '^]'.
  82.  
  83.     0About Gopher   /.about gopher.micro.umn.edu    150
  84.     7Search Micro Consultant        asd     joeboy.micro.umn.edu    156
  85.     7Search everywhere      kdkdkd  ashpool.micro.umn.edu   158
  86.     1Search parts of the gopher world       /Search parts of the gopher world      gopher.micro.umn.edu     150
  87.     1Other information      /Other information      gopher.micro.umn.edu    150
  88.     1UPI newswire   /UPI newswire   gopher.micro.umn.edu    150
  89.     1Computer information   /Computer information   gopher.micro.umn.edu    150
  90.     1Minnesota Daily newswire       /Minnesota Daily newswire       gopher.micro.umn.edu    150
  91.     .
  92.     Connection closed by foreign host.
  93.     mudhoney[6:21pm]-=> 
  94.  
  95.  
  96. Unless you want greasy grimy gopher guts on your computer you'll also
  97. put something similar to the following in you rc.local or equivilant: 
  98.  
  99. if [ -f /usr/local/etc/gopherd ]; then
  100.     /usr/local/etc/gopherd /home/mudhoney/gopher-data 70
  101. fi
  102.  
  103.  
  104. IV. Usage
  105. ---------
  106.  
  107. [Please refer to the new gopherd man page for usage information....]
  108.  
  109.  
  110. V. Adding Data to the Gopher Server.
  111. -------------------------------------
  112.  
  113. To make a gopher directory, just use "mkdir" to create a directory in
  114. the gopher data directory.  For instance, say you had a bunch of Heavy
  115. Metal Lyrics you wanted to put online, you would do the following: 
  116.  
  117. cd /home/mudhoney/gopher-data
  118. mkdir "Heavy Metal Lyrics"
  119. cd "Heavy Metal Lyrics"
  120. mkdir Metallica
  121.  
  122. Okay, now you want to add some text files to your gopher database.  To
  123. do this just create and/or copy your textfiles into the directories in
  124. the gopher Server data directory.  Here's a quick example:
  125.  
  126. cd "/home/mudhoney/gopher-data/Heavy Metal Lyrics/Metallica"
  127. cp ~/mop.txt "Master of Puppets"
  128.  
  129. You'll want to create your text files and directories with descriptive
  130. names.  Poor folks with 14 character System V filesytems, or people
  131. with ftp directories should look into the .cap functionality described
  132. later.
  133.  
  134. Now here comes the tricky part, Links.  The ability to make links to
  135. other hosts is how gopher distributes itself among multiple hosts.
  136. There are two different ways to make a link.  The first and simplest
  137. is to create a link file that contains the data needed by the server.
  138. By default all files in the gopher data directory starting with a
  139. period are taken to be link files.  A link file can contain multiple
  140. links.  A define a link you need to put five lines in a link file that
  141. define the needed characteristics for the document.  Here is an
  142. example of a link.
  143.  
  144. Name=Cheese Ball Recipes
  145. Type=1
  146. Port=150
  147. Path=1/Moo/Cheesy
  148. Host=zippy.micro.umn.edu
  149.  
  150. The Name= line is what the user will see when cruising through the
  151. database.  In this case the name is "Cheese Ball Recipes".  The
  152. "Type=" defines what kind of document this object is.  The following
  153. is a list of all the defined types:
  154.  
  155. 0  -- Text File
  156. 1  -- Directory
  157. 2  -- CSO name server.
  158. 7  -- Full Text Index
  159. 8  -- Telnet Session
  160. s  -- Sound
  161.  
  162. The "Path=" line contains the selector string that the client will use
  163. to retrieve the actual document.  The port and host lines should
  164. speak for themselves.
  165.  
  166. An easy way to retrieve this information is to use the UNIX gopher
  167. client.  Find the thing you're interested in and type the '=' key.  A
  168. properly formatted link file will then be displayed.
  169.  
  170. Another way to retrieve this information is to use telnet to get the
  171. information.  For instance let's say you want to link the University
  172. of Minnesota's Gopher Server to your gopher server.  Just telnet to
  173. the port (like in the example above) and retrieve the information.
  174. The server returns a list in the following format:
  175.  
  176. <character Object Type><TAB><Name><TAB><Path><TAB><Host><TAB><Port>
  177.  
  178. You need to keep the Object Type, Path, Host, and Port the same in the
  179. link.  You can change the name of the document if you want.
  180.  
  181.  
  182. The second method of creating a link is a bit harder, however it's
  183. ideal for such things as sounds where the only change needed is the
  184. object type.
  185.  
  186. Here's how you'd change the file /home/mudhoney/sounds/Moo into a
  187. sound, and also change it's name: 
  188.  
  189.   cd /home/mudhoney/gopher-data/sounds/
  190.   mkdir .cap
  191.   cd .cap
  192.   cat >Moo
  193.   Type=s
  194.   Name=Cow Sound
  195.   ^D
  196.  
  197. The idea is that you create a directory called .cap in the same
  198. directory as the document.  Then you create a file with the same name
  199. in the hidden .cap directory with the lines that you want changed.
  200. You only need to put in what needs to be changed.  The server will
  201. supply defaults if it doesn't find out what it needs.  In the above
  202. example for instance, the host would supply the Host, Port and Path
  203. for the object.  The only thing that changed was the type and the
  204. name.
  205.  
  206.  
  207.  
  208.  
  209.