Chapter 1: Installing a Server

In This Chapter ✓ Getting ready to install Linux ✓ Installing Linux ✓ Adding additional packages after installation

his chapter presents the procedures that you need to follow to install TLinux on a server computer. The details provided are specifically for Fedora 17, a free sponsored by Red Hat. However, the procedures for installing other distributions of Linux are similar, so you won’t have any trouble adapting these procedures if you’re using a different distribution.

Planning a Linux Server Installation Before you begin the installation program, you need to make a number of preliminary decisions. The following sections describe the decisions that you need to make before you install Linux.

Checking system requirements Before you install Linux, make sure that the computer meets the minimum requirements. Although the minimum requirements for Linux are consider- ably less than those for the latest version of Windows Server, you can’t run Linux on an abacus. The following paragraphs summarize the minimum capabilitiesCOPYRIGHTED you need: MATERIAL ✦ A Pentium-based computer: Even an ancient and slow Pentium 3 system will run some builds of Linux although performance will be slow. The minimum recommended for Fedora 17 is a Pentium 4. ✦ 768MB of RAM or more: Of course, the more the better, but Linux can make do with much less RAM than Windows. ✦ A hard drive with enough free space to hold the packages that you need to install: A suitable minimum is 10GB. ✦ A DVD-ROM drive from which to install the operating system

664_9781118380987-bk09ch01.indd4_9781118380987-bk09ch01.indd 679679 110/29/120/29/12 10:3210:32 PMPM 680 Planning a Linux Server Installation

✦ Just about any video card and monitor combination: You don’t need anything fancy for a server. In fact, fancy video cards often lead to hard- ware compatibility issues. Stick to a basic video card. ✦ An extra mouse: If you’re converting an old junker computer to a Linux server and you’ve lost the mouse (that seems to happen a lot), pick one up at your local office supply store. A cheap one costs only about $15. ✦ A network interface card (NIC)

Choosing a distribution Because the kernel (that is, the core operating functions) of the Linux oper- ating system is free, several companies have created their own distributions of Linux, which include the Linux OS along with a bundle of packages, such as administration tools, web servers, and other useful utilities, as well as printed documentation.

The following are some of the more popular Linux distributions:

✦ Fedora: One of the popular Linux distributions. You can download Fedora free from http://fedoraproject.org. You can also obtain it by purchasing any of several books on Fedora that include the Fedora distribution on DVD or CD-ROM. All the examples in this book are based on Fedora 17. ✦ Mandriva Linux: Another popular Linux distribution, one that is often recommended as the easiest for first-time Linux users to install. This distribution was formerly known as Mandrake Linux. Go to www. mandriva.com for more information. ✦ : A Linux distribution that has gained popularity in recent years. It focuses on ease of use. For more information, go to www.ubuntu.com. ✦ SUSE: Pronounced SOO-zuh, like the name of the famous composer of marches; a popular Linux distribution sponsored by Novell. You can find more information at www.suse.com. ✦ : One of the oldest Linux distributions and still popular, espe- cially among Linux old-timers. A full installation of Slackware gives you all the tools that you need to set up a network or Internet server. See www.slackware.com for more information.

All distributions of Linux include the same core components: the Linux kernel, an X Server, popular windows managers such as GNOME and KDE, compilers, Internet programs such as Apache, Sendmail, and so on. However, not all Linux distributions are created equal. In particular, the manufacturer of each distribution creates its own installation and configura- tion programs to install and configure Linux.

664_9781118380987-bk09ch01.indd4_9781118380987-bk09ch01.indd 680680 110/29/120/29/12 10:3210:32 PMPM Planning a Linux Server Installation 681

Book IX I can’t see my C: drive! Chapter 1 Installing a Linux Installing a Linux Linux and Windows have a completely differ- partition as /var. Then, any files stored in

