Certification Objective 2.04-Configuring a Network Installation


Most Linux users can install RHEL from a CD/DVD. During the installation portion of the Red Hat exam, you'll save time by installing RHEL over a network from an NFS, HTTP, or FTP server. As you'll want to practice with network installations, you should set up a network server. For completeness, while it's not a "network installation" per se, you can also install RHEL from ISO images on a local hard disk.

On the Job 

SELinux is an excellent system that provides a different level of security for Linux. In this book, I describe many ways that you can work with SELinux enabled. However, users do report trouble making SELinux work with Linux and services such as NFS, HTTP, and FTP. While SELinux has just been included in the Red Hat Exam Prep guide, the exams don't test how you've configured a network installation server. So, if necessary, disable SELinux for a specific service, or disable it completely with the Security Level Configuration tool described in Chapter 15.

Configuring a Network Installation Server

Once you have the Red Hat installation media, configuring a network installation server is a fairly easy process. All you need to do is copy the files from each CD to a common directory, configure sharing on the directory, and then activate the NFS, FTP, or HTTP network. Naturally, if you've downloaded a rebuild installation DVD, the process is simpler.

Before you set up a network installation source, you'll need a partition with at least 2.7GB of free space (3.5 if you're installing the RHEL 5 Client, appropriate for the RHCT exam). I'll illustrate the process for an NFS server and explain the variations for FTP and HTTP servers.

Creating an NFS Installation Server

In the following steps, you'll learn how to create a shared directory, copy the Red Hat installation files, and then set up the share through NFS. As NFS is the most efficient way to share files between Linux and Unix computers, I suspect it's the most likely option for network installations during the exam. You'll need the Red Hat Enterprise Linux installation CDs, or at least the ISO files associated with those CDs.

  1. Create a directory for your installation files. With the following command, create the /inst directory:

     # mkdir /inst 

  2. Insert the first Red Hat Enterprise Linux installation CD/DVD into its drive. If you're running the default GNOME desktop, it'll get mounted automatically, using the name of the media; for example, my first RHEL installation CD is automounted in the /media/RHEL-5 i386 Disc 1 directory (including all of those spaces). Otherwise, you can mount the CD with a command such as mount /dev/cdrom /media. (If all you have are the ISO files, say in the /tmp directory, substitute mount -ro loop /tmp/firstcd.iso /media.)

  3. Copy the required files from the first Red Hat Enterprise Linux installation CD. Use the cp -ar /source/. /inst command, where source is the mount directory (such as /media/RHEL 5 i386 Disc 1). Don't forget the dot (.); it copies hidden files, including the .discinfo file from the first Red Hat Enterprise Linux installation CD.

  4. Unmount the first Red Hat Enterprise Linux installation CD. If it's an installation DVD, skip to step 6. Use the umount /source command.

  5. Repeat steps 2, 3, and 4 with the remaining Red Hat Enterprise Linux installation CDs.

  6. Set up an NFS share. Add the following line to /etc/exports. You can do it with a text editor such as vi or the system-config-nfs utility (also known as the NFS Server Configuration tool) described in Chapter 10.

     /inst       *(ro,sync) 

  7. Export the shared directory.

     # exportfs -a 

  8. Make sure there's nothing blocking access to NFS. The default Red Hat Enterprise Linux firewall blocks access to an NFS server. While inelegant, the following command "flushes," or turns off, the standard Linux firewall from the local computer. If you've enabled SELinux, you'll also have to use the SELinux Management Tool to change the associated NFS boolean variable to "Allow the reading on any NFS file system". Don't forget to restart NFS to activate all of your changes. I'll describe the iptables command and the SELinux Management Tool in more detail in Chapter 15.

    On the Job 

    As of this writing, if SELinux is disabled, RHEL 5 won't let you open the SELinux Management Tool. For the latest information, see bug 232544 at http://bugzilla.redhat.com.

     # iptables -F 

  9. Now you can activate the NFS service. The following commands assume that it's already running (which you can check using the service nfs status command):

     # service nfs stop # service nfs start 

  10. Finally, you can check the status of your share. If it's working, you should see the contents of the /etc/exports directory when you run the following command:

     # showmount -e 

When you install Red Hat Enterprise Linux from an NFS server, you'll need the name of the installation directory-in this case, /inst.

On the Job 

For an NFS connection, you don't need to copy the files from a CD. If you've downloaded ISOs of the RHEL (or rebuild) installation DVD/CDs, all you need to do is copy them to the shared NFS directory-in this case, /inst. However, this does not work for FTP or HTTP servers, and you won't be able to use the share as an installation source for individual packages.

