Skip site navigation (1)Skip section navigation (2)

FreeBSD Manual Pages

  
 
  

home | help
GN(8)			     System Manager's Manual			   GN(8)

NAME
     gn - A server for the internet gopher protocol and Hyper Text Transfer Pro-
     tocol

SYNOPSIS
     gn  [-a  |  -A]  [-L  logfile  |  -S]  [-k  uid#  | -K gid#] [-c cache] [-t
     http_root_title] [rootdir]

DESCRIPTION
     GN is a server for the internet gopher protocol and HTTP (gopher is a  reg-
     istered trademark of the University of Minnesota).

     GN Options

     The following optional arguments are accepted by gn:

     rootdir
	    The complete path name of the directory which is the root of the hi-
	    erarchy  of  data  files.  A default value is set in the source file
	    config.h.

     The following options are accepted by gn:

     -a     Limit access to the server to those clients with an IP address, sub-
	    net address, or host domain name listed in the file .access  in  the
	    root  data directory.  The format of the .access file is one address
	    per  line,	each   line   consisting   of	an   IP   address   like
	    129.111.222.123,  a  subnet address like 129.111.222 or 129.111 or a
	    domain name that can include wildcards like nwu.edu or *.cc.nwu.edu.
	    In case a subnet address is listed, any client with  an  IP  address
	    beginning  with  that  subnet  address will be allowed access.  If a
	    simple host name is used like math.nwu.edu	then  only  the  machine
	    math.nwu.edu   is	allowed   access.    If   a   wildcard	such  as
	    *.math.nwu.edu then only machines in the math.nwu.edu domain are al-
	    lowed access but not the cc.nwu.edu machine if one exists.	Hosts or
	    domains can be disallowed by prefixing their name with '!'.  Thus  a
	    line containing !*.nwu.edu would prevent access from any host in the
	    nwu.edu domain.

     -A     This  option is similar to the -a option except access is allowed on
	    a per directory basis.  Each client request is  processed  by  first
	    looking for a .access file in the directory containing the requested
	    item  and  comparing the IP address of the client with the addresses
	    in this file.  If no .access file exists in this directory,  one  is
	    sought  in	the parent directory and then if necessary the parent of
	    the parent, etc., up to the root data directory.  If no .access file
	    is found by this process access is allowed to all  clients	provided
	    the  item requested exists in a .cache file.  Menu items correspond-
	    ing to directories for which a host does not  have	access	are  not
	    shown to that host.

     -c cachefile
	    Use  cachefile,  instead  of the default, .cache, as the name of the
	    file in each directory of the data hierarchy containing  the  cached
	    list  of  menu items, their paths, hosts and ports.  No file is sent
	    by gn to a client unless it is listed in one of these cache files or
	    is itself one of these cache files. These files are produced by  the
	    companion program mkcache or .cache files produced by the University
	    of Minnesota gopherd server can be used.

     -k user_id | -K group_id
	    With  these  options the server will check the user or group id of a
	    cachefile and if it is not the same as that specified the  documents
	    listed  in	that  cachefile  will  not  be served.	See the Security
	    Guide.

     -L logfile | -S
	    If the -L option is used logging is turned on and the  file  logfile
	    is	used  as the file in which to record gn transactions.  If the -S
	    option is used then the UNIX system logging daemon, syslogd, will be
	    used.  You may need to edit your /etc/syslog.conf file for	this  to
	    work  (see your local manual).  The facility used is DAEMON, and the
	    level is INFO.  If neither of these options  are  used,  no  logging
	    will take place.

     -t http_root_title
	    Use  http_root_title  as the title and heading of the root menu when
	    doing an HTTP transaction instead of the value set in config.h via a
	    #define.  If the empty string "" is used as the value then no  title
	    or heading will be used and and these can be set in the menu file of
	    the  root  menu.  This option only affects HTTP transactions.  There
	    is no mechanism in the gopher protocol for sending a root  menu  ti-
	    tle.

     GN  only runs under inetd.  To run a stand alone server you use the program
     sgn which comes witht the GN package.  To use gn with inetd   you	need  to
     edit  two	files - /etc/services and /etc/inetd.conf.  The entries in these
     files look something like this:
	  gn  70/tcp
     for /etc/services and
	  gn  stream tcp nowait    nobody    /path/gn gn -L /path/gn.log
     for /etc/inetd.conf.  See the man page inetd.conf(5).

SETTING UP A ``SEARCH ALL MENUS'' ITEM
     A builtin feature of gn is the ability to have a menu item which  when  se-
     lected prompts the user for a search term and returns a ``virtual menu'' of
     all  menu items which contain that term.  In fact such an item can occur at
     any level and return either all matches from all menus on	that  server  or
     all matches at or below some chosen level.

     Here's  how to set it up.	Create an entry like this in the menu file where
     you want the search item to occur:
	  Name=Search all menus on this server
	  Type=7
	  Path=7c/.cache
	  Host=your.gn.host.edu
	  Port=70
     (If you want the search to cover only those items	in  directory  /foo/bar,
     then  the	path  line should be Path=7c/foo/bar/.cache) Then run mkcache to
     translate the new menu file to a .cache file and you are  done.   When  you
     change  any of the menus in your server and remake the .cache files gn will
     automatically reflect this in menu searches.   There  is  a  maximum  depth
     which  gn	will  search into the gn hierarchy.  Its value can be changed by
     editing the config.h file and re-compiling.

