home *** CD-ROM | disk | FTP | other *** search
/ Hackers Toolkit v2.0 / Hackers_Toolkit_v2.0.iso / HTML / archive / Unix / HOWTOs / ISP-HOOK < prev    next >
Text File  |  1999-11-04  |  33KB  |  1,321 lines

  1.   ISP-Hookup-HOWTO
  2.   Egil Kvaleberg, egil@kvaleberg.no
  3.   v1.26, 5 March 1998
  4.  
  5.   This document describes how to use Linux to connect to an Internet
  6.   Service Provider via a dial-up modem TCP/IP connection.  As well as
  7.   the basic dial-up procedure and IP establishment, email and news han¡
  8.   dling is covered.
  9.   ______________________________________________________________________
  10.  
  11.   Table of Contents
  12.  
  13.  
  14.   1. Introduction
  15.  
  16.      1.1 Copyright
  17.      1.2 Disclaimer
  18.      1.3 Translations
  19.      1.4 New versions of this document
  20.      1.5 Feedback
  21.  
  22.   2. How do I connect to the rest of the world?
  23.  
  24.      2.1 The basic configuration
  25.  
  26.   3. How do I
  27.  
  28.   4. How do I send and receive
  29.  
  30.   5. News
  31.  
  32.      5.1 How do I set up an online news-reader?
  33.      5.2 How do I set up an offline news-reader?
  34.      5.3 How do I set up C News?
  35.      5.4 How do I set up Leafnode?
  36.  
  37.   6. How do I automate the connection procedure?
  38.  
  39.   7. Final words
  40.  
  41.      7.1 Other things I should know about?
  42.  
  43.   8. ISP specific information
  44.  
  45.      8.1 How do I learn more?
  46.      8.2 Thanks to
  47.  
  48.  
  49.   ______________________________________________________________________
  50.  
  51.  
  52.  
  53.   1.  Introduction
  54.  
  55.   This description has been made to answer a few questions about how
  56.   dial-up ISP (Internet Service Provider) subscribers may configure and
  57.   use Linux.
  58.  
  59.   To aid those who will connect their Linux based machines to an ISP for
  60.   the first time, an attempt has been made to cover most issues
  61.   encountered.  This quite unavoidably will create a certain degree of
  62.   overlap with other Linux Howto-documents and LDP books.  Reference
  63.   should be made to these documents to provide better understanding and
  64.   detail.
  65.  
  66.  
  67.   Much of the existing documentation is targeted towards users with a
  68.   certain degree of experience, and first time users will often have
  69.   trouble sorting out the relevant information.
  70.  
  71.   To simplify, the examples given will assume the following:
  72.  
  73.  
  74.  
  75.   ╖  User name: dirk
  76.  
  77.   ╖  Password: PrettySecret
  78.  
  79.   ╖  Internet service provider: acme.xz
  80.  
  81.   ╖  Email server: mail.acme.xz
  82.  
  83.   ╖  News server: news.acme.xz
  84.  
  85.   ╖  Name server: 193.212.1.0
  86.  
  87.   ╖  Phone number: 12345678
  88.  
  89.   Our dirk will be calling his machine roderick.
  90.  
  91.   All references in the table above should naturally be replaced by
  92.   whatever is valid for the ISP one is using.  Often, just a minimum of
  93.   changes will otherwise be required for users with different ISPs.  I
  94.   would like to be informed about what problems you encounter on this
  95.   account.
  96.  
  97.  
  98.   1.1.  Copyright
  99.  
  100.   Copyright (c) 1996,1997,1998 by Egil Kvaleberg. This document may be
  101.   distributed under the terms set forth in the LDP license at
  102.  
  103.   http://sunsite.unc.edu/LDP/COPYRIGHT.html
  104.  
  105.  
  106.   1.2.  Disclaimer
  107.  
  108.    No liability for the contents of this documents can be accepted.  Use
  109.   the concepts, examples and other content at your own risk.
  110.  
  111.   One of many possible setups will be described. In the Linux world,
  112.   there is usually a number of ways in which to accomplish things.
  113.   Paragraphs containing hints to alternatives are marked by ALT: Please
  114.   also note that FTP-references often will change slightly as new
  115.   versions of programs arrive.
  116.  
  117.   As far as I know, only programs that under certain terms may be used
  118.   or evaluated for personal purposes will be described. Most of the
  119.   programs will be available complete with source under GNU-like terms.
  120.  
  121.  
  122.   1.3.  Translations
  123.  
  124.   This document has been translated to the following languages:
  125.  
  126.   German, by Cristoph Seibert:
  127.  
  128.   http://tech.appl-opt.physik.uni-essen.de/LinuX/german-howto/DE-ISP-
  129.   Verbindung-HOWTO.html
  130.  
  131.   Korean, by Kidong Lee:
  132.  
  133.   http://www.postech.ac.kr/~cessi/howto/ISP-Hookup/ISP-Hookup-HOWTO.html
  134.  
  135.   French, by Eric Jacoboni:
  136.  
  137.   http://www.minet.net/linux/HOWTO-fr/ISP-Hookup-HOWTO.html
  138.  
  139.   Polish, by Piotr Pogorzelski: URL TBA
  140.  
  141.   Norwegian:
  142.  
  143.   http://www.kvaleberg.com/no-linux.html
  144.  
  145.  
  146.   1.4.  New versions of this document
  147.  
  148.   New versions of this document will be periodically posted to
  149.   comp.os.linux.answers.  They will also be added to the various
  150.   anonymous FTP sites who archive such information, including:
  151.  
  152.   ftp://sunsite.unc.edu/pub/Linux/docs/HOWTO
  153.  
  154.   In addition, you should generally be able to find this document on the
  155.   Linux Documentation Project page via:
  156.  
  157.   http://sunsite.unc.edu/LDP/
  158.  
  159.   The very latest version of this document should also be available in
  160.   various formats from:
  161.  
  162.   ftp://ftp.sol.no/user/egilk/ISP-Hookup-HOWTO.txt
  163.  
  164.   ftp://ftp.sol.no/user/egilk/ISP-Hookup-HOWTO.ps.gz
  165.  
  166.   ftp://ftp.sol.no/user/egilk/ISP-Hookup-HOWTO.tar.gz
  167.  
  168.   http://www.kvaleberg.com/ISP-Hookup-HOWTO.html
  169.  
  170.  
  171.   1.5.  Feedback
  172.  
  173.   All comments, error reports, additional information and criticism of
  174.   all sorts should be directed to:
  175.  
  176.   egil@kvaleberg.no
  177.  
  178.   http://www.kvaleberg.com/
  179.  
  180.  
  181.   2.  How do I connect to the rest of the world?
  182.  
  183.   It will be assumed that we have installed the essential networking
  184.   software modules from your Linux distribution, and that you have set
  185.   up which serial port that is to be used for the
  186.  
  187.   The default configuration will usually only allow direct access to
  188.   /dev/modem as user root.
  189.  
  190.   To connect to ISP shell accounts directly, and to experiment with
  191.   connection sequences, you may use the minicom program.  It is pretty
  192.   straight forward to use.
  193.  
  194.  
  195.   2.1.  The basic configuration
  196.  
  197.   Configuration of the machine for use on the net should be done as user
  198.   root.  Before proceeding any further, ensure that the file
  199.   /etc/hosts.deny contains the following line:
  200.  
  201.  
  202.        ALL: ALL
  203.  
  204.  
  205.  
  206.  
  207.   You would normally want to allow yourself, so add the following line
  208.   to /etc/hosts.allow:
  209.  
  210.  
  211.        ALL: LOCAL
  212.  
  213.  
  214.  
  215.  
  216.   Or if you insist:
  217.  
  218.  
  219.        ALL: 127.0.0.1
  220.  
  221.  
  222.  
  223.  
  224.   For the following, note that it is meant for those connected via PPP
  225.   and with a dynamic IP address. If you have the benefit of a fixed con¡
  226.   nection, there will be some differences.
  227.  
  228.   It is nice to have a name connected to the machine, a name that the
  229.   dynamic IP user really can select as he or she pleases.  Put the name
  230.   in /etc/HOSTNAME:
  231.  
  232.  
  233.        roderick
  234.  
  235.  
  236.  
  237.  
  238.   The next step is to set up the name server in
  239.  
  240.  
  241.        search .
  242.        nameserver 193.212.1.0
  243.        <nidx>nameserver
  244.  
  245.  
  246.  
  247.  
  248.   The name server must be specified by a numeric IP address, and will be
  249.   different from ISP to ISP. If required, you can have up to three dif¡
  250.   ferent servers, each on a separate line.  They will be requested in
  251.   the sequence in which they are listed.
  252.  
  253.   If you want to be able to use names like somemachine as an
  254.   abbreviation for somemachine.acme.xz, you must replace the first line
  255.   with:
  256.  
  257.  
  258.        search acme.xz
  259.  
  260.  
  261.  
  262.  
  263.  
  264.  
  265.   A certain minimum of configuration will also be required in be able to
  266.   manage with:
  267.  
  268.  
  269.        127.0.0.1       localhost
  270.        0.0.0.0         roderick
  271.  
  272.  
  273.  
  274.  
  275.   obviously replace 0.0.0.0 with that.
  276.  
  277.   Likewise, a minimum /etc/networks is:
  278.  
  279.  
  280.        loopback        127.0.0.0
  281.        localnet        0.0.0.0
  282.  
  283.  
  284.  
  285.  
  286.  
  287.   You should also set your external mail domain in
  288.  
  289.  
  290.        acme.xz
  291.  
  292.  
  293.  
  294.  
  295.   The username and password at the ISP must be specified in
  296.   /etc/ppp/pap-secrets
  297.  
  298.  
  299.        dirk * PrettySecret
  300.  
  301.  
  302.  
  303.  
  304.   For those ISPs using CHAP instead of PAP the filename is
  305.   /etc/ppp/chap-secrets.
  306.  
  307.   Finally, the nitty gritty regarding the connection procedure itself
  308.   must be specified before PPP can be initiated.  This is done in
  309.   /etc/ppp/chatscript:
  310.  
  311.  
  312.        TIMEOUT 5
  313.        "" ATZ
  314.        OK ATDT12345678
  315.        ABORT "NO CARRIER"
  316.        ABORT BUSY
  317.        ABORT "NO DIALTONE"
  318.        ABORT WAITING
  319.        TIMEOUT 45
  320.        CONNECT ""
  321.        TIMEOUT 5
  322.        "name:" ppp
  323.  
  324.  
  325.  
  326.  
  327.   Details here may have to be tuned somewhat.  The phone number in the
  328.   third line must of course be set as required.  Some users may need to
  329.   replace the ATZ modem initialization string with something more tai¡
  330.   lored for the modem being used.  The last line specifies that one is
  331.   expecting a prompt that ends with name:, and that the response should
  332.   be ppp when it arrives.  Other systems may have other login proce¡
  333.   dures.
  334.  
  335.   To actually initiate a call, the PPP protocol may be initiated by
  336.   issuing the following command:
  337.  
  338.  
  339.        exec pppd connect \
  340.             'chat -v -f /etc/ppp/chatscript' \
  341.              -detach crtscts modem defaultroute \
  342.              user dirk \
  343.              /dev/modem 38400
  344.  
  345.  
  346.  
  347.  
  348.   until the program is killed by typing a ctrl-C.  CAny messages con¡
  349.   cerning the connection will be appended to the system logs. To read
  350.   them, try:
  351.  
  352.  
  353.        tail /var/adm/messages
  354.  
  355.  
  356.  
  357.  
  358.  
  359.  
  360.        dmesg
  361.  
  362.  
  363.  
  364.  
  365.  
  366.   As long as PPP is up, you will have direct access to the Internet and
  367.   may use programs like ftp, ncftp, rlogin, telnet, finger etc.  All
  368.   these programs should be part of the network package.
  369.  
  370.   Further information concerning PPP is also available from:
  371.  
  372.   /usr/lib/ppp/README.linux
  373.  
  374.   /usr/lib/ppp/README.linux-chat
  375.  
  376.   Finally, an additional word about security The file all services that
  377.   your machine will offer externally. With the have made, no external
  378.   access will be allowed.  For those who need it, access must be allowed
  379.   explicitly in Local traffic may be allowed by:
  380.  
  381.  
  382.        ALL: LOCAL
  383.  
  384.  
  385.  
  386.  
  387.   See also man 5 hosts_access.
  388.  
  389.   A final minor issue: A certain confusion exists regarding the names of
  390.   the POP protocols. A definition in with just about everything is:
  391.  
  392.  
  393.        pop2            109/tcp         pop-2           # PostOffice V.2
  394.        pop3            110/tcp         pop-3 pop       # PostOffice V.3
  395.  
  396.  
  397.   ALT: Instead of chatscript, one might use the much more flexible
  398.  
  399.   ALT: Those fortunate enough to have a permanent TCP/IP connection via
  400.   e.g. an Ethernet may safely ignore anything about PPP and rather start
  401.   concentrating about setting up their network card.
  402.  
  403.   ALT: Others may not have the possibility of using PPP, but may be able
  404.   to use SLIP instead, for which there is support in much the same
  405.   manner as for PPP. Another possibility is UUCP Others again may have
  406.   to rely on exchange of news and email be means of SOUP A description
  407.   for the latter case may be found in:
  408.  
  409.   ftp://ftp.sol.no/user/bjorn/Linux-offline.tgz
  410.  
  411.   The TERM program is also an option. Refer to the Term-HOWTO.
  412.  
  413.  
  414.   3.  How do I surf ?
  415.  
  416.   If you think that text is the most important, you might want to use
  417.   the Lynx web browser. It is available from:
  418.  
  419.   ftp://sunsite.unc.edu/pub/Linux/system/Network/info-
  420.   systems/lynx-2.3.bin2.tar.gz
  421.  
  422.   If you have installed the X window system, you can also use one of the
  423.   many graphical browsers.  Chimera may be found at:
  424.  
  425.   ftp://sunsite.unc.edu/pub/Linux/system/Network/info-
  426.   systems/chimera-1.65.bin.ELF.tar.gz
  427.  
  428.   http://www.unlv.edu/chimera/
  429.  
  430.   Mosaic
  431.  
  432.   ftp://sunsite.unc.edu/pub/Linux/system/Network/info-
  433.   systems/Mosaic-2.7b1-aout.tgz
  434.  
  435.   ftp://ftp.NCSA.uiuc.edu/Web/Mosaic/Unix/binaries/2.6
  436.  
  437.   Netscape (aka.  Mozilla
  438.  
  439.   ftp://sunsite.unc.edu/pub/Linux/system/Network/info-systems/netscape-
  440.   v11b3.tar.gz
  441.  
  442.   ftp://ftp.cs.uit.no/pub/www/netscape
  443.  
  444.   These browsers are constantly available in new and in various ways
  445.   exciting versions.
  446.  
  447.   Use and evaluation of these programs is subject to certain terms.
  448.   Please observe them.
  449.  
  450.  
  451.   4.  How do I send and receiveemail
  452.  
  453.   First of all, ensure that sendmail is installed.  Sendmail sorts
  454.   internal and out-bound mail, and will buffer out-bound mail until such
  455.   time it is possible to forward it.
  456.  
  457.   Sendmail is based on a configuration found in example suitable for ISP
  458.   users can be found in:
  459.  
  460.   ftp://ftp.sol.no/user/egilk/sendmail.cf This is based on delivery
  461.   agent but may easily be changed to use
  462.  
  463.   It is if course required to have an official domain address for out-
  464.   bound mail, something which is specified in
  465.  
  466.  
  467.        # who I masquerade as (null for no masquerading)
  468.        DMacme.xz
  469.  
  470.  
  471.  
  472.  
  473.   have the same user name locally as you have at your ISP. If it is dif¡
  474.   ferent, just specify the full name instead:
  475.  
  476.  
  477.        DMdick@acme.xz
  478.  
  479.  
  480.  
  481.  
  482.   Sendmail is now configured for sending directly to the recipient.  To
  483.   avoid long and repeated connections in those cases where the connec¡
  484.   tion to the receiving end is slow and irregular, is is usually nice to
  485.   use ones ISP as a buffer store.  This can be specified by the DS spec¡
  486.   ification:
  487.  
  488.  
  489.        # "Smart" relay host (may be null)
  490.        DSmail.acme.xz
  491.  
  492.  
  493.  
  494.  
  495.   Beware that sendmail is somewhat sensitive to handling of tab stop
  496.   characters in sendmail.cf.  You might want to use the characters are
  497.   retained unchanged.
  498.  
  499.   Email reception can often be performed via the POP3 protocol, which
  500.   can be initiated every time the connection is brought up.  A script
  501.   for testing this is:
  502.  
  503.  
  504.        sendmail -q
  505.        popclient -3 -v mail.acme.xz -u dirk -p "PrettySecret" \
  506.               -k -o /usr/spool/mail/dirk
  507.  
  508.  
  509.  
  510.  
  511.   connection has been established.  Beware that this script is just for
  512.   testing, so ensure that the local mailbox is left untouched while it
  513.   runs.  The -k option means that the mail is kept in the ISP mailbox,
  514.   and you are simply given a copy of the mail.  You would of course want
  515.   to remove this option once you are confident that your setup is work¡
  516.   ing.
  517.  
  518.   Beware that the password will show on the command line.  Also note
  519.   that popclient is getting old fashioned, and that you should consider
  520.   using instead.
  521.  
  522.   A more secure and better version of this script may be found at:
  523.  
  524.   ftp://ftp.sol.no/user/egilk/pop-script.tar.gz
  525.  
  526.   This version of the script requires that procmail is installed, but
  527.   that is something you'll never regret anyway. Most distributions
  528.   include it, otherwise you may try:
  529.   ftp://sunsite.unc.edu/pub/Linux/system/Mail/mailhandlers/procmail-3.10-2.tar.gz
  530.  
  531.   Procmail is a simple and flexible tool that can sort incoming email
  532.   based on a large range of criteria. In addition to being able to
  533.   handle automated tasks like vacation messages and such.
  534.  
  535.   Note that when we use procmail directly as in this case, the situation
  536.   is somewhat different from what is described in the procmail
  537.   documentation.  A .forward is not required, and we also don't need a
  538.   .procmailrc.  The latter is only required if we want to sort the mail.
  539.  
  540.   The user interface for reading and sending of email can be found in
  541.   programs like
  542.  
  543.   ALT: Fetchmail has recently become an improved alternative to
  544.   popclient.  The latest version is available from:
  545.  
  546.   ftp://ftp.ccil.org/pub/esr/fetchmail/fetchmail-3.3.tar.gz
  547.  
  548.   ALT: For an ordinary dial-up ISP user it is not really necessary to
  549.   have the sendmail daemon active.  To reduce resource usage, and
  550.   possibly other problems, one may thus comment out any startup of
  551.   sendmail, as is usually found in /etc/rc.d/rc.M (this varies from
  552.   distribution to distribution).
  553.  
  554.   ALT: In place of sendmail one might use the simpler description of it
  555.   (as well as most other things mentioned here) in the Linux Network
  556.   Administrator's Guide.
  557.  
  558.   ALT: There is also an m4 macro package for making a fresh
  559.   /etc/sendmail.cf.  For a simple installation it might be just as well
  560.   to modify an existing configuration.
  561.  
  562.   ALT: There are also simpler although less flexible alternatives for
  563.   handling email.  Pine may run stand-alone as long as it is configured
  564.   properly, for instance.  It might even be possible to use newer
  565.   versions of some web-browsers.
  566.  
  567.   ALT: Many are very enthusiastic regarding the Emacs companion Gnus as
  568.   an email and news handler. Further information can be found at:
  569.  
  570.   http://www.ifi.uio.no/~larsi/
  571.  
  572.   ALT: An alternative to popclient is pop-perl5.  It is available from:
  573.  
  574.   ftp://sunsite.unc.edu/pub/Linux/System/Mail/pop-perl5-1.1.tar.gz
  575.  
  576.  
  577.   5.  News
  578.  
  579.   5.1.  How do I set up an online news-reader?
  580.  
  581.   possible to read news online.  There are lots of available programs,
  582.   two simple alternatives being trn.
  583.  
  584.   To start reading news, the only thing required in terms of
  585.   configuration in most cases is to set NNTPSERVER (usually once and for
  586.   all in the file .profile):
  587.  
  588.  
  589.        export NNTPSERVER=news.acme.xz
  590.  
  591.  
  592.  
  593.  
  594.  
  595.   To get the From-address correct in postings, some programs may
  596.   require:
  597.  
  598.  
  599.        export NNTP_INEWS_DOMAIN=acme.xz
  600.  
  601.  
  602.  
  603.  
  604.  
  605.  
  606.   5.2.  How do I set up an offline news-reader?
  607.  
  608.   offline and thus reduce phone bills and give greater flexibility, one
  609.   must set up a local news-spool of one sort or the other.  This
  610.   requires some configuration, and there will also be a certain amount
  611.   of disk space involved.  After initial setup, things should run more
  612.   or less by themselves, with only some attention needed from time to
  613.   time.
  614.  
  615.   Two different solutions will be described here.
  616.  
  617.  
  618.   5.3.  How do I set up C News?
  619.  
  620.   The solution described here is based on the news-server C News and the
  621.   NNTP protocol.  C News was originally targeted towards another sort of
  622.   configuration, but is flexible enough to handle our situation too.
  623.   One might also use the more recent INN news server but it might
  624.   require a bit more in terms of resources. Either way, be careful not
  625.   to install both; they don't live together easily.
  626.  
  627.   It is crucial that all maintenance of news is done while logged in as
  628.   user news, and that all configuration files is placed in
  629.   /usr/lib/news.  One way of handling this is, while logged in as root
  630.   to write su news; cd.
  631.  
  632.   The most important files in the configuration are:
  633.  
  634.  
  635.  
  636.   ╖   over active newsgroups.  It is updated as required by the command
  637.      comp.os.linux.networking y.
  638.  
  639.   ╖   simply contain whatever you want in the Organization: header
  640.      field, in our case:
  641.  
  642.  
  643.  
  644.        Dirk Gently's Holistic Detective Agency
  645.  
  646.  
  647.  
  648.  
  649.  
  650.  
  651.   ╖   case be set to acme.xz.
  652.  
  653.   ╖   of your site in the Path: thread.  In a setup as described here,
  654.      using newsx, this name will never leave the machine, so you can set
  655.      this to whatever you like as long as you are pretty sure it is
  656.      unique. In this case roderick.
  657.  
  658.   ╖  The file fetching and further distribution of news.  We will assume
  659.      the ISP in our case adds acme.xz to the Path, and that this is the
  660.      only news source we have.  The example given really tells that we
  661.      will accept everything that arrives, and that we will only post
  662.      news to acme.xz that it hasn't seen before, and is originally
  663.      posted at our own site.  In this simplified setup we assume that
  664.      the all groups will come from a single source.  /all specifies the
  665.      distribution, and must be included.  The letter F says that
  666.      (pointers to) outgoing news articles will be collected in a file.
  667.  
  668.  
  669.  
  670.        ME:all/all::
  671.        acme/acme.xz:all,!junk/all:FL:
  672.  
  673.  
  674.  
  675.  
  676.  
  677.  
  678.   ╖  A subdirectory for the outgoing news must be created, in our case:
  679.  
  680.  
  681.  
  682.        mkdir /var/spool/news/out.going/acme
  683.  
  684.  
  685.  
  686.  
  687.  
  688.  
  689.   ╖   posting in moderated groups, although this task may usually be
  690.      left to the ISP.
  691.  
  692.   C News needs a certain degree of daily maintenance, but this can be
  693.   specified once and for all via the command crontab -e setup follows;
  694.   it can be tuned as required:
  695.  
  696.  
  697.        # maintain incoming and outgoing batches
  698.        10,40 *  * * * /usr/lib/newsbin/input/newsrun
  699.  
  700.        # expire C News, once a day
  701.        30 0  * * * /usr/lib/newsbin/expire/doexpire
  702.  
  703.        # monitor and report if needed
  704.        00 2  * * sat /usr/lib/newsbin/maint/addmissing
  705.        40 3  * * * /usr/lib/newsbin/maint/newswatch
  706.        50 3  * * * /usr/lib/newsbin/maint/newsdaily
  707.  
  708.  
  709.  
  710.  
  711.   out (twice every hour), doexpire will delete articles as they get old
  712.   (every night at 00:30), and the three last commands does various
  713.   supervisory and error correcting tasks.
  714.  
  715.   One should also ensure that things are cleaned up when starting the
  716.   machine. As user root, add the following line to /etc/rc.d/rc.local:
  717.  
  718.  
  719.        su news -c /usr/lib/newsbin/maint/newsboot
  720.  
  721.  
  722.  
  723.  
  724.   News may be collected via the program NewsX, The program can be found
  725.   at:
  726.  
  727.   ftp://sunsite.unc.edu/pub/Linux/system/news/transport/newsx-0.9.tar.gz
  728.   Or:
  729.  
  730.   ftp://ftp.sol.no/user/egilk/newsx-0.9.tar.gz
  731.  
  732.   Setting up NewsX is quite simple.  Installation is a classic case of:
  733.  
  734.  
  735.        make
  736.        su
  737.        make install
  738.        exit
  739.  
  740.  
  741.  
  742.  
  743.   With the setup outlined here, all you have to do is to create the
  744.   groups you want to read using the addgroup command.
  745.  
  746.   To fetch articles, user news issues the following commands (assuming
  747.   communication via PPP or similar is up):
  748.  
  749.  
  750.        newsrun
  751.        newsx acme news.acme.xz
  752.        newsrun
  753.  
  754.  
  755.  
  756.  
  757.  
  758.   The option -d gives continuous printout to the screen.  Refer to the
  759.   NewsX documentation for further information.
  760.  
  761.   NewsX will also take care of posting of outgoing news.
  762.  
  763.   To control disposal of articles as they get old, a file explist is
  764.   required.  The comments in this example should explain what we want to
  765.   do:
  766.  
  767.  
  768.        # hold onto history lines 14 days, nobody gets >120 days
  769.        /expired/                       x       14      -
  770.        /bounds/                        x       0-1-120 -
  771.  
  772.        # retain these for 2 months
  773.        comp.sources,comp.os.linux.all  x       60      -
  774.  
  775.        # noise gets thrown away fast
  776.        junk,control                    x       2       -
  777.  
  778.        # default:  14 days, no archive
  779.        all                             x       14      -
  780.  
  781.  
  782.  
  783.  
  784.   ALT: In a small news-spool, one will usually not need the newsgroup
  785.   control.  The traffic is huge compared to the possible usefulness. The
  786.   main point is that articles will be canceled, and that groups may be
  787.   created automatically. To ensure that control messages containing
  788.   newgroup not shall mess up things for us, a file called what we will
  789.   allow:
  790.  
  791.  
  792.  
  793.   comp.os.linux   tale@uunet.com  yv
  794.   all             any             nq
  795.  
  796.  
  797.  
  798.  
  799.   In this example, all proper groups under comp.os.linux will be created
  800.   (y), and the user news will be notified (v).  Everything else will be
  801.   silently (q) ignored (n).  The last line is sufficient if you want to
  802.   create all groups manually.
  803.  
  804.   ALT: An alternative to NewsX is suck.
  805.  
  806.  
  807.   5.4.  How do I set up Leafnode?
  808.  
  809.   A different solution altogether is to install the integrated package
  810.   handle all tasks required for a personal news spool, and is easy to
  811.   configure.  It is available via:
  812.  
  813.   http://www.troll.no/freebies/leafnode.html
  814.  
  815.   As for C News, all news maintenance really should be performed as user
  816.   news.
  817.  
  818.   The home directory for leafnode is in /usr/lib/leafnode.  To install,
  819.   write:
  820.  
  821.  
  822.        cd /usr/lib/leafnode
  823.        tar -xzvf leafnode-0.8.tgz
  824.        cd leafnode-0.8
  825.        make
  826.        su
  827.        make install
  828.  
  829.  
  830.  
  831.  
  832.   Note in the following that the prefix /usr/local/sbin should be
  833.   replaced with /usr/sbin if you installed leafnode from a package.
  834.  
  835.   While still being logged in as root, change the line that controls
  836.   NNTP in /etc/inetd.conf:
  837.  
  838.  
  839.        nntp  stream  tcp  nowait  news  /usr/sbin/tcpd /usr/local/sbin/leafnode
  840.  
  841.  
  842.  
  843.  
  844.   Activate it by:
  845.  
  846.  
  847.        killall -HUP inetd
  848.  
  849.  
  850.  
  851.  
  852.   Return to user news by writing exit.  In /usr/lib/leafnode/config
  853.   change the line that defines the NNTP server. In our case:
  854.  
  855.  
  856.        server = news.acme.xz
  857.  
  858.  
  859.   Leafnode will look after itself by adding the following command via
  860.   crontab -e as user news:
  861.  
  862.  
  863.        # expire Leafnode, once a day
  864.        0 4 * * * /usr/local/sbin/texpire
  865.  
  866.  
  867.  
  868.  
  869.  
  870.   News exchange is also done as user news by the following command
  871.   (assuming PPP is up and running):
  872.  
  873.  
  874.        /usr/local/sbin/fetch
  875.  
  876.  
  877.  
  878.  
  879.  
  880.   Users who wants to read news should then use the recipe in How do I
  881.   set up an online news-reader?, except that they configure for the
  882.   local machine, i.e:
  883.  
  884.  
  885.        export NNTPSERVER=localhost
  886.  
  887.  
  888.  
  889.  
  890.   That should be all there is to it.  The first fetch will transfer a
  891.   list of available newsgroups.  Leafnode will then monitor what groups
  892.   the users are requesting, and adapt to this the next time it is
  893.   activated.
  894.  
  895.   Note that leafnode does not seems to work in cases where NNTP
  896.   authorization is required.  +.LP
  897.  
  898.   ALT: An alternative to leafnode is nntpcache, available from:
  899.  
  900.   ftp://ftp.suburbia.net/pub/nntpcache/nntpcache.tgz ALT: Another
  901.   alternative is to use the newsreader pullslrn-pull package. The
  902.   newsreader must be compiled with the spool feature set.
  903.  
  904.  
  905.   6.  How do I automate the connection procedure?
  906.  
  907.   Automated handling of news and email is quite easy to implement in
  908.   Linux.
  909.  
  910.   First and foremost one should make a that initiates the ISP
  911.   connection.  Often, this file will simply contain the following:
  912.  
  913.  
  914.        /usr/sbin/pppd
  915.  
  916.  
  917.  
  918.  
  919.  
  920.  
  921.  
  922.  
  923.  
  924.  
  925.   connect "/usr/lib/ppp/chat -v -f /etc/ppp/chatscript"
  926.   crtscts
  927.   modem
  928.   defaultroute
  929.   asyncmap 00000000
  930.   user dirk
  931.   /dev/modem 38400
  932.  
  933.  
  934.  
  935.  
  936.   To end a connection, use the supplied version of /usr/lib/ppp/ppp-off.
  937.  
  938.   Having tested the functionality of these two scripts, one must then
  939.   write scripts that perform the various tasks. The script to collect
  940.   email has been described before, and we will here assume it is located
  941.   at /home/dirk/pop.
  942.  
  943.   A script for exchange of email can then be produced in /root/mail:
  944.  
  945.  
  946.        #! /bin/sh
  947.        #
  948.        # exchange mail
  949.        # 10 minutes timeout:
  950.        TIMEOUT=600
  951.        DT=10
  952.  
  953.        # kick sendmail:
  954.        sendmail -q &
  955.  
  956.        # retrieve mail:
  957.        su dirk -c /home/dirk/pop
  958.  
  959.        # wait for sendmail to terminate:
  960.        t=0
  961.        while ! mailq | grep -q "Mail queue is empty"; do
  962.            t=$[$t+$DT]
  963.            if [ $t -gt $TIMEOUT ] ; then
  964.             echo "sendmail -q timeout ($TIMEOUT).."
  965.             exit 1
  966.            fi
  967.            sleep $DT
  968.        done
  969.  
  970.        exit 0
  971.  
  972.  
  973.  
  974.  
  975.   The script to exchange news may be placed in /usr/lib/news/news:
  976.  
  977.  
  978.  
  979.  
  980.  
  981.  
  982.  
  983.  
  984.  
  985.  
  986.  
  987.  
  988.  
  989.  
  990.  
  991.   #!/bin/sh
  992.   #
  993.   # exchange news
  994.   # must be run as news:
  995.   cd /usr/lib/news
  996.  
  997.   #update the outgoing batch (C News):
  998.   /usr/lib/newsbin/input/newsrun < /dev/null
  999.  
  1000.   #exchange news:
  1001.   /usr/lib/newsbin/newsx acme news.acme.xz
  1002.  
  1003.   #and flush the incoming batch:
  1004.   /usr/lib/newsbin/input/newsrun < /dev/null
  1005.  
  1006.  
  1007.  
  1008.  
  1009.   A script to connect the various bits and pieces remains, and can be
  1010.   placed in /root/news+mail:
  1011.  
  1012.  
  1013.        #!/bin/sh
  1014.        #
  1015.        # exchange news and email
  1016.        # must be run as root
  1017.        #
  1018.        if ! /usr/lib/ppp/ppp-on; then
  1019.            exit 1
  1020.        fi
  1021.        trap "/usr/lib/ppp/ppp-off" 1 2 3 15
  1022.  
  1023.        #exchange news+mail:
  1024.        /root/mail &
  1025.        su news -c ~news/news
  1026.        wait
  1027.  
  1028.        #disconnect..
  1029.        /usr/lib/ppp/ppp-off
  1030.  
  1031.        #update the incoming batch (C News):
  1032.        su news -c /usr/lib/newsbin/input/newsrun < /dev/null &
  1033.  
  1034.        exit 0
  1035.  
  1036.  
  1037.  
  1038.  
  1039.   It is quite easy to make an extension to the above that only will
  1040.   establish a connection if outgoing email and news is present.  Lets
  1041.   call it /root/news+mail.cond, and keep in mind that the name of the
  1042.   outgoing news-spool must be updated to suit:
  1043.  
  1044.  
  1045.        #!/bin/sh
  1046.        #
  1047.        # exchange news and email, only if outgoing news or mail
  1048.        # (C News spool)
  1049.        if [ -s /var/spool/news/out.going/acme/togo ] ||
  1050.            ! ( mailq | grep -q "Mail queue is empty"); then
  1051.             /root/news+mail
  1052.        fi
  1053.  
  1054.  
  1055.  
  1056.  
  1057.   The only thing remaining is to specify when all this is going to
  1058.   happen.  This is done using the command crontab -e to exchange news
  1059.   and mail at 07:00 in the morning, and after that every 4th hour
  1060.   assuming there are outgoing email and news:
  1061.  
  1062.  
  1063.        00 7            * * *   /root/news+mail
  1064.        00 11,15,19,23  * * *   /root/news+mail.cond
  1065.  
  1066.  
  1067.  
  1068.  
  1069.   Ensure that every component is tested well before you connect them
  1070.   together. One may later add several other tasks, such as adjustment of
  1071.   the time of day (using ntpdate), and automatic update (mirroring) of
  1072.   locally maintained WWW and FTP files up to the ISP (using make and
  1073.   ftp).
  1074.  
  1075.   ALT: Depending on ones preferences, it is also possible to turn the
  1076.   process upside down. Every time a PPP link is initiated, the script
  1077.   /etc/ppp/ip-up will be started.  One may here add whatever magic is
  1078.   required to start exchange of email and news.  See man pppd for
  1079.   further detail.
  1080.  
  1081.   ALT: It is also possible to automatically connect PPP whenever network
  1082.   traffic is detected.  This is in many ways the more elegant solution,
  1083.   but it is quite dependent on a good configuration to avoid frequent
  1084.   (and costly) connections being made.  More information can be found
  1085.   at:
  1086.  
  1087.   http://www.dna.lth.se/~erics/diald.html
  1088.  
  1089.   The diald utility is available from:
  1090.  
  1091.   ftp://sunsite.unc.edu/pub/Linux/system/network/serial/diald-0.16.tar.gz
  1092.  
  1093.   At the same location one will also find other variations on the theme
  1094.   PPP connections.
  1095.  
  1096.  
  1097.   7.  Final words
  1098.  
  1099.   7.1.  Other things I should know about?
  1100.  
  1101.  
  1102.  
  1103.   ╖  Various error messages in the system will normally be issued as
  1104.      internal email. To ensure that these will actually be read, one
  1105.      should create an /etc/aliases.  Remember the command newaliases
  1106.      every time you change this.  An example that should cover most
  1107.      eventualities is:
  1108.  
  1109.  
  1110.  
  1111.        PostMaster: root
  1112.        ftp: root
  1113.        news: root
  1114.        usenet: root
  1115.        FaxMaster: root
  1116.        fax: root
  1117.        WebMaster: root
  1118.        MAILER.DAEMON: root
  1119.  
  1120.  
  1121.  
  1122.  
  1123.   ╖  Many programs for Linux may be found at Sunsite, many mirrors and
  1124.      every time there is a reference to
  1125.      ftp://sunsite.unc.edu/pub/Linux/.. one should try to use a mirror
  1126.      close to home, e.g.  ftp://ftp.nvg.unit.no/pub/linux/sunsite/...
  1127.  
  1128.   ╖  If you happen to be migrating from Yarn it should be possible to
  1129.      convert these to standard folders using the yarn2mf available at:
  1130.  
  1131.   ftp://ftp.sol.no/user/egilk/yarn2mf.zip
  1132.  
  1133.  
  1134.   8.  ISP specific information
  1135.  
  1136.   More specific information for certain ISPs is available from a variety
  1137.   of sources:
  1138.  
  1139.   Demon Internet
  1140.  
  1141.   ftp://ftp.demon.co.uk/pub/unix/linux/Demon/slack3.0.help.tgz
  1142.  
  1143.   Netcom
  1144.  
  1145.   http://www.netcom.com/bin/webtech/NetCruiser/Operating_Systems/Linux/linux.cfg.html
  1146.  
  1147.   PowerTech, Telenor Online, Telia
  1148.  
  1149.   http://www.kvaleberg.com/no-isp.html
  1150.  
  1151.   Stanford
  1152.  
  1153.   http://www-leland.stanford.edu/~wkn/Linux/network/network.html
  1154.  
  1155.   MCI
  1156.  
  1157.   http://www.kvaleberg.com/linux-mci.html
  1158.  
  1159.   SISCOM
  1160.  
  1161.   http://www.siscom.net/support/linux_setup.htm
  1162.  
  1163.   AOL is not possible since AOL uses a proprietary protocol.
  1164.  
  1165.   If you can supply ISP specific information not listed here, please get
  1166.   in touch.
  1167.  
  1168.  
  1169.   8.1.  How do I learn more?
  1170.  
  1171.   The Linux Documentation Project book called Linux Network
  1172.   Administrator's Guide by Olaf Kirch is pretty mandatory for anyone
  1173.   that will set up and maintain anything involving TCP/IP and Internet
  1174.  
  1175.   ftp://sunsite.unc.edu/pub/Linux/docs/linux-doc-project/network-
  1176.   guide/nag-1.0.ascii.tar.gz
  1177.  
  1178.   The documentation that follows each software package will normally
  1179.   give you all the detailed information you need, if not always the
  1180.   overview. The man-pages will be the first place to look. Try for
  1181.   instance:
  1182.  
  1183.  
  1184.        man pppd
  1185.  
  1186.  
  1187.  
  1188.  
  1189.   You will also find some documentation about certain programs in the
  1190.   this is not always well structured.
  1191.  
  1192.   The following HOWTOs will be highly relevant:
  1193.  
  1194.  
  1195.  
  1196.   ╖  Installation-HOWTO will get the basics sorted.
  1197.  
  1198.   ╖  NET-2-HOWTO is a very thorough description of installation and
  1199.      setup of the NET code.  Much of this should already have been done
  1200.      if you use a standard Linux distribution (e.g. Slackware, Red Hat,
  1201.      Debian).  But many sections on setup and troubleshooting will be
  1202.      very worthwhile.
  1203.  
  1204.   ╖  Mail-HOWTO explains how to configure various tools.  Again, much of
  1205.      this will already have been done for you when you install a
  1206.      standard Linux distribution.
  1207.  
  1208.   ╖  News-HOWTO is for setting up a (conventional) news spool.
  1209.  
  1210.   ╖  Tiny-News covers yet another alternative for collecting news.
  1211.  
  1212.   ╖  PPP-HOWTO is a good description of problems you may encounter when
  1213.      setting up a PPP connection.
  1214.  
  1215.   ╖  Serial-HOWTO contains everything you need to know about setting up
  1216.      serial ports.
  1217.  
  1218.   ╖  Mail-Queue tells you how to send up sendmail to always queue remote
  1219.      mail but deliver local mail at once.
  1220.  
  1221.   Red Hat has a mailing list for PPP issues; to join send an email to
  1222.  
  1223.   redhat-ppp-list-request with the subject line
  1224.  
  1225.  
  1226.        subscribe
  1227.  
  1228.  
  1229.  
  1230.  
  1231.  
  1232.   8.2.  Thanks to
  1233.  
  1234.   Information here is collected from many sources. Thanks to the
  1235.   following that either indirectly or directly have contributed:
  1236.  
  1237.  
  1238.  
  1239.  
  1240.  
  1241.  
  1242.  
  1243.  
  1244.  
  1245.  
  1246.  
  1247.  
  1248.  
  1249.  
  1250.  
  1251.  
  1252.  
  1253.  
  1254.  
  1255.   Adam Holt <holt@graphics.lcs.mit.edu>
  1256.   Arne Coucheron <arneco@oslonett.no>
  1257.   Arne Riiber <riiber@oslonett.no>
  1258.   Arnt Gulbrandsen <agulbra@troll.no>
  1259.   Bjorn Steensrud <bjornst@powertech.no>
  1260.   Gisle Hannemyr <gisle@a.sn.no>
  1261.   Hans Amund Rosbach <haro@sesam.dnv.no>
  1262.   Hans Peter Verne <hpv@ulrik.uio.no>
  1263.   Harald T Alvestrand <Harald.T.Alvestrand@uninett.no>
  1264.   Harald Terkelsen  <Harald.Terkelsen@adm.hioslo.no>
  1265.   Haavard Engum <hobbes@interlink.no>
  1266.   James Youngman <JYoungman@vggas.com>
  1267.   Johan S. Seland <johanss@sn.no>
  1268.   John Phillips <john@linux.demon.co.uk>
  1269.   Jorn Lokoy <jorn@oslonett.no>
  1270.   Kenneth Tjostheim <kenneth.tjostheim@asplanviak.no>
  1271.   Kjell M. Myksvoll <kjell.myksvoll@fou.telenor.no>
  1272.   Kjetil T. Homme <kjetilho@math.uio.no>
  1273.   Michael Meissner <meissner@cygnus.com>
  1274.   N J Bailey <N.J.Bailey@leeds.ac.uk>
  1275.   Nicolai Langfeldt <janl@math.uio.no>
  1276.   Ove Ruben R Olsen <Ove.R.Olsen@ub.uib.no>
  1277.   R. Bardarson <ronb@powernet.net>
  1278.   Steinar Fremme <steinar@fremme.no>
  1279.   Sverre H. Huseby <sverrehu@ifi.uio.no>
  1280.   Trond Eivind Glomsrod <teg@stud.imf.unit.no>
  1281.   Tommy Larsen <tommy@mix.hive.no>
  1282.   Yves Bellefeuille <yan@storm.ca>
  1283.  
  1284.  
  1285.  
  1286.  
  1287.  
  1288.  
  1289.  
  1290.  
  1291.  
  1292.  
  1293.  
  1294.  
  1295.  
  1296.  
  1297.  
  1298.  
  1299.  
  1300.  
  1301.  
  1302.  
  1303.  
  1304.  
  1305.  
  1306.  
  1307.  
  1308.  
  1309.  
  1310.  
  1311.  
  1312.  
  1313.  
  1314.  
  1315.  
  1316.  
  1317.  
  1318.  
  1319.  
  1320.  
  1321.