Configuring Another Network Installation Server

The Red Hat exams test your knowledge of Linux. The most efficient way to share files between Linux computers is via NFS. If you have a choice on the exams, install Red Hat Enterprise Linux over a network connection, using NFS. However, it's possible that you'll want or need to install Red Hat Enterprise Linux using one of the two other available protocols: HTTP or FTP.

As some users may install only one kind of installation server, some of the instructions in this section may be repetitive.

HTTP Installation Server

The most popular Web server on the Internet is Apache, which you can easily install with Red Hat Enterprise Linux. The basic steps are the same as those for the NFS server. The details are slightly different. I'm assuming that you've already installed the Apache Web server; for more information, see Chapter 9.

The basic Apache share directory corresponds to the DocumentRoot variable, which is by default the /var/www/html directory. In other words, you'd copy the Red Hat installation files to a subdirectory of this directory. For the purpose of this chapter, I've already created the /var/www/html/test directory. Here are the detailed steps:

  1. Create a directory for your installation files. Using the following command, create the /var/www/html/inst directory. (If you get an error message, Apache may not be properly installed.)

     # mkdir /var/www/html/inst 

  2. Insert the first Red Hat Enterprise Linux installation CD/DVD into its drive. In many cases, it'll get mounted automatically, using the name of the media; for example, my RHEL DVD is automounted in the /media/RHEL-5 i386 Disc 1 directory. Otherwise, you can run a command such as mount /dev/cdrom /media. (If all you have are the ISO files, say in the /tmp directory, substitute mount -ro loop /tmp/firstcd.iso /media.)

  3. Copy the required files from the first Red Hat Enterprise Linux installation CD. Use the cp -ar /source/. /var/www/html/inst command, where source is the mount directory (such as /media/RHEL 5 i386 Disc 1). Don't forget the dot (.); it makes sure to copy hidden files, including the .discinfo file from the first Red Hat Enterprise Linux installation CD.

  4. Unmount the first Red Hat Enterprise Linux installation CD. If it's an installation DVD, skip to step 6. Use the umount /source command.

  5. Repeat steps 2, 3, and 4 with the remaining Red Hat Enterprise Linux installation CDs.

  6. Make sure there's nothing blocking access to your Apache server. If you're using SELinux, you'll also have to use the SELinux Management Tool to allow access to appropriate directories-use chcon to change the security context of the target subdirectory (see Chapter 9), and reboot your system to activate the changes. While inelegant, the following command "flushes," or turns off, the standard Linux firewall from the local computer. I'll describe the iptables command in more detail in Chapter 15.

     # iptables -F 

  7. Now you can activate the Apache service, httpd. The following commands assume that it's already running (which you can check using the service httpd status command):

     # service httpd stop # service httpd start 

When you install Red Hat Enterprise Linux from an Apache HTTP server, you'll need to remember the directory with the Red Hat installation files. For an HTTP server, the right directory is relative to the DocumentRoot variable, /var/www/html. With these steps, the installation files are in /var/www/html/inst; therefore, the correct directory is /inst.

FTP Installation Server

One of the oldest protocols still in common use on the Internet is FTP, the File Transfer Protocol. It's efficient and easy to use, and now that Red Hat has implemented the Very Secure FTP (vsFTP) service on its systems, it's relatively secure.

The basic steps are the same as those for the NFS server. I'm assuming that you've already installed the vsFTP server as described in Chapter 10. The basic FTP share directory is /var/ftp/pub. In other words, you'd copy the Red Hat installation files to a subdirectory of this directory. For the purpose of this chapter, I've created the /var/ftp/pub/test directory. Here are the detailed steps:

  1. Create a directory for your installation files. With the following command, create the /var/ftp/pub/inst directory. (If you get an error message, vsFTP may not be properly installed.)

     # mkdir /var/ftp/pub/inst 

  2. Insert the first Red Hat Enterprise Linux installation CD/DVD into its drive. In many cases, it'll get mounted automatically, using the name of the media; for example, my RHEL DVD is automounted in the /media/RHEL-5 i386 Disc 1 directory. Otherwise, you can run a command such as mount /dev/cdrom /media. (If all you have are the ISO files, say in the /tmp directory, substitute mount -ro loop /tmp/firstcd.iso /media.)

  3. Copy the required files from the first Red Hat Enterprise Linux installation CD. Use the cp -ar /source/. /var/ftp/pub/inst command, where source is the mount directory (such as /media/RHEL 5 i386 Disc 1). Don't forget the dot (.); it makes sure to copy hidden files, including the .discinfo file from the first Red Hat Enterprise Linux installation CD.

  4. Unmount the first Red Hat Enterprise Linux installation CD. If it's an installation DVD, skip to step 6. Use the umount /source command.

  5. Repeat steps 2, 3, and 4 with the remaining Red Hat Enterprise Linux installation CDs.

  6. Make sure there's nothing blocking access to your vsFTP server. If you're using SELinux, you'll also have to use the SELinux Management Tool to allow access to appropriate directories, and reboot your system to activate the changes. While inelegant, the following command "flushes," or turns off, the standard Linux firewall from the local computer. I'll describe the iptables command in more detail in Chapter 15.

     # iptables -F 

  7. Now you can activate the FTP server, vsFTP. The following commands assume that it's already running (which you can check using the service vsftpd status command):

     # service vsftpd stop # service vsftpd start 

