⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 rhl49.htm

📁 linux的初学电子书
💻 HTM
📖 第 1 页 / 共 4 页
字号:
<LI>kermit or zmodem communications programs&#151;Used for downloading files. The binaries are usually called kermit, sz, sb, and sx.

<BR>

<BR>

<LI>graphics utility&#151;If you allow the display of graphics, you need a graphics utility such as xv.

<BR>

<BR>

</UL>

<P>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.

<BR>

<BR>

<A NAME="E68E386"></A>

<H3 ALIGN=CENTER>

<CENTER>

<FONT SIZE=5 COLOR="#FF0000"><B>Configuring Gopher</B></FONT></CENTER></H3>

<BR>

<P>Installing and configuring Gopher (and Gopher+) is a matter of setting a number of configuration options prior to 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. Since Gopher is more likely to be on a Linux site than Gopher+, we'll concentrate on that.

<BR>

<P>Throughout this section, we will use filenames without full path extensions because it really doesn't 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.

<BR>

<BR>

<A NAME="E69E508"></A>

<H4 ALIGN=CENTER>

<CENTER>

<FONT SIZE=4 COLOR="#FF0000"><B>The gopherd.conf File</B></FONT></CENTER></H4>

<BR>

<P>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.

<BR>

<P>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:

<BR>

<BR>

<PRE>

<FONT COLOR="#000080">hostalias: tpci</FONT></PRE>

<P>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 stand-alone machine, you can either use an alias tied to your machine name or use your machine name directly.

<BR>

<P>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 didn't 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:

<BR>

<BR>

<PRE>

<FONT COLOR="#000080">#PIDS_Directory: /pids</FONT></PRE>

<P>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. This variable is set like this:

<BR>

<BR>

<PRE>

<FONT COLOR="#000080">MaxConnections: 15</FONT></PRE>

<P>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:

<BR>

<PRE>

<FONT COLOR="#000080">decoder: .Z /usr/ucb/zcat

decoder: .gz /usr/gnu/bin/zcat

#decoder: .adpcm /usr/openwin/bin/adpcm_dec

#decoder: .z /usr/gnu/bin/zcat</FONT></PRE>

<P>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).

<BR>

<P>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:

<BR>

<BR>

<PRE>

<FONT COLOR="#000080">Cachetime: 180</FONT></PRE>

<P>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 will have a number of defined ignores, such as these:

<BR>

<PRE>

<FONT COLOR="#000080">ignore: lib

ignore: bin

ignore: etc

ignore: dev</FONT></PRE>

<P>Any file with this type of extension is ignored. If you have a particular file extension you want to protect, add it to the list. For example, if your accounting system uses the extension .acct, you could have the Gopher clients ignore all these files 
by adding this line:

<BR>

<BR>

<PRE>

<FONT COLOR="#000080">ignore: acct</FONT></PRE>

<P>Note that these ignore statements only work with file extensions. To be more broad, you can use wildcards and the keyword ignore_patt (for ignore pattern). For example, the line:

<BR>

<BR>

<PRE>

<FONT COLOR="#000080">ignore_patt: ^usr$</FONT></PRE>

<P>ignores any file with the letters usr at the beginning of the name.

<BR>

<BR>

<A NAME="E69E509"></A>

<H4 ALIGN=CENTER>

<CENTER>

<FONT SIZE=4 COLOR="#FF0000"><B>The gopherdlocal.conf File</B></FONT></CENTER></H4>

<BR>

<P>In the file gopherdlocal.conf, you have to make two small changes to identify the system administrator, otherwise your system generates many annoying notes. The lines in the gopherdlocal.conf file look like this by default:

<BR>

<PRE>

<FONT COLOR="#000080">Admin: blank

AdminEmail: blank</FONT></PRE>

<P>If you do not change these entries to actual values, Gopher can generate all kinds of weird error messages. The Admin field usually has the administrator's name and sometimes a telephone number. For example, the file could be filled out as follows:

<BR>

<PRE>

<FONT COLOR="#000080">Admin: Yvonne Chow, 555-1212

AdminEmail: ychow@chatton.com</FONT></PRE>

<P>Another setting you should provide in the gopherdlocal.conf file is the Abstract, a short description of what your particular Gopher service provides. If you don't change the default setting, users get a message prompting them to request the Abstract, 
so you may as well do it right away. Multiple lines in an abstract value are followed by a backslash to show the continuation. A sample Abstract setting looks like this:

<BR>

<PRE>

<FONT COLOR="#000080">Abstract: This server provides sound and graphics files \

collected by the administrator on a recent trip to Outer \

Mongolia.</FONT></PRE>

<P>General information about your site is provided with a number of general settings for the site name, the organization that runs the site, your machine's geographic location, the latitude and longitude of your site, and a time zone setting. You can leave 
these blank if you want, but providing the information leads to a more complete Gopher site. The settings in a sample gopherdlocal.conf file look like this:

<BR>

<PRE>

<FONT COLOR="#000080">Site: Explore_Mongolia

Org: Mongolia Tourist Bureau

Loc: North Bay, Ontario, Canada

Geog: blank

TZ: EDT</FONT></PRE>

<P>The setting of blank for Geog leaves the setting with no value. Obviously, the system administrator didn't know the latitude and longitude settings.

