819-821.html
来自「linux-unix130.linux.and.unix.ebooks130 l」· HTML 代码 · 共 163 行
HTML
163 行
<HTML>
<HEAD>
<TITLE>Linux Unleashed, Third Edition:Setting up a Gopher Service</TITLE>
<SCRIPT>
<!--
function displayWindow(url, width, height) {
var Win = window.open(url,"displayWindow",'width=' + width +
',height=' + height + ',resizable=1,scrollbars=yes');
}
//-->
</SCRIPT>
</HEAD>
-->
<!--ISBN=0672313723//-->
<!--TITLE=Linux Unleashed, Third Edition//-->
<!--AUTHOR=Tim Parker//-->
<!--PUBLISHER=Macmillan Computer Publishing//-->
<!--IMPRINT=Sams//-->
<!--CHAPTER=50//-->
<!--PAGES=819-821//-->
<!--UNASSIGNED1//-->
<!--UNASSIGNED2//-->
<CENTER>
<TABLE BORDER>
<TR>
<TD><A HREF="816-819.html">Previous</A></TD>
<TD><A HREF="../ewtoc.html">Table of Contents</A></TD>
<TD><A HREF="821-824.html">Next</A></TD>
</TR>
</TABLE>
</CENTER>
<P><BR></P>
<P>Note that these ignore statements only work with file extensions. To be more broad, you can use wildcards and the keyword <TT>ignore_patt</TT> (for ignore pattern). For example, the line:</P>
<!-- CODE SNIP //-->
<PRE>
ignore_patt: ^usr$
</PRE>
<!-- END CODE SNIP //-->
<P>ignores any file with the letters <TT>usr</TT> at the beginning of the name.</P>
<H4 ALIGN="LEFT"><A NAME="Heading5"></A><FONT COLOR="#000077">The gopherdlocal.conf File</FONT></H4>
<P>In the file <TT>gopherdlocal.conf</TT>, you have to make two small changes to identify the system administrator, otherwise your system generates many annoying notes. The lines in the <TT>gopherdlocal.conf</TT> file look like this by default:</P>
<!-- CODE SNIP //-->
<PRE>
Admin: blank
AdminEmail: blank
</PRE>
<!-- END CODE SNIP //-->
<P>If you do not change these entries to actual values, Gopher can generate all kinds of weird error messages. The <TT>Admin</TT> field usually has the administrator’s name and sometimes a telephone number. For example, the file could be filled out as follows:</P>
<!-- CODE SNIP //-->
<PRE>
Admin: Yvonne Chow, 555-1212
AdminEmail: ychow@chatton.com
</PRE>
<!-- END CODE SNIP //-->
<P>Another setting you should provide in the <TT>gopherdlocal.conf</TT> file is the <TT>Abstract</TT>, 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 <TT>Abstract</TT>, 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 <TT>Abstract</TT> setting looks like this:</P>
<!-- CODE SNIP //-->
<PRE>
Abstract: This server provides sound and graphics files \
collected by the administrator on a recent trip to Outer \
Mongolia.
</PRE>
<!-- END CODE SNIP //-->
<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 <TT>gopherdlocal.conf</TT> file look like this:</P>
<!-- CODE SNIP //-->
<PRE>
Site: Explore_Mongolia
Org: Mongolia Tourist Bureau
Loc: North Bay, Ontario, Canada
Geog: blank
TZ: EDT
</PRE>
<!-- END CODE SNIP //-->
<P>The setting of <TT>blank</TT> for <TT>Geog</TT> leaves the setting with no value. Obviously, the system administrator didn’t know the latitude and longitude settings.</P>
<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:</P>
<!-- CODE SNIP //-->
<PRE>
Language: En_US
</PRE>
<!-- END CODE SNIP //-->
<P>which refers to American English.
</P>
<P>The setting <TT>BummerMsg</TT> 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:</P>
<!-- CODE SNIP //-->
<PRE>
BummerMsg: Sorry, we have exceeded the number of permissible users
</PRE>
<!-- END CODE SNIP //-->
<P>You can change this to whatever message you want. Be careful how you phrase it, though, because you never know who will get this message.
</P>
<P>The last step in modifying the <TT>gopherdlocal.conf</TT> 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 <TT>access</TT>. The general format of the access line is:</P>
<!-- CODE SNIP //-->
<PRE>
access: <I>hostname permissions num</I>_<I>users</I>
</PRE>
<!-- END CODE SNIP //-->
<P>where <I>hostname</I> is either the name or IP address of the host that is connecting to your server, <I>permissions</I> is the permission set for those users, and <I>num_users</I> is the maximum number of users that can be connected to the service concurrently.</P>
<P>The permissions are set by using any combination of the following four words, either as they are or preceded by an exclamation mark to mean “not allowed.” The permission keywords are as follows:</P>
<DL>
<DD><B>•</B> <TT>browse</TT>—Can examine directory contents. If this is forbidden, users can access entries, but they can’t get directory contents.
<DD><B>•</B> <TT>ftp</TT>—Allows server to act as gateway to FTP services.
<DD><B>•</B> <TT>read</TT>—Can access a file. If forbidden, the user gets the <TT>BummerMsg</TT> when he asks for the file.
<DD><B>•</B> <TT>search</TT>—Can access indexes (enter <B>7</B> items). If forbidden, access to the indexes is not allowed. This is used primarily with Gopher+.
</DL>
<P>For example, to set access permissions to allow up to 10 users from the network <TT>chatton.com</TT> to access your Gopher server with full rights, add a line like this:</P>
<!-- CODE SNIP //-->
<PRE>
access: chatton.com browse ftp read search 10
</PRE>
<!-- END CODE SNIP //-->
<P>There is at least one space between each entry, even between permissions. This access entry:
</P>
<!-- CODE SNIP //-->
<PRE>
access: bignet.org !browse !ftp read search 3
</PRE>
<!-- END CODE SNIP //-->
<P>allows three concurrent users from <TT>bignet.org</TT> to access the Gopher server and read and search, but not use FTP gateways or browse the directory listings.</P>
<P>If you are using IP addresses, you can use a subset of the IP address to indicate the entire network. For example, if <TT>bignet.com</TT>’s network address is 147.12, you can indicate the entire network with a line like this:</P>
<!-- CODE SNIP //-->
<PRE>
access: 147.12. !browse !ftp read search 3
</PRE>
<!-- END CODE SNIP //-->
<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).
</P>
<P>If you want to enable access from a particular machine, you can do that, too. For example, to allow your friend’s <TT>darkstar</TT> machine to access your Gopher server with full permissions, add a line like this:</P>
<!-- CODE SNIP //-->
<PRE>
access: darkstar.domain.name browse ftp read search 1
</PRE>
<!-- END CODE SNIP //-->
<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:
</P>
<!-- CODE SNIP //-->
<PRE>
access: default !browse !ftp read search 15
</PRE>
<!-- END CODE SNIP //-->
<P>which allows anyone to read and search Gopher directories, but not move through them or use your machine as an FTP gateway.
</P><P><BR></P>
<CENTER>
<TABLE BORDER>
<TR>
<TD><A HREF="816-819.html">Previous</A></TD>
<TD><A HREF="../ewtoc.html">Table of Contents</A></TD>
<TD><A HREF="821-824.html">Next</A></TD>
</TR>
</TABLE>
</CENTER>
</td>
</tr>
</table>
<!-- begin footer information -->
</body></html>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?