When you install Red Hat Enterprise Linux from an FTP server, you'll need to remember the directory with the Red Hat installation files. For an FTP server, the right directory is relative to the basic /var/ftp directory. With these steps, the installation files are in /var/ftp/pub/inst; therefore, the correct directory is /pub/inst.

Requirements for Network Installations

Now that you've set up the Red Hat Enterprise Linux installation files on a network server, let's look at what else you'll need on the computer where you'll be installing Linux. Once Linux detects your network card, you'll need to configure that card to be a part of your network. It'll be done by a DHCP (Dynamic Host Configuration Protocol) server or by static IP addressing.

On the Job 

Naturally, if there's no native driver for your network card (as is the case with many wireless cards), you'll need to examine alternative installation methods such as from CD/DVD or from ISO files copied to a local hard drive.

If a DHCP server is on your network, this process is easy. All you'll need to do is set the Linux installation program to ask for your IP address information from that DHCP server. As long as no active firewalls are between your computer and the DHCP server, you should have no problems.

Otherwise, you'll need to configure your computer with static IP addresses. In this case, you'll need a valid, unused IP address; the local network mask; the default gateway IP address (if the installation files are on a different LAN); and, optionally, the primary DNS IP address, which is a domain name such as example.com and the host name to use for the local computer.

As you can see in Figures 2-1 and 2-2, Anaconda allows you to get your IP address information (for IPv4 and/or IPv6) from a DHCP server or enter the static IP address information yourself.

image from book
Figure 2-1: Configuring TCP/IP on your network card during installation

image from book
Figure 2-2: Manual TCP/IP network card configuration

You'll also need the host name or IP address of the Red Hat Enterprise Linux installation server, whether it uses NFS, HTTP, or FTP.

On the Job 

If you're installing RHEL from files on a network server, check the firewall on that server. The standard RHEL firewalls cut off network communication to whatever FTP, HTTP, or NFS server you might be using to store the installation directory tree.

Setting Up Installation from a Local Hard Drive

There are cases where it's most convenient to install RHEL from a local hard drive. I do this when I download the ISO files to the system where I want to install RHEL, and then boot more than one system on that computer.

For example, on my laptop system, I boot RHEL 5, Ubuntu Linux, and (don't tell anyone!) Microsoft Windows XP. I downloaded the ISO files to the main Ubuntu Linux partition, /dev/sda10, in my /home/michael directory.

I don't need to burn these ISO files to a CD or DVD. All I need to do is create a boot CD or USB key and then boot my system accordingly. Details are provided in the next section. Of course, I need a record of my current partitions so I know where the ISO files are stored and what partitions I want to keep.



RHCE Red Hat Certified Engineer Linux Study Guide (Exam RH302)
Linux Patch Management: Keeping Linux Systems Up To Date
ISBN: 0132366754
EAN: 2147483647
Year: 2004
Pages: 227
Authors: Michael Jang

Similar book on Amazon
Linux Quick Fix Notebook
Linux Quick Fix Notebook
Self-Service Linux: Mastering the Art of Problem Determination
Self-Service Linux: Mastering the Art of Problem Determination
RHCSA/RHCE Red Hat Linux Certification Study Guide (Exams EX200 & EX300), 6th Edition (Certification Press)
RHCSA/RHCE Red Hat Linux Certification Study Guide (Exams EX200 & EX300), 6th Edition (Certification Press)
Security Strategies in Linux Platforms and Applications (Information Systems Security & Assurance)
Security Strategies in Linux Platforms and Applications (Information Systems Security & Assurance)

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