ent method of referring to your computer’s hard the /user directory would actually be stored Server drives and partitions. The differences can take in the second partition, and files stored in the some getting used to for experienced Windows /var directory would be stored in the third users. partition. Windows uses a separate letter for each drive The directory to which a drive mounts is called and partition on your system. For example, if the drive’s mount point. you have a single drive formatted into three Notice that Linux uses regular forward slash partitions, Windows identifies the partitions as characters (/) to separate directory names drives C:, D:, and E:. Each of these drives has its rather than the backward slash characters (\) own root directory, which can, in turn, contain used by Windows. Typing backslashes instead additional directories used to organize your of regular slashes is one of the most common files. As far as Windows is concerned, drives mistakes made by new Linux users. C:, D:, and E: are completely separate drives even though the drives are actually just parti- While I’m on the subject, Linux uses a different tions on a single drive. convention for naming files, too. In Windows, filenames end in a three- or four-letter exten- Linux doesn’t use drive letters. Instead, Linux sion that’s separated from the rest of the file- combines all the drives and partitions into a name by a period. The extension is used to single directory hierarchy. In Linux, one of the indicate the file type. For example, files that end partitions is designated as the root partition. in .exe are program files, but files that end in The root partition is roughly analogous to the .doc are word-processing documents. root directory of the C: drive on a Windows system. Then, the other partitions can be Linux doesn’t use file extensions, but periods mounted on the root partition and treated are often used in Linux filenames to separate as if they were directories on the root parti- different parts of the name — and the last tion. For example, you may designate the first part often indicates the file type. For example, partition as the root partition and then mount ldap.conf and pine.conf are both the second partition as /user and the third configuration files.

The installation program is what makes or breaks a Linux distribution. All the distributions I list in this section have easy-to-use installation programs that automatically detect the hardware that’s present on your computer and configure Linux to work with that hardware, thus eliminating most — if not all — manual configuration chores. The installation programs also let you select the Linux packages that you want to install and let you set up one or more user accounts besides the root account.

664_9781118380987-bk09ch01.indd4_9781118380987-bk09ch01.indd 681681 110/29/120/29/12 10:3310:33 PMPM 682 Planning a Linux Server Installation

Thinking about multiboot Linux comes with a boot loader program called GRUB that lets you choose from several installed operating systems when you start your computer. GRUB makes it possible to keep your existing Windows system on a com- puter and install Linux into a separate partition. Then, each time you start the computer, you can decide whether to start Windows or Linux.

If you’re new to Linux and want to experiment with it a bit before you commit to it, multiboot is a good way to go. But if you’re setting up a produc- tion server on a machine that will be devoted to Linux, there’s no reason to mess around with multiboot.

Going virtual Another common way to install Linux is in a virtual machine running within the Windows operating system. In fact, all the examples in this minibook were tested using Oracle VM VirtualBox, a free virtualization platform you can download from www.virtualbox.org. For more information, see Chapter 8 of Book II.

Deciding on your TCP/IP configuration Before you install the OS, you should have a plan for how you will implement TCP/IP on the network. Here are some of the things you need to decide or find out:

✦ The public IP subnet address and mask for your network ✦ The domain name for the network ✦ The host name for the server? ✦ Whether the server obtain its address from DHCP ✦ Whether the server have a static IP address — and if so, what? ✦ Whether the server be a DHCP server ✦ The default gateway for the server — that the IP address of the net- work’s Internet router ✦ Whether the server be a DNS server

If the server will host TCP/IP servers (such as DHCP or DNS), you’ll probably want to assign the server a static IP address.

For more information about planning your TCP/IP configuration, see Book IV.

664_9781118380987-bk09ch01.indd4_9781118380987-bk09ch01.indd 682682 110/29/120/29/12 10:3310:33 PMPM Installing Fedora 17 683

Book IX Installing Fedora 17 Chapter 1 After you plan your installation and prepare the computer, you’re ready Installing a Linux Installing a Linux to actually install Linux. The following procedure describes the steps you

must follow to install Fedora 17 on a computer that has a bootable DVD- Server ROM drive:

1. Insert the Fedora 17 CD in the DVD drive and restart the computer. The computer boots from the DVD drive and displays a Linux boot prompt, which looks like this: Boot: If you don’t have the installation DVD, download the DVD images from http://fedoraproject.org. Then, use DVD-burning software to create a DVD from the image. 2. Press Enter. The computer starts Linux from the installation disk. The screen shown in Figure 1-1 soon appears. 3. Press Enter. A bunch of text messages fly by your screen as Linux starts up. Eventually, the screen shown in Figure 1-2 appears, asking you which language you’d like to use. 4. Choose your language and then click Next. The Keyboard Configuration screen appears, as shown in Figure 1-3. It lets you choose from about 55 different keyboard styles.

