Cover V03, I02
Article
Figure 1
Figure 2
Figure 3
Figure 4
Figure 5

mar94.tar


Internet Online Services: gopher

Chris Bush

Introduction

In the last issue (Sys Admin, Jan/Feb 1994), I introduced you to archie, a simple yet powerful tool for retrieving information from the Internet. One of archie's shortcomings is its limited ability to perform topic-oriented searches. For the most part, when you look something up with archie, you are matching a search string against a file or directory name. When you are searching for a particular piece of software that is freely available, this doesn't usually present a problem. For instance, if I want to find the latest version of the perl programming language, I know that a reasonable thing to do with archie is use a search string of "perl." However, if I'm looking for a 1990 census report for Massena, New York, using archie only leads to a dead end. That doesn't mean I won't find that information somewhere on the Internet, nor does it necessarily mean that the information doesn't exist on an anonymous ftp site registered with the official archie servers. It only means that I will have difficulty locating the information using a keyword search like "massena." In fact, after several attempts, with several different search strings, I was unable to find what I was looking for with archie. So, how can I find this information on the Internet? I used gopher!

What Is gopher?

gopher is an Internet information search and retrieval system, developed by the Computer and Information Services department at the University of Minnesota. With gopher you can gain access to a wide variety of information both inside and outside your organization. gopher presents information to you in the form of menu screens. By selecting a menu item of interest, you may either be retrieving a text file, accessing another menu, or executing a telnet session to access a particular resource. The information that a particular menu choice leads you to may come from the local system or network, or it may be a link to another gopher server on a computer on the other side of the world.

Figure 1 shows the main menu of the gopher server running at the University of Minnesota. Using gopher is as simple as choosing the item from the current menu that seems to be most relevant, and continuing until you find what you want. If at any time you find you've strayed away from your intended goal, you can retreat to the previous menu.

Like archie, gopher consists of server software for providing the information, and client software for accessing the information. In this article, I discuss both sides of gopher. Two primary gopher clients are available from the University of Minnesota, one for ASCII terminal users and one for X Window capable systems. I will briefly cover the gopher server, and what types of information you can present with it.

I recommend that you begin by downloading the gopher software. The best place to go is right to the source, the University of Minnesota. Using anonymous ftp, connect to boombox.micro.umn.edu. Enter "anonymous" as a username, and your e-mail address as a password. Once you're in, change to directory /pub/gopher/UNIX. Here you will find a number of compressed tar files for the gopher software. You'll want to retrieve gopher2.010.tar.Z; if you have X Window capabilities on your network, get xgopher.1.3.2.tar.Z as well (in both cases the version number may be higher by the time you read this). The first file contains the software for both the gopher server, and the gopher client for ASCII terminals. The second file is the X Window System based client. You'll also want to retrieve the "Gopher Guide" from /pub/gopher/docs. This document is available either as a PostScript file or as straight text. Remember to put ftp into binary mode before transferring the files.

gopher Client Programs

The ASCII terminal client, gopher, is part of the gopher distribution file, gopher2.010.tar.Z, which also contains the gopher server software. The X Window-based client is in xgopher1.3.2.tar.Z.

When you extract the main gopher distribution, the directory that is created will contain a makefile at the top level that builds both the client and server software. Before you try building the software, read the file INSTALL, located in the doc subdirectory, for detailed information on getting started. You'll need to edit two files to get gopher compiled and installed properly, Makefile.config and conf.h. Both are located at the top level of the gopher directory, and both contain explicit instructions for changing the values of various variables so as to customize gopher for your environment.

Perhaps the most important settings are in conf.h. These are CLIENT1_HOST, CLIENT2_HOST, CLIENT1_PORT, and CLIENT2_PORT. The first two relate to the default hosts that the gopher client will attempt to connect to. If you intend to run your own gopher server or servers, set these to the host names of the primary and secondary gopher servers you want for defaults. The latter two variables tell the gopher client which TCP port number to use when attempting to connect to the gopher server. The default of 70 is appropriate unless that port is already in use on the computer where your gopher server will be running. If that is the case you'll need to change the default to the number of an unused port.

Makefile.config contains variables related to what compiler you will use on your system, and the names of the directories where you would like the various pieces of the gopher software to be installed. Once you have made all the necessary changes, you can build the software by executing make. If you only want to build the client software, use

% make client

Once you've successfully built the client software, you can run it. If you didn't change the default host, gopher will connect to the predefined default, which is the gopher server at the University of Minnesota. This will display the menu shown in Figure 1.

Once you are confident that your gopher client is built properly, you can install it, providing you made the appropriate changes to Makefile.config, by typing

% (cd gopher; make install)