4th Berkeley Distribution	   1993 Sept 7				   GN(8)
--------------------------------------------------------------------------------
GN(8)			     System Manager's Manual			   GN(8)

FORMAT OF A CACHE FILE
     The security architecture of the gn server employs a cache file in each di-
     rectory to indicate which data files may served to clients.  The file  also
     contains  the  information  for generating replies to menu requests.  Typi-
     cally the cache file is named .cache and is created by the mkcache  program
     from the more readable menu file.

     The  structure  of  the current gn cache file is an evolution of the .cache
     file used by the University of Minnesota gopherd program.	The  cache  file
     contains of a sequence of menu entries consisting of a primary line with an
     optional  secondary  line.   A third type of line supports enhanced HTML in
     menus for HTTP clients.

   Primary line
     The primary line for each menu entry contains the five fields used  in  the
     Gopher  protocol  (RFC-1436).   The  first  field is a single character and
     abuts the second field; the remaining fields are separated  by  TAB  (0x09)
     characters:

	    X Menu title of item TAB selector TAB host TAB port

     X	    A  single  character Gopher type designator, e.g.  0 for text, 1 for
	    menus, 9 for binary, etc.  This field corresponds to the menu  Type=
	    directive.	Several of the unused Gopher type characters are used to
	    indicate the other line types:

	    TAB    indicates a secondary line.

	    h	   is likely an http: or hname: line

	    o	   is likely an owner: line.

     Menu title of item
	    This  is  the  title which will appear on the client menu and corre-
	    sponds to the Name= menu line.

     selector
	    The selector string used to reference this entry and corresponds  to
	    the menu Path= data.

     host   The fully qualified domain name of the host with the document.  This
	    corresponds to the Host= menu line.

     port   TCP  port  number  on  host  for  connecting to the document server.
	    >From the Port= menu line.

   Secondary line
     Following the primary line is an optional secondary line giving  additional
     information  about  the  menu entry.  Each secondary line begins with a TAB
     and contains four TAB separated fields:

	    TAB content_type TAB suffix TAB encoding TAB attribute

     content_type
	    For  a  local  document,  this  is	the  MIME  content  type,   e.g.
	    text/plain,  image/gif,  etc.  and is used in the HTTP Content_type:
	    header.  Links to remote documents use this field  to  indicate  the
	    type  of  server with the document: gn_link (another gn server), go-
	    pher_link (ordinary Gopher server), and url_link (HTTP server).

     suffix
	    A lower-case copy of the one to four character file name  extension.
	    The  value txt is used to indicate that a file with a html extension
	    is available for HTTP clients.

     encoding
	    empty or one of x-compress or x-gzip to indicate that  the	file  in
	    question  has been compressed with the UNIX compress utility or with
	    the GNU compression utility gzip.  This value is used  in  the  HTTP
	    Content-encoding: header.

     attribute
	    The gn server allows each entry to be tagged with one of the follow-
	    ing attributes.

	    gnlink
		   Denotes  that the remote document is on a gn server and capa-
		   ble of handling HTTP requests as  well  as  gopher  requests.
		   The reply to an HTTP client will contain an http: URL.

	    gopheronly
		   Show  this  link  to  gopher  clients  but  hide  it from WWW
		   clients.

	    httponly
		   Show this link to  HTTP  clients  and  hide	it  from  gopher
		   clients.

	    invisible
		   For items never to be displayed on a menu, but to be accessi-
		   ble to requests, for example an inline graphic.

	    nosearch
		   item  will be displayed for clients but its title will not be
		   used when searches of menu items are done.

	    urllink
		   entry is only for HTTP client, but the primary line	selector
		   field contains an entire URL.

   HTML support line
     To  provide additional HTML support to HTTP clients the cache file may con-
     tain lines starting one of these three colon terminated keywords:

     hname:
	    The remainder of the line is treated as a primary line where the se-
	    lector field contains HTML markup.

     http:  The rest of the line  is  HTML  to	be  returned  verbatim	to  HTTP
	    clients.  These line are not sent to Gopher clients.

     owner:
	    specifies  the  URL for the maintainer of the menu to be returned to
	    HTTP clients as HTML link tag.

UNRESTRICTIONS
     GN is free; anyone may redistribute copies to anyone under the terms stated
     in the Free Software Foundation's General Public License, a copy  of  which
     accompanies the gn software package.

     The author encourages you to improve and extend gn.

AUTHOR
     GN  was  written by John Franks, Dept. of Mathematics, Northwestern Univer-
     sity (john@math.nwu.edu).	Contributions have been made by a number of peo-
     ple.  They include Earle Ake, Jurgen Botz Henry Cejtin, Mike Crowley,  Paul
     DuBois, Stephen Hebditch, Albert Lunde, Jishnu Mukerji, Marko Nordberg, Jim
     Rees,  Craig  Milo Rogers, Chip Rosenthal, Stephen Trier, Ed Vielmetti, and
     Rico Tudor.

									   GN(8)

Want to link to this manual page? Use this URL:
<https://man.freebsd.org/cgi/man.cgi?query=gn&manpath=Red+Hat+4.2>

home | help