Figure 1-1: Select an installation option.

664_9781118380987-bk09ch01.indd4_9781118380987-bk09ch01.indd 683683 110/29/120/29/12 10:3310:33 PMPM 684 Installing Fedora 17

Figure 1-2: Choose a language.

Figure 1-3: Choose your keyboard here.

664_9781118380987-bk09ch01.indd4_9781118380987-bk09ch01.indd 684684 110/29/120/29/12 10:3310:33 PMPM Installing Fedora 17 685

Book IX Virtual consoles and the installation program Chapter 1 Installing a Linux Installing a Linux Linux is inherently a command line–oriented you can do it from this console. The key-

OS. Graphical user interfaces — including board shortcut is Ctrl+Alt+F2. Server the installation program’s GUI — are provided ✓ Console 3: Install log. This console lists by an optional component called X Window messages generated by the installation System. However, while you’re working with program. You can get to it by pressing the GUI of the installation program, Linux Ctrl+Alt+F3. keeps several additional command line con- soles open. Normally, you don’t need to use ✓ Console 4: System log. This console dis- every one of these consoles during installa- plays system-related messages. You can tion. However, if something goes wrong during get to it by pressing Ctrl+Alt+F4. installation, these consoles may be useful: ✓ Console 5: Other messages. Still more mes- ✓ Console 1: The Installation dialog box. This sages may appear in this console, which is the main installation console. You see it you can open by pressing Ctrl+Alt+F5. when Setup first starts. After the GUI takes ✓ Console 6: X graphical display. This is the over, it’s hidden in the background. You console where the GUI of the installation can call it up by pressing Ctrl+Alt+F1. program is displayed. If you use a Ctrl+Alt ✓ Console 2: Shell prompt. This console pro- keyboard combination to view any of the vides you with a shell prompt, from which you other logs, press Ctrl+Alt+F7 to return to can enter Linux commands. If you need to the installation GUI. do something manually during installation,

5. Choose your keyboard type and then click Next. 6. Click Next. The Setup program checks the disk. If existing partitions are found, Setup will ask which partition you want to install Linux into. If there are no partitions on the disk, Setup displays the warning screen shown in Figure 1-4. This screen indicates that because Setup doesn’t see any par- titions, it can’t be certain that the disk is empty. In most cases, the disk is empty, so you can continue with the installation by clicking the Yes, Discard Any Data button. 7. Click the Yes, Discard Any Data button. Fedora asks for the host name for the computer, as shown in Figure 1-5. 8. Enter the name you want to assign this computer and then click Next. The Time Zone Selection screen appears, as shown in Figure 1-6. On this screen is a map of the world with dots representing about 500 different locations throughout the world.

664_9781118380987-bk09ch01.indd4_9781118380987-bk09ch01.indd 685685 110/29/120/29/12 10:3310:33 PMPM 686 Installing Fedora 17

Figure 1-4: Verify that the installation disk is indeed empty.

Figure 1-5: Choose the host name.

Figure 1-6: Choose a time zone.

664_9781118380987-bk09ch01.indd4_9781118380987-bk09ch01.indd 686686 110/29/120/29/12 10:3310:33 PMPM Installing Fedora 17 687

9. Click the location that’s closest to you and then click Next. Book IX Chapter 1 The Set Root Password screen appears, as shown in Figure 1-7. This

screen lets you enter the all-important root account password. It’s vital Installing a Linux that this account be protected by a strong password, so choose a good

one. Write down the password somewhere and store it in a secure loca- Server tion away from the computer.

Figure 1-7: Set the root password.

