821 824




Linux Unleashed, Third Edition:Setting up a Gopher Service





-->















Previous
Table of Contents
Next




Setting Up the Makefile
Two files need modification for the compilation process to proceed properly. These two files are Makefile.config and conf.h. With many versions of Gopher available on Linux systems, the configuration parameters that these files need have already been set, but you should check the values carefully to prevent problems.
The Makefile.config file (used by Makefile to build the executables) is a lengthy file, so you should be careful while moving through it to avoid accidental changes. The important areas to examine are the directory definitions and server and client settings. These are dealt with individually in the following sections.
One setting you may wish to alter is the debugging utility, which is enabled by default in most systems. This can help you get the system running properly, but when the operation is correct, you should recompile the source with the debugging features removed to make the process faster and smaller, as well as to reduce debug information overhead. To remove debugging features, comment out the DEBUGGING line so it looks like this:


#DEBUGGING = -DDEBUGGING


By default this line is probably not commented out.

The directory definitions are usually in a block with five to seven entries, depending on the number of entries for the man pages. A typical directory definition block looks like this:


PREFIX = /usr/local
CLIENTDIR = $(PREFIX)/bin
CLIENTLIB = $(PREFIX)/lib
SERVERDIR = $(PREFIX)/etc

MAN1DIR = $(PREFIX)/man/man1
MAN5DIR = $(PREFIX)/man/man5
MAN8DIR = $(PREFIX)/man/man8


The primary change to most Makefile.config files will be the PREFIX, which is used to set the basic directory for Gopher. The default value is usually /usr/local, although you can change it to anything you want (such as /usr/gopher). The rest of the variables define subdirectories under the primary Gopher directory and are usually acceptable as they are. Each of the subdirectories can be left the way it is or you can change it to suit your own needs. You can place all the files in one directory, if you want. The meaning of each variable appears in the following list:


CLIENTDIR
Gopher client software

CLIENTLIB
Client help file (gopher.hlp)

MAN1DIR
Man pages for Gopher client

MAN8DIR
Man pages for gopherd

SERVERDIR
Gopher server (gopherd) and configuration file (gopherd.conf)


For a Gopher client to run properly on your system, you must modify the CLIENTOPTS line in the Makefile.config file. The two options for the CLIENTOPTS line to control its behavior are as follows:


-DNOMAIL
Forbids remote users from mailing files.

-DAUTOEXITONU
Allows the Gopher client to be exited with the u command as well as q command.


To use either or both of these options, add them to the CLIENTOPS line like this:


CLIENTOPTS = -DNOMAIL -DAUTOEXITONU


Four variables relating to the Gopher server must also be set. These specify the host domain name, the port Gopher should use to listen for connections, the location of the data files, and option flags.

The domain name is set with the DOMAIN variable. It should have a leading period in the name, such as:


DOMAIN = .tpci.com


You do not need to set this variable if the hostname command returns the fully qualified domain name of the server. In this case, leave the value blank.

The SERVERPORT variable defines the port Gopher uses to wait for services and is usually set for TCP port 70. This line usually looks like this:


SERVERPORT = 70


If you are not allowing general access to your Gopher site by Internet users, you can change this value. However, if you want to allow Internet users (even a very small subset) to gain access, you should leave this as port 70. If you are setting up your Gopher site for a small network only, then choose any port number you want (between 1024 and 9999) and make sure all the Gopher clients use that number, too.

The SERVERDATA variable defines the location of the data your Gopher server offers. Its default setting is usually as follows:


SERVERDATA = /gopher-data


Set the variable to point to the file location you use for your Gopher items.

The SERVEROPTS variable accepts a number of keywords that change the behavior of the Gopher service. A typical entry looks like this:


SERVEROPTS = -DSETPROCTITLE -DCAPFILES # -DBIO -DDL


Any keywords after the pound sign are ignored when Makefile runs, so you can adjust its location to set the options you want if the order of the variables allows such a simple approach. The following lists the meaning of the different keywords allowed in the SERVEROPTS entry:


-DADD_DATE_AND_TIME
Adds dates and times to titles.

-DBIO
Used only with the WAIS versions developed by Don Gilbert (wais8b5).

-DDL
Provides support for the dl database utility (requires the dl system in a directory variable called DLPATH and the DLOBJS line uncommented out to show the files getdesc.o and enddesc.o locations).

-DCAPFILES
Offers backward compatibility with the cap directory.

-DLOADRESTRICT
Restricts user access based on the number of concurrent users (see the following section).

-DSETPROCTITLE
Sets the name displayed by ps command (BSD UNIX-based systems only).


The conf.h file is used during the compilation to set other parameters about the Gopher service. The important settings, at least when setting up a Gopher service, are those that relate to the number of queries and timeout variables. These tend to occur at the end of the conf.h file.
The WAISMAXHITS variable defines the maximum number of hits a query to a WAIS database can offer, usually set to around 40. This variable is defined like this:


#define WAISMAXHITS 40


Note that the pound sign is not a comment symbol because this is written in C. The pound sign is an important part of the processor directive and should be left in place. There is no equal sign in the definition, either.




Previous
Table of Contents
Next














Wyszukiwarka

Podobne podstrony:
821 824
2 Systemsid 821
819 821
821 (2)
news 821
824 827
824 826

więcej podobnych podstron