<BR>

<P>You can set a language option used by Gopher clients to show what language most of the documents available on your site are written in. This is done like this:

<BR>

<BR>

<PRE>

<FONT COLOR="#000080">Language: En_US</FONT></PRE>

<P>which refers to American English.

<BR>

<P>The setting BummerMsg is used to display a brief text string to a user who exceeds your maximum number of concurrent users or causes an error when accessing the system. The default value is this:

<BR>

<BR>

<PRE>

<FONT COLOR="#000080">BummerMsg: Sorry, we have exceeded the number of permissible users</FONT></PRE>

<P>You can change this to whatever message you want. Try not to be rude or obnoxious because you never know who will get this message.

<BR>

<P>The last step in modifying the gopherdlocal.conf file is to set access procedures for users who log in to your Gopher server. Limiting the users who can get to your server is done through entries with the keyword access. The general format of the access 
line is:

<BR>

<BR>

<PRE>

<FONT COLOR="#000080">access: hostname permissions num_users</FONT></PRE>

<P>where hostname is either the name or IP address of the host that is connecting to your server, permissions is the permission set for those users, and num_users is the maximum number of users that can be connected to the service concurrently.

<BR>

<P>The permissions are set using any combination of the following four words, either as they are or preceded by an exclamation mark to mean &quot;not allowed.&quot; The permission keywords are as follows:

<BR>

<UL>

<LI>browse&#151;Can examine directory contents. If this is forbidden, users can access entries, but they can't get directory contents.

<BR>

<BR>

<LI>ftp&#151;Allows server to act as gateway to FTP services.

<BR>

<BR>

<LI>read&#151;Can access a file. If forbidden, the users get the BummerMsg when they ask for the file.

<BR>

<BR>

<LI>search&#151;Can access indexes (type 7 items). If forbidden, access to the indexes is not allowed. This is used primarily with Gopher+.

<BR>

<BR>

</UL>

<P>For example, to set access permissions to allow up to 10 users from the network chatton.com to access your Gopher server with full rights, you would add a line like this:

<BR>

<BR>

<PRE>

<FONT COLOR="#000080">access: chatton.com browse ftp read search 10</FONT></PRE>

<P>There is at least one space between each entry, even between permissions. This access entry:

<BR>

<BR>

<PRE>

<FONT COLOR="#000080">access: bignet.org !browse !ftp read search 3</FONT></PRE>

<P>allows three concurrent users from bignet.org to access the Gopher server and read and search, but not use FTP gateways or browse the directory listings.

<BR>

<P>If you are using IP addresses, you can use a subset of the IP address to indicate the entire network. For example, if bignet.com's network address is 147.12, you can indicate the entire network with a line like this:

<BR>

<BR>

<PRE>

<FONT COLOR="#000080">access: 147.12. !browse !ftp read search 3</FONT></PRE>

<P>You must follow the last quad of numbers specified in the IP address with a period, otherwise 147.120 through 147.129 will also have the same permissions (because they match the digits specified).

<BR>

<P>If you want to enable access from a particular machine, you can do that, too. For example, to allow your friend's darkstar machine to access your Gopher server with full permissions, you would add a line like this:

<BR>

<BR>

<PRE>

<FONT COLOR="#000080">access: darkstar.domain.name browse ftp read search 1</FONT></PRE>

<P>Most general Gopher servers tend to allow anyone to connect, so they use a default entry to refer to anyone not explicitly defined by another access entry. The default setting is usually like this:

<BR>

<BR>

<PRE>

<FONT COLOR="#000080">access: default !browse !ftp read search 15</FONT></PRE>

<P>which allows anyone to read and search Gopher directories, but not move through them or use your machine as an FTP gateway.

<BR>

<BR>

<A NAME="E69E510"></A>

<H4 ALIGN=CENTER>

<CENTER>

<FONT SIZE=4 COLOR="#FF0000"><B>Setting Up the </B><B>Makefile</B></FONT></CENTER></H4>

<BR>

<P>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 these files need have already been set, 
but you should check the values carefully to prevent problems.

<BR>

<P>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.

<BR>

<P>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:

<BR>

<BR>

<PRE>

<FONT COLOR="#000080">#DEBUGGING = -DDEBUGGING</FONT></PRE>

<P>By default, this line is probably not commented out.

<BR>

<P>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:

<BR>

<PRE>

<FONT COLOR="#000080">PREFIX = /usr/local

CLIENTDIR = $(PREFIX)/bin

CLIENTLIB = $(PREFIX)/lib

SERVERDIR = $(PREFIX)/etc

MAN1DIR = $(PREFIX)/man/man1

MAN5DIR = $(PREFIX)/man/man5

MAN8DIR = $(PREFIX)/man/man8</FONT></PRE>

<P>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:

<BR>



<TABLE  BORDERCOLOR=#000040 BORDER=1 CELLSPACING=2 WIDTH="100%" CELLPADDING=2 >

<TR>

<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>

CLIENTDIR

</FONT>

<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>

Gopher client software</FONT>

<TR>

<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>

CLIENTLIB

</FONT>

<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>

Client help file (gopher.hlp)</FONT>

<TR>

<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>

MAN1DIR

</FONT>

<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>

Man pages for gopher client</FONT>

<TR>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -