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

📄 0185-0189.html

📁 linux-unix130.linux.and.unix.ebooks130 linux and unix ebookslinuxLearning Linux - Collection of 12 E
💻 HTML
字号:






<HTML>

<HEAD>

<TITLE>Sams Teach Yourself Linux in 24 Hours:Configuring Internet News:EarthWeb Inc.-</TITLE>

<META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW">
<SCRIPT>
<!--
function displayWindow(url, width, height) {
        var Win = window.open(url,"displayWindow",'width=' + width +
',height=' + height + ',resizable=1,scrollbars=yes');
}
//-->
</SCRIPT>
</HEAD>

 -->




<!-- ISBN=0672311623 //-->

<!-- TITLE=Sams Teach Yourself Linux in 24 Hours//-->

<!-- AUTHOR=Bill Ball//-->

<!-- PUBLISHER=Macmillan Computer Publishing//-->

<!-- IMPRINT=Sams//-->

<!-- CHAPTER=12 //-->

<!-- PAGES=0185-0192 //-->

<!-- UNASSIGNED1 //-->

<!-- UNASSIGNED2 //-->







<P><CENTER>

<a href="../ch11/0183-0184.html">Previous</A> | <a href="../ewtoc.html">Table of Contents</A> | <a href="0190-0192.html">Next</A>

</CENTER></P>



<A NAME="PAGENUM-185"><P>Page 185</P></A>





<H3><A NAME="ch12_ 2">

Hour 12

</A></H3>



<H2>

<A NAME="ch12_ 3">

Configuring Internet News

</A>

</H2>



<P>This hour shows you how to set up your Linux system to handle

electronic newsgroups. You'll learn about Usenet news, the world's largest

international electronic bulletin board. You'll also explore various programs you can use

to read, post, and respond to Usenet posts or messages.

</P>



<H3><A NAME="ch12_ 4">

Reading Usenet News

</A></H3>



<P>This section introduces you to Usenet news and shows you how to set up

and use the tin and slrn newsreader programs during your PPP connection.

Reading news can be an endless source of amusement, help, and even

frustration (especially if the &quot;signal-to-noise&quot; ratio is low).

</P>



<P>Usenet newsgroups are organized in a hierarchy, usually by topic or type

of discussion. For example, the Linux newsgroups are generally organized

under the comp topic. Here is a partial list of Linux newsgroups:

</P>

<!-- CODE SNIP //-->

<PRE>comp.os.linux.announce

comp.os.linux.hardware

comp.os.linux.misc

comp.os.linux.networking

comp.os.linux.setup

comp.os.linux.x

</PRE>

<!-- END CODE SNIP //-->



<A NAME="PAGENUM-186"><P>Page 186</P></A>







<P>This shows that Linux subjects, such as setup, hardware, and X11 are organized under

the topics of computers, operating systems, and Linux. You'll find many other

subjects organized the same way.

</P>



<P>Although there's no guarantee you'll find the exact subject you're looking for, chances

are you'll easily find a newsgroup discussing a subject you're interested in.

</P>



<P>Today, there are dozens of different Usenet software transport programs and

newsreaders, and more than 30,000 different newsgroups.

</P>



<P>All newsreaders offer the basic functions of

</P>



<UL>

<LI>          Subscribing or unsubscribing to newsgroups

<LI>          Browsing messages and reading follow-up messages (threads)

<LI>          Directly mailing a reply to the author of a message

<LI>          Posting a follow-up message to a newsgroup message

<LI>          Saving the contents of a message (usually to a directory called

News in your home directory)

</UL>



<P>Both tin and slrn read a newsgroup index file called

.newsrc, which is normally located in your home directory. Although you can start both

tin and slrn, and tell the programs to retrieve a complete list of active newsgroups from your ISP's news server, you'll waste lots of

time while the programs retrieve the list (nearly 30,000 at the time of this writing).

Instead, create the .newsrc file with your favorite text editor, and then enter the newsgroups you

want to browse, for example:

</P>



<!-- CODE //-->

<PRE>

news.announce.newusers:

comp.os.linux.announce:

comp.os.linux.development.apps:

comp.os.linux.development.system:

comp.os.linux.hardware:

comp.os.linux.misc:

comp.os.linux.networking:

comp.os.linux.setup:

comp.os.linux.x:

comp.windows.x:

comp.windows.x.i386unix:

rec.autos.antique:

alt.humor.best-of-usenet:

rec.humor:

</PRE>

<!-- END CODE //-->



<P>Notice that the list does not have to be in alphabetical order. You must have a

colon following the newsgroup. If you type in a newsgroup not supported by your ISP, both

tin and slrn will ignore the name, and both programs will display the list of newsgroups in

the same order in which you typed them in the

.newsrc file.

</P>



<P>Developing your own list of newsgroups will speed up your newsreading considerably.

Read on to learn more about tin and slrn.

</P>



<A NAME="PAGENUM-187"><P>Page 187</P></A>







<H4><A NAME="ch12_ 5">

Reading Usenet News with the tin Newsreader

</A></H4>



<P>Iain Lea's news reader, tin, which is found under the

