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

📄 lsg45.htm

📁 linux-unix130.linux.and.unix.ebooks130 linux and unix ebookslinuxLearning Linux - Collection of 12 E
💻 HTM
📖 第 1 页 / 共 4 页
字号:
<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>







Adobe PDF file</FONT>







<TR>







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







s







</FONT>







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







Sound</FONT>







<TR>







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







T







</FONT>







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







Pointer to 3270 Telnet session (hostname is machine to connect to and selector string is login name)</FONT>







</TABLE><P>You must have the following files on your Linux system for Gopher to work:







<BR>







<UL>







<LI>The tn3270 or similar 3270 emulator is used for Telnet 3270 connections.







<BR>







<BR>







<LI>You need the kermit or zmodem communications programs to download files. The binaries are usually called kermit, sz, sb, and sx.







<BR>







<BR>







<LI>If you allow 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). If you are offering open access, you should have all the components.







<BR>







<BR>







<A NAME="E68E238"></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+ installation is done in the same manner, although with some extra parameters. Because Gopher is more likely to be on a Linux site than Gopher+, this chapter concentrates on Gopher.







<BR>







<P>This section uses 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 defined standard configuration for directory locations, so feel free to choose whatever works best for you.







<BR>







<BR>







<A NAME="E69E254"></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. You can do this 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 it should not be directly tied to a real machine to allow you to make changes whenever you want. 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 directory.







<BR>







<P>You can control the number of Gopher connections permitted 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 permits 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 enable this feature, remove the comment symbol and make sure that the directory pointed 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>You can set a number of file decoders for your system. This setting 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 in that format. 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 the programs through Gopher. You can also add other extensions, such as .zip, .tar, and so on by adding new lines with the binary name (and its full path).







<BR>







<P>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 has 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 work only with file extensions. To create a broader search, you can use wildcards and the keyword ignore_patt (for ignore pattern). For example, the following line will ignore any file with the letters usr anywhere in the name:







<BR>







<BR>







<PRE>







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







<BR>







<A NAME="E69E255"></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 will generate lots of 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, which is 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 get you to set 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 timezone 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 will leave 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. For American English, for example, you set the option like this:







<BR>







<BR>







<PRE>







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







<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 the following:







<BR>







<BR>







<PRE>







<FONT COLOR="#000080">BummerMsg: We're sorry, we6 don't allow off-site access to this server</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. By using entries with the keyword access, you can limit the users who can get to your server. The general format of the access line is:







<BR>







<BR>







<PRE>







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







<P>In this example, 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>The browse keyword means that the user can examine directory contents. If you forbid this permission, users can access entries, but they can't get directory contents.







<BR>







<BR>







<LI>The ftp keyword enables the server to act as gateway to FTP services.







<BR>







<BR>







<LI>The read keyword means that users can access a file. If you don't give this permission, users get the BummerMsg when they ask for the file.







<BR>







<BR>







<LI>The search keyword means that users can access indexes (type seven items). This keyword 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 add a line like the following:







<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. Take a look at this access entry:







<BR>







<BR>







<PRE>







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







<P>This entry 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>This setting 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="E69E256"></A>







<H4 ALIGN=CENTER>







<CENTER>







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







<BR>







<P>You need to modify two files 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 executable) is a lengthy file, so you should be careful 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 later in this section.







<BR>







<P>One setting you may want to alter is the debugging utility, which is enabled by default in most systems. This can help you get the system running properly. When the operation is correct, however, you should recompile the source with the debugging features removed to make the process faster and smaller, as well as 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 they are usually acceptable as they are. You can leave all of the subdirectories the way they are, or you can change them to suit your own needs. You can place all the files in one directory, if you want. The meaning of each variable is as follows:







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







⌨️ 快捷键说明

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