Appendix A: Downloading Software From the Internet (From a Text Terminal)


Overview

The File Transfer Protocol (FTP) is used, like the HyperText Transfer Protocol (HTTP), to move data over the Internet. FTP, however, was designed specifically to transfer large files undamaged over a network.

You can use FTP from a text terminal with the ncftp utility. This utility makes downloading easier by doing the following:

  • It automatically logs on to FTP servers anonymously.

  • It automatically attempts to reconnect to FTP servers when they refuse your login request when too many users are already logged in to the server.

  • It works through firewalls (it supports passive FTP).

If you purchased the Red Hat CD-ROM, you can install the ncftp program by inserting the CD-ROM and typing:

 #mount /mnt/cdrom #rpm -ivh /mnt/cdrom/RedHat/RPMS/ncftp* 

Once the line of hash marks (#) goes by, you should be able to type:

 #/usr/bin/ncftp 

This will start the ncftp utility and provide you with the ncftp> prompt where you can type help for the list of commands ncftp understands.

If you don't have a CD-ROM with the ncftp utility, you can download it using the ftp utility.

Next, you need to find the FTP server with the files you need. When you are looking for Red Hat's RPM files, you should look at Red Hat's FTP site, one of the Red Hat mirror sites, or http://www.rpmfind.net. (Also see Appendix D for a description of the Yum package.) For the latest version of a package like Apache, however, you may want to go directly to their FTP server. Here are a few examples:

Red Hat's FTP site

ftp.redhat.com

Apache's FTP site

ftp.apache.org

You can open a connection to the FTP server running at one of these addresses and log in using the anonymous account (this is what your web browser does for you when you use ftp:// instead of http:// in the Address field of the browser).

At the ncftp prompt, type:

 ncftp>open ftp.redhat.com 

Or at the Linux shell prompt, you could have typed:

 #ncftp ftp.apache.org 

You should see a banner message indicating a successful connection to an FTP server and eventually the Logged in to ftp.apache.org message.

From here, you will normally use the simple cd (change directory) and get commands to locate and download a file. To first position your local ftp client program in the proper directory where you would like the files downloaded, you can use the lcd (which means local change directory) command:

 ncftp> lcd /usr/local/src 

(This tells the ftp program that you would like files retrieved with the get command to be loaded locally into the /usr/local/src directory on your computer.)

To check which directory you are in, type:

 ncftp> lcd . 

Note 

There is a space between the lcd and the period.

Now you need to look on the remote FTP server to locate the file you are interested in downloading. This is usually somewhere underneath a directory called /pub (for public), so if you are not sure, you can start by changing to this directory and listing files:

 ncftp>cd /pub 

Note 

This changes to the /pub directory on the FTP server.

 ncftp>ls 

Once you find the file you want to download, you should tell the ncftp program if it contains binary data or ASCII (plaintext) before issuing the get command:

 ncftp>bin 

(If you download a file with a .zip, .gzip, .tar, or .Z extension, you should use binary.)

Then tell the ftp program to begin downloading the file to your local hard drive with the command:

 ncftp>get apache.x.x.tar.Z 

You should now see a display indicating that the file is downloading to your local hard drive.

Quit out of the ncftp program by typing exit.

 ncftp>exit 

Skip now to the discussion later in this appendix, "What to Do with the File You Downloaded."



The Linux Enterprise Cluster. Build a Highly Available Cluster with Commodity Hardware and Free Software
Linux Enterprise Cluster: Build a Highly Available Cluster with Commodity Hardware and Free Software
ISBN: 1593270364
EAN: 2147483647
Year: 2003
Pages: 219
Authors: Karl Kopper

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net