Linux Unleashed, Third Edition:Setting up a Gopher Service
-->
Previous
Table of Contents
Next
There are several types of files supported by Gopher, all given a unique one-character type code. The following is a list of valid codes:
0
Plain text file
1
Directory
2
CSO phonebook server (the hostname is the machine to connect to, the selector string is blank)
3
Error
4
BinHex Macintosh file
5
Binary DOS archive file
6
UNIX uuencoded file
7
Index-search server
8
Pointer to text-based Telnet session (hostname is the machine name to connect to and selector string is the name to log in as)
9
Binary file
g
GIF file
h
HTML document
I
Graphic image
i
Unselectable inline text
M
MIME-encapsulated mail document
P
Adobe PDF file
s
Sound
T
Pointer to 3270 Telnet session (hostname is machine to connect to and selector string is login name)
The Gopher system uses a number of other files on a Linux system, all of which must exist. The files necessary for Gopher are as follows:
tn3270 or similar 3270 emulatorUsed for Telnet 3270 connections.
kermit or zmodem communications programsUsed for downloading files. The binaries are usually called kermit, sz, sb, and sx.
graphics utilityIf you allow the display of graphics, you need a graphics utility such as xv.
You can modify these requirements if you have a private site (such as for your local area network), but if you are offering open access you should have all the components.
Configuring Gopher
Installing and configuring Gopher (and Gopher+) is a matter of setting a number of configuration options before compiling the system software (it is usually not precompiled for you) and configuring some standard files. Gopher+ is done in the same manner, although with some extra parameters. Because Gopher is more likely to be on a Linux site than Gopher+, well concentrate on that.
Throughout this section, we will use filenames without full path extensions because it really doesnt matter where you install the Gopher software, as long as the directory paths are set correctly. There is no real standard configuration for directory locations, so feel free to choose whatever works best for you.
The gopherd.conf File
The configuration parameters for Gopher (and Gopher+) are in a file called gopherd.conf, which is read by the Gopher daemon gopherd. The default settings generally need a little modification, although many changes are simply changing commented lines to uncommented, and vice versa.
The first step is to create an alias for the Gopher service on your machine. Perform this step with the line that defines the hostalias. There should be a line in the file that looks like this:
hostalias: tpci
The alias is used to find the Gopher server on your system and should not be directly tied to a real machine, so you can make changes whenever you wish. The best approach is to create an alias and tie it to a physical machine with DNS. If you are running a standalone machine, you can use either an alias tied to your machine name or your machine name directly.
You can also control the number of Gopher connections allowed at one time. This is sometimes necessary to prevent a system from bogging down due to excessive user load. The maximum number of connections Gopher allows is given in a file, usually in the directory PIDS_Directory. A line in the gopherd.conf file usually has this variable commented out because early versions didnt implement it properly or it was unstable. If you want to allow this feature, remove the comment symbol and make sure the directory it points to has the necessary files for your version of Gopher. The line usually looks like this:
#PIDS_Directory: /pids
A better way to handle the load on your system is to use the MaxConnections keyword, which sets the number of clients you support concurrently. You have to experiment to determine the best balance between system load and user service. A good starting point for a fast Linux system (80486 or Pentium CPU) is 15 to 25 users. If you are going to run a Web server at the same time, you may want to cut down this number a little, though, to spare system resources. This variable is set like this:
MaxConnections: 15
If the number of users is exceeded, an error message is generated when the connection is attempted. You can set a number of file decoders for your system. This is used when a user requests a file from Gopher and adds an extension (such as .Z, .gz, or .zip) for a compression or archive utility. The decoders recognize the extension the user supplies and invoke the proper utility to send the file properly decoded. Most gopherd.conf files have the following decoder lines already in the setup:
decoder: .Z /usr/ucb/zcat
decoder: .gz /usr/gnu/bin/zcat
#decoder: .adpcm /usr/openwin/bin/adpcm_dec
#decoder: .z /usr/gnu/bin/zcat
The last two decoders are commented out and can be uncommented if you want to offer files in these formats through Gopher. You can also add other extensions by adding new lines with the binary name (and its full path).
In addition, the amount of time a cache file stays valid should be set. This is controlled by the line using the keyword Cachetime. Set this value to a reasonable value, such as 180 seconds. You should have a line that looks like this in the gopherd.conf file:
Cachetime: 180
You can use the gopherd.conf file to restrict access to some files on your system by using the ignore keyword. Usually the gopherd.conf file has a number of defined ignores, such as these:
ignore: lib
ignore: bin
ignore: etc
ignore: dev
Any file with this type of extension is ignored. If there is a particular file extension you want to protect, add it to the list. For example, if your accounting system uses the extension .acct, you can have the Gopher clients ignore all these files by adding this line:
ignore: acct
Previous
Table of Contents
Next
Wyszukiwarka
Podobne podstrony:
819 821index (816)Dz U 2002 nr 92 poz 819I ACa 816 13819 820COM(2006)819 Plan działania przepustowosc portow816 (2)JMLAB COBALT 816815 819ReadMe (816)więcej podobnych podstron