/usr/bin directory, is a full-screen newsreader that reads a list of newsgroups from the

.newsrc file in your home directory. The tin reader is easy to use (see Figure 12.1). You can navigate through its display with

cursor keys, read messages with the Enter key, and reply with a single keystroke.

</P>



<P>In order to read Usenet news with tin, you must tell the program the name of your

ISP's NNTP, or news server. You should have received this information when you signed up

for </P>





<P>Figure 12.1.<BR>

The tin newsreader<BR>

displays newsgroup<BR>

messages in a cursor-<BR>

driven list.</P>

<P><a href="javascript:displayWindow('images/ch12fg01.jpg', 288, 216)"><img src="images/tn_ch12fg01.jpg"></a><BR>

</P>





<P>

service. Once you have the name, you can tell tin the NNTP server name in at least

two ways, one of which will work with tin and slrn.

</P>



<P>First, make sure you're logged in as root. Then, using a text editor, either edit or

create a file called nntpserver under the /etc directory. There's no special format to the file, and

all you have to do is put in the name of the news server, for example:

</P>



<!-- CODE SNIP //-->

<PRE>

# cat /etc/nntpserver

news.staffnet.com

</PRE>

<!-- END CODE SNIP //-->



<P>Then, connect with your ISP, and call tin with this command line:

</P>



<!-- CODE SNIP //-->

<PRE>

# tin -nqr

</PRE>

<!-- END CODE SNIP //-->



<P>This tells the tin program that you want it to only load newsgroups from your

.newsrc file, do a quick start without checking for any new newsgroups, and finally, to read your

news

</P>

<A NAME="PAGENUM-188"><P>Page 188</P></A>





<P>

remotely from your ISP's NNTP server. Once tin reads the groups, and gathers any

new news, it will display the groups (see Figure 12.2). You can read a group by using the

cursor to select a group, and hitting the Enter key.

</P>



<P>You can also tell tin your ISP's NNTP server by using an environment variable,

NNTPSERVER. </P>



<P>Figure 12.2.<BR>

Reading a newsgroup's messages<BR>

with the tin<BR>

newsreader.</P>

<P><a href="javascript:displayWindow('images/ch12fg02.jpg', 288, 216)"><img src="images/tn_ch12fg02.jpg"></a><BR>

</P>





<P>Creating environment variables is discussed in Hour 6, &quot;Using the Shell.&quot; One way

to create the NNTPSERVER variable, if you always use the bash shell, is to log in as root,

then edit a file named profile in the /etc directory. Enter the following into the file, and make

sure the NNTPSERVER variable is placed in the

export statement, for example:

</P>



<!-- CODE SNIP //-->

<PRE>

NNTPSERVER='news.staffnet.com'

export NNTPSERVER

</PRE>

<!-- END CODE SNIP //-->



<P>You can then try to read the variable into your environment with

</P>



<!-- CODE SNIP //-->

<PRE>

# source /etc/profile

</PRE>

<!-- END CODE SNIP //-->



<P>After trying to source this file, you can check for the

NNTPSERVER variable by using the printenv command, or you can log out and log back in, and check again. Once you've

defined NNTPSERVER, this will work for tin and slrn.

</P>



<P>You can configure other aspects of tin, such as the default editor to use while posting

or

</P>



<A NAME="PAGENUM-189"><P>Page 189</P></A>





<P>

replying to messages. See the tinrc file under the

.tin directory in your home directory for details, and read the

tin manual page for the options.

</P>



<H4><A NAME="ch12_ 6">

Reading Usenet News with the slrn Newsreader

</A></H4>



<P>The slrn newsreader, by John E. Davis, found under the

/usr/bin directory, is a newsreader like tin. But

slrn has some nifty features not supported by the

tin program:

</P>



<UL>

<LI>          Message headers and messages are displayed at the same time.

<LI>          Extensive custom colorization of different parts of the display and messages

is available.

<LI>          Mouse-cursor_aware mode

<LI>          Different NNTP servers may be specified on the command line.

</UL>



<P>Figure 12.3 shows the slrn screen.

</P>



<P>Figure 12.3.<BR>

The slrn newsreader<BR>

features mouse-aware<BR>

menus and split-screen<BR>

viewing of messages<BR>

and message contents.</P>

<P><a href="javascript:displayWindow('images/ch12fg03.jpg', 288, 216)"><img src="images/tn_ch12fg03.jpg"></a><BR>

<P>





<P>The slrn program features a split display once you're reading messages in a newsgroup.

You can also run slrn without specifying an

NNTPSERVER variable with the -h command-line option, for example:

</P>





<!-- CODE SNIP //-->

<PRE>

# slrn -h news.staffnet.com

</PRE>

<!-- END CODE SNIP //-->



<P><CENTER>

<a href="../ch11/0183-0184.html">Previous</A> | <a href="../ewtoc.html">Table of Contents</A> | <a href="0190-0192.html">Next</A>

</CENTER></P>











</td>
</tr>
</table>

<!-- begin footer information -->









</body></html>

⌨️ 快捷键说明

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