-->
Previous Table of Contents Next


The MAXLOAD variable is used if the -DLOADRESTRICT keyword was used in the SERVEROPTS variable of Makefile.config. The MAXLOAD defines the maximum load average the Gopher service will respond to requests under (this value can be overridden on the command line). The usual definition is like this:


#define MAXLOAD 10.0

The READTIMEOUT and WRITETIMEOUT variables set the amount of time a service waits for a network read or write operation before timing out. The default settings are usually adequate. These lines look like the following:


#define READTIMEOUT (1*60)

#define WRITETIMEOUT (3*60)

The Gopher client’s configuration is straightforward. Begin by defining the Gopher servers the local machine connects to with the CLIENT1_HOST and CLIENT2_HOST entries. The Gopher client chooses one of the two (if both are defined) when it is started. The entries look like this:


#define CLIENT1_HOST “gopher_serv.tpci.com”

#define CLIENT2_HOST “other_gopher_serv.tpci.com”

The ports to be used to connect to the hosts are defined with these options:


#define CLIENT1_PORT 70

#define CLIENT2_PORT 70

If you have a local service and don’t want to use port 70 (to prevent access from the Internet, for example), set the proper port values. If only one Gopher server is used, set the second value to 0.

Define the language the Gopher client will use by choosing one value out of a number of options. The default is American English, set by this command:


#define DEFAULT_LANG “En_US”

Other language defines are commented out below this one. If you want to change the default language, comment the American English setting and uncomment the one you want.

When all the configuration changes are made, you can invoke the compilation process for the client and server with these commands:


make client

make server

Or you can do both client and server systems at once by using the make command with no argument. The programs and data files must be installed, too, using the command:


make install

WAIS and Gopher

Gopher clients have the ability to use WAIS indexes to search for documents, but the system must be configured to allow this. We looked at WAIS in Chapter 49, “Configuring a WAIS Site,” so for the sake of providing WAIS index access to Gopher, we’ll assume you have installed WAIS properly and have WAIS indexes ready for Gopher.

To provide WAIS services through Gopher, you may have to make a change in the WAIS source code. Examine the WAIS source code for a line that looks like this:


if (gLastAnd) printf(“search_word: boolean ’and’ scored/n:);

This line should be commented out to provide Gopher services, so if it is not, add C comment symbols before and after the line, like this:


/* if (gLastAnd) printf(“search_word: boolean ’and’ scored/n:); */

If the line is already commented out (or didn’t exist), then you don’t need to make any changes. If you change the line, though, you have to recompile WAIS by changing into the WAIS top directory and running the makefile (enter the command make).

Next, examine the Gopher Makefile.config file and look for the WAISTYPE variable. It should be defined on a line like this:


WAISTYPE = #-DFREEWAIS_0_4

Then, you have to link the Gopher and WAIS services. Suppose your Gopher source directory is /usr/gopher/source and the WAIS source directory is /usr/wais/source. You can link these services by entering the following commands:


cd /usr/gopher/source

ln -s /usr/wais/source/include ./ir

ln -s /usr/wais/source/client/ui .

ln -s /usr/wais/source/bin .

When Gopher is recompiled, it connects the links between Gopher and freeWAIS and allows the two services to interwork.


Previous Table of Contents Next