The screen shown in Figure 1-8 displays, providing several options for how you want to install Linux into partitions on the installation disk. The alternatives are • Use All Space: This option removes all existing partitions from the disk drive and creates one large partition for the new Linux installa- tion. • Replace Existing Linux System(s): This option removes any existing Linux partitions but leaves other partitions in place. Then, a single partition is created for the new Linux installation. This is the pre- ferred option. • Shrink Current System: This option reduces the size of existing parti- tions as much as possible and then creates a new partition from the free space thus created. • Use Free Space: This option creates a new Linux partition in any existing free space on the disk. • Create Custom Layout: If none of the above options work for your situ- ation, you can select this option. Then, you’ll be prompted to create a new partition for the Linux installation. 10. Select your partitioning option and then click Next. Fedora warns you that it is about to wipe out any existing data on your hard disk, as shown in Figure 1-9.

664_9781118380987-bk09ch01.indd4_9781118380987-bk09ch01.indd 687687 110/29/120/29/12 10:3310:33 PMPM 688 Installing Fedora 17

Figure 1-8: Select a partition option.

Figure 1-9: Fedora warns you that existing data will be lost.

11. Click the Write Changes to Disk button. The installation program displays a bunch of progress boxes as it cre- ates various components of the Linux system. When everything has been created, the screen shown in Figure 1-10 is displayed, where you can choose the optional features that you want to install. 12. Select the Web Server and the Customize Now radio buttons and then click Next. The screen shown in Figure 1-11 appears. This screen allows you to fur- ther customize the packages to be installed.

664_9781118380987-bk09ch01.indd4_9781118380987-bk09ch01.indd 688688 110/29/120/29/12 10:3310:33 PMPM Installing Fedora 17 689

Book IX Chapter 1 Installing a Linux Installing a Linux Server

Figure 1-10: Choose optional features.

Figure 1-11: Select additional packages.

664_9781118380987-bk09ch01.indd4_9781118380987-bk09ch01.indd 689689 110/29/120/29/12 10:3310:33 PMPM 690 Installing Fedora 17

13. Click Servers. A list of optional server packages appears. 14. Select the server packages you want to install and then click Next. For example, to add the DNS server function to your Linux server, choose DNS Server. After you click Next, the installation program does some double-check- ing to make sure that none of the packages you chose depend on other packages that you haven’t chosen. If it finds such a dependency, it adds the dependent package so that your system will function properly. After these dependencies have been verified, the installation program begins installing Linux. This will take a while — maybe a long while — so now would be a good time to grab a book or take a nap. When the installation finishes, the screen shown in Figure 1-12 is shown. Pat yourself on the back for your ingenuity and perseverance. 15. Remove the installation disk from the drive and then click Reboot. The system is rebooted. Installation is done!

Figure 1-12: Congratula- tions!

664_9781118380987-bk09ch01.indd4_9781118380987-bk09ch01.indd 690690 110/29/120/29/12 10:3310:33 PMPM Using the Setup Agent 691

Book IX Using the Setup Agent Chapter 1 When Fedora restarts the first time after completing the installation pro- Installing a Linux Installing a Linux gram, it launches a handy Setup Agent, as shown in Figure 1-13. (Note: The

Setup Agent runs only if you installed a GUI.) The Setup Agent resembles the Server installation program, but it asks a few questions that the installation pro- gram forgot to ask.

When the Setup Agent starts, follow these steps to see it through to completion:

1. On the Welcome screen, click Forward to get started. The Setup Agent displays the License Agreement, as if after going through the previous 15 steps to install Fedora, you’re now going to decide you don’t agree to their terms. It’s useless to resist. 2. Click Forward to confirm your acceptance of the license agreement. The Setup Agent asks you to create a user account so that you don’t have to access the system by using the root account, as shown in Figure 1-14.

Figure 1-13: The Setup Agent.

664_9781118380987-bk09ch01.indd4_9781118380987-bk09ch01.indd 691691 110/29/120/29/12 10:3310:33 PMPM 692 Using the Setup Agent

Figure 1-14: Create a user account.

3. Type a name and password for the user account and then click Forward. The Setup Agent now asks you to set the date and time. 4. Select the correct date and time and then click Forward. The Setup Agent asks whether you want to submit details about your hardware configuration as part of an effort to improve Linux’s support for various hardware devices. 5. Click Send Profile or Do Not Send Profile and then click Finish.

That’s all there is. Your Linux system is now set up and ready to go.

664_9781118380987-bk09ch01.indd4_9781118380987-bk09ch01.indd 692692 110/29/120/29/12 10:3310:33 PMPM