In this distribution is a simple and relatively (ha!) readable Perl
script called gtowhois.  The script implements an internet Gopher to
WHOIS gateway.  Different whois servers are specified by links with
the Path set to "qwhois <hostname>"

The gopher client connects to the gtowhois server and sends a query to
it.  The server takes the query, sends it off to the whois server and
then parses the resulting output.  The script understands a few of the
more popular whois-gateways, including:

     X.500 whois gateway
     Ph whois gateway
     Weird Stanford Whois gateway
     nic.ddn.mil whois server.
     Horton (coming soon....)

One item is always returned, the raw search results.  If the script
can parse the output of the search individual user entries are
presented.

The script is designed to be run by inetd as a TCP daemon.
The easiest way to explain how to set it up and how it works
is to use an example.

Let us assume that we want to run a gopher to FTP gateway on
a machine called hell.micro.umn.edu. 

1.  You need to have Perl available on the machine.  If you don't you
can ftp the sources from a variety of anonymous ftp sites including

	uunet.uu.net
	jpl-devvax.jpl.nasa.gov
	tut.cis.ohio-state.edu

2.  Edit the first few, (marked) lines of the gtowhois file for your
local configuration; in this case change the marked lines as follows:

#
# Administrator parameters
#
$Gatehost 	= "mudhoney.micro.umn.edu";
$Port		= 4324;


3.  Become root and place the gtowhois file someplace nice (like
/usr/local/bin or /usr/etc or wherever you place stuff like this);
assume we put it in /usr/local/bin.  Make it owned by root and
executable:

    chown root gtowhois
    chmod 755 gtowhois

4.  Update /etc/services by adding the following line to the
/etc/services file (note it's tab between gtowhois and 4324):

    gtowhois	4324/tcp

Nothing sacred about 4324.  Run it at 6666 if you like...
For SUNs running yp, you'll also want to do a make services:
    cd /var/yp
    make services

5. Now update /etc/inetd.conf (for BSD-ish systems) or
/etc/servers (on Ultrix or A/UX or others) depending on what you
have.
For /etc/inetd.conf, add a line:

gtowhois	stream	tcp	nowait	root	/usr/local/bin/gtowhois	gtowhois

For /etc/servers, add a line:

gtowhois	tcp	/usr/local/bin/gtowhois

Note tabs between fields.

6.  Kill and restart the inetd daemon whatever the prescribed way
to do that on your machine.

7.  You can confirm that gtowhois is running now at port 4324 by
telneting to hell.micro.umn.edu at port 4324. Type a hostname at 
it (eg: boombox.micro.umn.edu), and it should respond by returning
the anonymous ftp directories available at boombox.micro.umn.edu.

8.  Now make some links from a regular gopher server to the gtowhois
service.  On a unix server, the links could look like this (on a 
Mac server, do the functional equivalent using Gopher's Helper):

 Name=Worcester Polytechnic Institute
 Type=7
 Port=4324
 Path=qwhois wpi.wpi.edu
 Host=mudhoney.micro.umn.edu


Credit for the original idea goes to schemers@leland.Stanford.EDU
(Roland Schemers).