The other important piece of client software is xgopher. This program provides a simple graphical user interface, where menu items can be selected via mouse, and files are displayed in a separate window. If a gopher server is making graphics image files available, selecting them causes gopher to bring them up using the viewer you have specified in the configuration file. This functionality requires a program like xv or xloadimage, both readily available from numerous anonymous ftp sites (archie, described in the previous issue, would be a good way to find these). The xgopher client, like the xarchie client, uses an imakefile, and is simple to build (read the README file before you begin). There is also a conf.h file to be modified, as in the ASCII client. Again, an important element in this file is the name of the default gopher server to which xgopher will connect.

The gopher Server

If, after some experience with gopher or xgopher, you decide that the users on your network could benefit from a local gopher server, you'll need to compile the gopher server software. After modifying Makefile.config and conf.h, as discussed above, you can build the server software by typing

% make server

To install the gopher server, execute

% (cd gopherd; make install)

This will install the gopher server, gopherd, and its supporting files in the locations you named during configuration. You'll then need to set up the host on which gopherd will run, to ensure that the gopher server will be run whenever the computer is rebooted. You can do this using start-up scripts like /etc/rc.local, or you can add an entry to the inetd.conf file, if your system uses inetd. You'll want to read Chapter 7 of the Gopher Guide, "Configuring the UNIX Server," which has detailed information on this setup.

There's more to be done than just getting the gopher server running on your network. You must also decide what kinds of information you will make available. Figure 2 lists the types of information that gopher can present to your users. One of the options you set in Makefile.config is the location of your gopher data. This location will initially be a directory which you create. The contents of this directory determine how your information will be presented to gopher clients connecting to your server. The contents of the top-level gopher directory represent the first menu that a gopher client user will see. If there are subdirectories, choosing those brings you to another menu, whose entries will be the contents of that subdirectory. Ordinary text files will be displayed to the user upon selection. Files whose names begin with a period are special files, called links, which I'll discuss in detail later. Other defaults for files within your gopher data directory relate to sound files, graphics images (GIF), and other types. The "Gopher Guide" details all of these.

Where gopher gets interesting is with the links, or "dot files." These files, which will not show up directly on the gopher menu, can be used to refer to gopher data on your own system, or from other gopher servers on the Internet. Figure 3 shows an example of one of these links. The Numb field is used to place a menu item at a specific position in the gopher menu. The Name field is used to specify the text that will appear in the gopher menu for that item. The Type field corresponds to the type of the gopher data, as presented in Figure 2. Port represents the TCP port number of the gopher server being linked to. Path specifies the path within the gopher data directory of the server where the information is located. Host is the fully qualified domain name of the host where the gopher server is running. The example in Figure 3 is a link to a gopher directory at gopher.internet.com. The title of the entry, as it would appear on your gopher client session is "Internet World Magazine." One important point to note here is that the gopher server in this case is being run on TCP port 2100, rather than the default port 70.

As you explore the Internet using gopher, you will come across information of interest to your users. Rather than rely on their finding such things themselves, you may choose to create links to them somewhere within your own gopher data directory. Both gopher clients mentioned in this article can tell you how to create your own link. From the gopher ASCII client, position the menu pointer on an item of interest and press the = key. This will present you with a screen containing the values of the various fields used in a link. From xgopher, clicking the mouse on the "Info about selection" button accomplishes the same thing. Once you have this information, you are ready to create your own link. Create a file with a name beginning with a period in your gopher data directory. Enter the appropriate information for each field described in the preceding paragraph. You need not restart the gopherd process to "see" the new data. The next time a gopher client connects, the new information will be available. You may also want to create the link shown in Figure 4. This will take you to a menu listing all of the "known" gopher servers in the world (that is, all those who have registered with the maintainers of this information at the University of Minnesota). This link provides a useful starting point for exploring gopherspace.

veronica

veronica (Very Easy Rodent-Oriented Net-wide Index to Computerized Archives) is a service by which you can perform keyword searches on the titles available in gopherspace. veronica searches are launched from your gopher client, and the results are presented to you as another gopher menu, from which you can select any of the items returned as a result of the search. Figure 5 gives the link information you can use in your gopher server to enable your users to make veronica searches.

Conclusion

I have only scratched the surface of the features and functionality of gopher. For complete and definitive information, check out the "Gopher Guide."

gopher provides tremendous potential as an information system in a networked environment. You can use it either as a "bulletin board" on your own local network or as a means of providing information to the Internet at large. Give gopher a try. Use it to explore the Internet for a while. You'll be amazed at what you can find in gopherspace.

Recommended Reading

Krol, Ed. The Whole INTERNET User's Guide & Catalog. Sebastopol, CA: O'Reilly & Associates, 1992. ISBN 1-56592-025-2.

About the Author

Chris Bush began his UNIX life in 1984 as a college work-study student, typing in troff commands for research documentation. Chris has a B.S. in Computer Science from the University of Buffalo, and is currently working on his Masters. He can be reached electronically at cbush@lerc.nasa.gov.