📄 unx42.htm
字号:
<TD>
<P>
<BR>The heart of INN, innd is the daemon that listens on the NNTP port for incoming news transfers and newsreader connections. When newsreaders connect to this port, innd creates nnrpd processes and connects them to the newsreader.
<BR></P>
<TR>
<TD>
<P>
<BR>lib
<BR></P>
<TD>
<P>
<BR>The sources for the C language function library used by other INN programs.
<BR></P>
<TR>
<TD>
<P>
<BR>nnrpd
<BR></P>
<TD>
<P>
<BR>Communicates with NNTP newsreader clients, which frees innd to do its main job, transferring news.
<BR></P>
<TR>
<TD>
<P>
<BR>samples
<BR></P>
<TD>
<P>
<BR>Sample configuration files that are copied into the site directory.
<BR></P>
<TR>
<TD>
<P>
<BR>site
<BR></P>
<TD>
<P>
<BR>This directory contains shell scripts and site configuration files. The site configuration files must be edited to tell INN with which sites you exchange news, which hosts are allowed to connect to read and post news, and so on.
<BR></P>
<TR>
<TD>
<P>
<BR>syslog
<BR></P>
<TD>
<P>
<BR>A replacement for older versions of the standard system logging program. You may not need this.</P></TABLE>
<H4 ALIGN="CENTER">
<CENTER><A ID="I33" NAME="I33">
<FONT SIZE=3><B>Learning About INN</B>
<BR></FONT></A></CENTER></H4>
<P>The first step in setting up INN is to format and read its documentation. cd into the top of the INN source tree and type the following to create a formatted copy of the INN documentation named Install.txt:
<BR></P>
<PRE>$ make Install.ms
cat Install.ms.1 Install.ms.2 >Install.ms
chmod 444 Install.ms
$ nroff -ms Install.ms > Install.txt</PRE>
<P>If the make command doesn't work for you (and if it doesn't, your make is defective and will cause you problems later), type cat Install.ms.? > Install.ms and then the preceding nroff command. These two commands create a file named Install.txt, which
you can view with your preferred editor or pager. Read it. Print it. Highlight it with your favorite color of fluorescent marker. Sleep with it under your pillow. Take it into the shower. Share it with your friends. Read it again. You won't be sorry.
<BR></P>
<P>The Install.ms document tells you just about everything you need to know to set up a news system based on INN. The only problem with it is that many people fail to read it carefully and think that there's something missing. There isn't. If you think
there is, read it again. Buy a new fluorescent marker, print off a copy of the file, and sit down with a nice glass of your favorite tea. Put it back under your pillow. Discuss it at dinner parties until your hosts ask you to leave, and ask your spouse
what she or he thinks about it. You may destroy your social life, but in the process you'll discover that you missed a few crucial bits of information the first time around. (Don't feel bad, nearly everyone does.)
<BR></P>
<H4 ALIGN="CENTER">
<CENTER><A ID="I34" NAME="I34">
<FONT SIZE=3><B>Configuring INN—The </B><B><I>config.data</I></B><B> File</B>
<BR></FONT></A></CENTER></H4>
<P>Once you've absorbed the INN documentation, you're ready to configure INN's compilation environment. Like C-news, INN can run on many different versions of UNIX. The programs that build INN need information about your version of UNIX so they can build
INN correctly. This configuration is one of the most difficult parts of installing INN, and you must make sure that you get it right. The Install.ms documentation is essential because it contains sample configurations for many different versions of UNIX.
<BR></P>
<P>The directory config holds the INN master configuration file, config.data. INN uses the C-news subst program to modify its sources before compilation, and config.data provides the information subst needs to do its job. Subst uses the definitions in
config.data to modify the INN source files before they are compiled.
<BR></P>
<P>INN supplies a prototype version of config.data named config.dist. Config.dist is almost undoubtedly wrong for your UNIX. You must create your own version of config.data:
<BR></P>
<PRE>$ cd config
$ cp config.dist config.data</PRE>
<P>Now edit config.data to match your site's version of UNIX. As mentioned above, this is one of the hardest parts of installing INN. Config.data is about 700 lines long, and there's nothing for it but to go through it line by line and make the appropriate
changes. Depending on how experienced you are, you may have to set aside several hours for this task. Install.ms devotes about 18 pages to config.data, and you should refer to it as you edit.
<BR></P>
<P>Unless you know off the top of your head the answers to questions such as, "How does your UNIX set non-blocking I/O?", you'll need to keep your programmer's manuals handy. If you have a workstation, you can edit config.data in one window and
use another to inspect your system's on-line documentation. As mentioned above, Install.ms gives sample configurations for many popular versions of UNIX. If your version is listed, use its values. (However, that doesn't relieve you of the chore of
inspecting the entire file.)
<BR></P>
<HR ALIGN=CENTER>
<NOTE>
<IMG SRC="imp.gif" WIDTH = 68 HEIGHT = 35><B>TIP:</B> The subst program, originally supplied with C-news and used in INN by the kind permission of Geoff Collyer and Henry Spencer, is a clever shell script that relies on the sed program to do much of its
work. The INN config.dist file is large enough to break some vendor's versions of sed. To see whether your vendor's sed will work with INN, cd into the config directory and type the following:
<BR>
<BR>$ cp config.dist config.data
<BR>$ make sedtest
<BR>
<BR>If this test fails, the simplest workaround is to type <B>make c quiet</B> to create a C language version of the subst program. You should also gripe at your UNIX vendor for foisting a substandard sed onto you, an unsuspecting customer.
<BR></NOTE>
<HR ALIGN=CENTER>
<P>Once you've edited config.data, you're ready to let subst configure the INN sources. From within the config directory, type the following:
<BR></P>
<PRE>$ make quiet</PRE>
<H4 ALIGN="CENTER">
<CENTER><A ID="I35" NAME="I35">
<FONT SIZE=3><B>Building INN</B>
<BR></FONT></A></CENTER></H4>
<P>Now that INN is configured, you're ready to build the system. Install.ms gives several ways to do this, depending on how trusting you are and your general philosophy of life. If you're the kind of person who likes cars with automatic transmission, you
can <B>cd</B> to the top of the INN source tree, type <B>./BUILD</B>, and answer its questions. The BUILD shell script compiles and installs INN without much input from you.
<BR></P>
<P>If you prefer to shift gears yourself, from the same directory you can type the following:
<BR></P>
<PRE>$ make world
$ cat */lint | more</PRE>
<P>Carefully inspect the lint output for errors. (See the following Tip.)
<BR></P>
<HR ALIGN=CENTER>
<NOTE>
<IMG SRC="imp.gif" WIDTH = 68 HEIGHT = 35><B>TIP: </B>The lint program detects errors in C language programs. Because C is a fairly permissive language, it lets you do things you probably shouldn't, and lint helps you find these bits of fluff in your
programs and correct them. For instance, lint can tell you if you're passing the wrong number (or type) of arguments to a C language function. Remember, just because a program compiles doesn't mean it will work correctly when you run it. If lint finds
errors in your INN configuration after you've run subst, there may be a problem you need to correct by editing
<BR>
<BR>config.data and rebuilding your system. Unfortunately, lint sometimes reports spurious errors. You'll have to consult the programmers's section of your system's manual pages to be sure which errors are real and which are not.
<BR></NOTE>
<HR ALIGN=CENTER>
<P>However, you'll learn the most about INN if you compile it bit by bit with Install.ms by your side. You may think that if INN is so simple to install you should take the easy road and use BUILD. But news systems are complex, and no matter how good they
are you will inevitably have some problems to solve. When you do you'll need all the clues you can muster, and building INN step by step helps you learn more about it. Someday, when the weasels are at the door, you'll be glad you did.
<BR></P>
<P>The step-by-step compilation procedure is fairly simple. First build the INN library:
<BR></P>
<PRE>$ cd lib
$ make libinn.a lint 2>&1 | tee errs
$ cd ..</PRE>
<P>The tee command prints the output of the make command to your terminal and also saves it to the file errs. If you use an ugly shell such as csh or one of its variants, type sh or ksh before executing the command above, or read your shell's manual page
for the correct syntax to save the standard output and standard error of a command into a file.
<BR></P>
<P>The make command creates a library of C language functions used by the other INN programs and a lint library to help detect possible problems with it. Since the other INN programs depend on the INN library, it's crucial that you compile it correctly.
Check the output in the file errs and assure yourself that any errors detected by your C compiler or lint are innocuous. If you find errors (especially compiler warnings), it's probably due to a mistake you've made in config.data. The only solution is to
correct config.data, run subst again, and recompile libinn.a.
<BR></P>
<P>Once you've successfully built the INN library, you can build the rest of INN. Cd into each of the following directories in turn: frontends, innd, nnrpd, backends, and expire. In each directory, type the following:
<BR></P>
<PRE>$ make all 2>&1 | tee errs</PRE>
<P>Check the output in the file errs. If there are compiler warnings or lint errors, do not pass go and do not collect $200. Consult your system's on-line documentation, edit config.data to correct the problems, rerun subst, and recompile the system
beginning with libinn.a.
<BR></P>
<HR ALIGN=CENTER>
<NOTE>
<IMG SRC="warning.gif" WIDTH = 37 HEIGHT = 35><B>WARNING: </B>The disadvantage of using subst to configure INN is that most of the system depends on the config.data file. If at any stage in building the system you discover errors that require you to change
config.data, you must rerun subst and recompile all of INN, beginning with libinn.a.
<BR></NOTE>
<HR ALIGN=CENTER>
<H4 ALIGN="CENTER">
<CENTER><A ID="I36" NAME="I36">
<FONT SIZE=3><B>Installing INN</B>
<BR></FONT></A></CENTER></H4>
<P>Now you're ready to install INN. Assuming that everything has gone well so far, cd to the root of the INN source tree, type <B>su</B> to become the superuser, and type this:
<BR></P>
<PRE>$ sh makedirs.sh 2>&1 | tee errs
$ make update 2>&1 | tee -a errs</PRE>
<P>This runs the commands to install INN and saves the output in the file errs, which you should carefully inspect for errors. Note the -a argument to tee in the second command line, which makes tee append to the file errs.
<BR></P>
<P>The makedirs.sh shell script creates the directories for the INN system and must be run before you type <B>make update</B>. The latter command installs INN in the directories created by makedirs.sh. Now you've installed the INN programs and are ready to
configure your news system.
<BR></P>
<H4 ALIGN="CENTER">
<CENTER><A ID="I37" NAME="I37">
<FONT SIZE=3><B>Site Configuration</B>
<BR></FONT></A></CENTER></H4>
<P>Cd into the site directory and type <B>make all 2>&1 | tee errs</B>. This command copies files from the samples and backends directories and runs subst over them. Some of these files must be edited before you install INN. They give INN
information it can't figure out on its own; for instance, with which hosts you exchange news.
<BR></P>
<P>The site directory also contains some utility shell scripts. You probably won't have to change these, but you should look at them to see what they do and ensure that paths to programs in them are correct.
<BR></P>
<P>Modifying the files in the site directory is the second most difficult part of configuring INN, especially if you haven't configured a news system before. However, INN won't work if these files aren't configured correctly, so you'll want to spend some
time here. The files you must edit are shown below, each with a brief explanation of its function. There are manual pages for each of these files in the doc directory, and you'll need to read them carefully in order to understand their function and syntax.
<BR></P>
<P>expire.ctl controls article expiration policy. In it you list a series of patterns to match newsgroup names and what actions expire should take for groups that match. This means that you can expire newsgroups selectively. The expire.ctl file is also
where you tell expire how long you want it to remember Message-IDs. You can't keep a record of Message-IDs forever because your history file would grow without bound. Expire not only removes articles from the news spool but controls how long their
Message-IDs are kept in the history file.
<BR></P>
<P>hosts.nntp lists the hosts that feed you news through NNTP. The main news daemon innd reads this file when it starts. If a host not listed in this file connects to innd, it assumes it's a newsreader and creates an nnrpd process to service it. If the
host is in the file, innd accepts incoming news articles from it.
<BR></P>
<P>inn.conf contains some site configuration defaults, such as the names put in an article's Organization and From headers. For instance, your organization might want all From headers to appear as From: someone@mailhub.corp.com, regardless of which host
posted the article. Some of these defaults may be overridden by environment variables. For instance, if the user sets the ORGANIZATION environment variable, it overrides the default in inn.conf.
<BR></P>
<P>Articles posted to a moderated newsgroup are first mailed to the newsgroup's moderator, who approves (or disapproves) the article. If it's approved, the moderator posts it with an Approved header containing his e-mail address. The modera
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -