Chapter 2 describes methods of launching installation if you don’t have a bootable DVD drive: Once the install is started, you need either an extra hard disk partition or another compute
Trang 2Fedora 8 and
Bible
Christopher Negus
Wiley Publishing, Inc
Trang 4Fedora 8
and
Bible
Trang 6Fedora 8 and
Bible
Christopher Negus
Wiley Publishing, Inc
Trang 7Wiley Publishing, Inc
10475 Crosspoint Boulevard
Indianapolis, IN 46256
www.wiley.com
Copyright © 2008 by Wiley Publishing, Inc All rights reserved
Published simultaneously in Canada
No part of this publication may be reproduced, stored in a retrieval system or transmitted in any form or by any means, electronic, mechanical, photocopying, recording, scanning or otherwise, except as permitted under Sections 107 or 108 of the 1976 United States Copyright Act, without either the prior written permission of the Publisher, or authorization through payment of the appropriate per-copy fee to the Copyright Clearance Center, 222 Rosewood Drive, Danvers, MA
01923, (978) 750-8400, fax (978) 750-4744 Requests to the Publisher for permission should be addressed to the Legal Department, Wiley Publishing, Inc., 10475 Crosspoint Blvd., Indianapolis, IN 46256, (317) 572-3447, fax (317) 572-
4355, or online at http://www.wiley.com/go/permissions
Limit of Liability/Disclaimer of Warranty: The publisher and the author make no representations or warranties with
respect to the accuracy or completeness of the contents of this work and specifically disclaim all warranties, including without limitation warranties of fitness for a particular purpose No warranty may be created or extended by sales or promotional materials The advice and strategies contained herein may not be suitable for every situation This work is sold with the understanding that the publisher is not engaged in rendering legal, accounting, or other professional services
If professional assistance is required, the services of a competent professional person should be sought Neither the publisher nor the author shall be liable for damages arising herefrom The fact that an organization or Website is referred
to in this work as a citation and/or a potential source of further information does not mean that the author or the publisher endorses the information the organization or Website may provide or recommendations it may make Further, readers should be aware that Internet Websites listed in this work may have changed or disappeared between when this work was written and when it is read
For general information on our other products and services or to obtain technical support, please contact our Customer Care Department within the U.S at (800) 762-2974, outside the U.S at (317) 572-3993 or fax (317) 572-4002
Wiley also publishes its books in a variety of electronic formats Some content that appears in print may not be available
in electronic books
Trademarks: Wiley, the Wiley Publishing logo, and related trade dress are trademarks or registered trademarks of John
Wiley & Sons, Inc., and/or its affiliates in the United States and other countries and may not be used without written permission Red Hat and Fedora are trademarks or registered trademarks of Red Hat, Inc Linux is a registered trademark
of Linus Torvalds All other trademarks are the property of their respective owners Wiley is not associated with any product or vendor mentioned in this book
Library of Congress Cataloging in Publication Data available upon request
ISBN: 978-0-470-23020-6
Printed in the United States of America
10 9 8 7 6 5 4 3 2 1
Trang 8Christopher Negus has been working with UNIX systems, the Internet, and (most recently)
Linux systems for more than two decades During that time, Chris worked at AT&T Bell Laboratories, UNIX System Laboratories, and Novell, helping to develop the UNIX operating system Features from many of the UNIX projects Chris worked on at AT&T have found their way into Red Hat Enterprise Linux, Fedora, and other Linux systems
Chris is the author of all editions of what started out as Red Hat Linux Bible, which because of
the name changes of Red Hat’s Linux projects has evolved into the book you are holding
Most recently, Chris co-authored three books in the Linux Toolbox series: Fedora Linux
Toolbox, Ubuntu Linux Toolbox, and SUSE Linux Toolbox (Wiley Publishing, 2007)
Before that, Chris authored Linux Bible 2008 Edition and co-wrote Linux Troubleshooting
Bible and Linux Toys II for Wiley Publishing During the past few years, Chris has written
several books on UNIX and the Internet, including Internet Explorer 4 Bible and Netscape
Plug-Ins For Dummies for Wiley Publishing He also co-wrote several books for Que
Publishing, including The Complete Idiot’s Guide to Networking (second and third editions) and Using UNIX (second edition)
At home, Chris enjoys spending time with his wife, Sheree, and his boys, Caleb and Seth His hobbies include soccer, singing, and exercising with Sheree
As always, I dedicate this book to my wife, Sheree This book would never have
happened without her love and support
Trang 9Mary Beth Wakefield
Vice President and
Executive Group Publisher
Johnna VanHoose Dinse
Media Associate Project Manager
Trang 10Preface
With the Fedora Linux operating system and the instructions in this book, you can transform your PC into a safe, powerful, and free computer system Starting with Fedora, you can simply replace (or coexist with) Microsoft Windows on your everyday desktop computer You can also configure your computer to share your files, printers, Web pages, or directory services to other computers Then, if you choose, you can transition your skills to manage anything from a small office to a large, corporate Red Hat Enterprise Linux computer installation
This book tells you how and gives you the software to do it
Who Are You?
You don’t need to be a programmer to use this book You may be someone who just wants to use Linux (to run programs, access the Internet, and so on) Or you may simply want to know how to administer a Linux system in a workgroup or on a network
I assume that you are somewhat computer literate but have little or no experience with Linux (or UNIX) You may be migrating from Microsoft operating systems to Linux because of its networking and multiuser features You may be looking to start a career as a computer
technician or network administrator and find that spending a few dollars for an entire operating system and book is more economical than taking those technical classes offered on late-night television Or you might just think a “free” operating system is cool
In any case, after you peruse this book you should have a good idea of how to run applications, set up a small network, connect to the Internet, and configure a variety of server types (Web servers, print servers, file servers, and so on) This book represents a great first few steps toward your becoming someone who can set up a home network or a small office network and maintain a group of computers
This Book’s Learn-Through-Tasks Approach
The best way to learn a computer system is to get your hands on it To help you learn Linux, this book takes a task-oriented approach Where possible, I step you through the process of working with a feature, such as setting up a network or configuring your desktop
When you are done with a task, you should have a good, basic setup of the feature that it covers After that, I often provide pointers to further information on tweaking and tuning the feature
Instead of assuming that you already know about cryptic topics such as troff, NFS, and TCP/IP, I ease you into those features with headings such as “Publishing with Fedora and RHEL,” “Setting up a File Server,” and “Connecting to the Internet.” Heck, if you already knew what all those things were and how to get them working, you wouldn’t need me, would you?
Trang 11When many tools can be used to achieve the same results, I usually present one or two
examples In other words, I don’t describe six different Web browsers, twelve different text editors, and three different news servers I tell you how to get one or two similar tools really working and then note the others that are available
What You Need
This book covers two different Linux systems: Fedora 8 and Red Hat Enterprise Linux 5 Because Fedora is most recently released and is included on the media with this book,
examples primarily focus on Fedora However, because Fedora technology feeds into
distributions besides RHEL, such as CentOS (www.centos.org), StartCom
(www.startcom.org), White Box Enterprise Linux (www.whiteboxlinux.org) and Oracle’s Unbreakable Linux (www.oracle.com/technologies/linux), you can use this book to learn about those distributions as well
To follow along with this book, you can install the complete Fedora 8 software found on the accompanying DVD If you don’t have a DVD drive, you can use the CD that comes with this book to try out Fedora and install a desktop Fedora system to your hard disk Or you can follow along with your CentOS system (which is free) or Red Hat Enterprise Linux 5 system, (which you can obtain with a subscription from Red Hat, Inc.)
To install Fedora 8 with the media that come with this book, you need a PC with the following general configuration:
• An Intel Pentium or compatible CPU, 200MHz Pentium or better (for text mode); 400MHz Pentium II or better (for GUI mode) Fedora 8 has been optimized for Pentium
4 processors (Intel 486 computers will not work with Fedora 8.)
• At least 64MB of RAM (text-based install) or 128MB of RAM (graphical install) To run the GNOME or KDE desktop 192MB are needed, although the Fedora Project recommends 512MB
• At least 620MB of hard disk space (you have to select a minimal install) You need 2.3GB of hard disk space for a personal desktop install, 3.0GB for a typical workstation installation, or at least 1.1GB of space for a server installation
• A DVD or CD drive This is recommended for installation (because we give you the installation DVD), although you can install from CD (we provide a live CD that can also
be installed to hard disk), over a network, or from a local hard disk instead For network and hard disk installs, booting installation from a 3.5-inch floppy disk drive is no longer supported Chapter 2 describes methods of launching installation if you don’t have a bootable DVD drive: Once the install is started, you need either an extra hard disk partition or another computer (that can be reached over the network) that has packages or images of the Fedora distribution on it (I tell you how to do that later, in case you’re interested.)
Trang 12Not every piece of PC hardware works with Fedora While there is no official hardware
compatibility list as there is for Red Hat Enterprise Linux (available at http://
bugzilla.redhat.com/hwcert/), overall hardware support should be improved in
Fedora 8 In fact, wireless LAN cards, FireWire devices, and some other components have
seen improved support in Fedora 8
There are versions of Fedora available for other computer architectures as well If you have a
Power PC or X86 64-bit computer, you can download official install and live CDs and DVDs
from the Fedora project (http://fedoraproject.org/en/get-fedora.html)
Likewise, you can get X86 and X86 64-bit versions of CentOS from that project’s site
(http://mirror.centos.org/)
Fedora 8 and Red Hat Enterprise Linux Bible
Improvements
Fedora® 8 and Red Hat® Enterprise Linux® Bible represents the continuing development of
Red Hat Linux Bible, which I began in 1999 About every six months since Red Hat Linux 6.1,
I’ve followed new versions of Red Hat Linux with updates of this book
Red Hat, Inc split its Red Hat Linux development efforts into two tracks: the Fedora Project
and the Red Hat Enterprise Linux (RHEL) product This book now covers the latest of those
two Linux distributions: Fedora 8 and RHEL 5 By learning the features in Fedora 8, you will
also be preparing yourself for future releases of RHEL
The foundation for Fedora, RHEL, and this book rests on the tradition begun with Red Hat
Linux The enhancements included in this edition reflect that foundation, plus some bold new
cutting-edge Linux technology
For the theme of this edition, I've focused on enhancements related to the new Fedora slogan,
“Freedom is a Feature.” While freedom does mean, in part, that you don't have to pay for the
software the Fedora project distributes, freedom is reflected in other ways as well With the
new Online Desktop feature, you are free to fashion a desktop that combines the personal
online services you use most With tools such as livecd-creator and Pungi, you are free to
create your own live CD or Fedora software repository
The following list describes new features of this book over the previous edition:
• Fedora 8 (Nearly) Everything Install DVD — We provide Fedora 8 on DVD with this
edition You get nearly the entire Fedora 8 distribution Because the Fedora software
repository has grown beyond the 8GB size we can fit on a dual-layer DVD, a handful of
games packages from that repository did not make it on to the DVD However, those
packages will still appear on your Package Manager window, allowing you to easily
install them from the Internet
• Fedora 8 Desktop Live/Install CD — Before you install Fedora, you can try out a
Desktop-oriented live version of Fedora 8 by booting the CD that comes with this book
Trang 13While that CD is running, you can use it to prepare your computer to do a permanent installation The contents of that CD can also be installed directly to your hard disk
• Live CD Creator and Pungi — Fedora project today offers some of the most solid tools
for creating Fedora live CDs (livecd-creator) and Fedora software repositories that include your own software (Pungi) While details of these features are outside the user/administrator focus of this book, I provide some tips and pointers in Chapter 2 to help you get started creating your own live CDs for software repositories
• Firstboot Changes — A feature called Smolt was recently added to the firstboot
procedure, which runs the first time you boot your computer after installation The Smolt screen that appears during firstboot lets you see all the hardware components on your computer and, optionally, lets you send that information to the Fedora project
• NTFS Support — The Fedora project recently added support for NTFS file systems to
the distribution This means you can use tools from the live CD, such as GParted, to resize your Windows NTFS partition and make your Windows PC into a dual-boot computer with Fedora You can also now mount and access those partitions from Fedora Chapter 2 contains a description of how to use the live CD that comes with this book to resize your NTFS partitions to prepare for a dual-boot computer
• Enhanced Fedora Theme — The new default theme for Fedora 8 is called Nodoka
This theme offers a unified look to Fedora that is streamlined and also works well with the Echo Icon theme used with Fedora
• GNOME Online Desktop — The new Online Desktop feature of GNOME is one of the
most exciting new features for Fedora 8 Although still experimental, Online Desktop promises to provide a mechanism for you to combine all your personal online services (Mugshot, Flickr, Netflix, Facebook, YouTube, and others), applications, and files into a single easy-to-use interface Chapter 3 describes how to get started with Online Desktop
• Fast User Switch — Using a User Switcher icon in the desktop panel, you can log in
multiple desktop users at the same time from the same screen Then you can quickly switch among those user desktops with just a couple of mouse clicks Fast User Switch
is described in Chapter 3
• Appearance Preferences — Tools for changing different aspects of your desktop
look-and-feel (themes, backgrounds, fonts, and interfaces) were combined into a single window for this release of GNOME The Appearance Preferences window is described
in Chapter 3
• 3D Desktop Effects (AIGLX) — With Fedora 8, you get improved support for 3D
desktop effects based on the AIGLX project The improved 3D accelerated desktop effects are described in Chapter 3
• Third-party Repositories — Software repositories for Fedora that are outside of Fedora
Project control can provide some of the software you need that doesn't meet Fedora’s licensing requirements Learn about repositories such as Livna.org and ATRPMs.net and others in Chapter 5
Trang 14• GIMP 2.4 — The new release of GIMP (version 2.4) is, in itself, a good reason to move
up to Fedora 8 While this book only describes a few enhancements included in GIMP
2.4 (see Chapter 6), you will find that across the board GIMP 2.4 has improved in
critical areas such as color management and useability
• Video Cards for Gaming — The description of video cards for gaming in Linux was
revised in Chapter 7 to cover availability of new open source video drivers and improved
3D acceleration support
• Rhythmbox Music Player — Some nice improvements to Rhythmbox let you connect
to free online music services, easily rip CDs, and otherwise improve how you manage
your music collection See Chapter 8
• Firewall Configuration — A new Firewall Configuration window not only makes it
easier to manage a simple firewall (opening or closing a few ports) but also includes
features for creating trusted interfaces, IP masquerading, and custom rules (Refer to
Chapter 14.)
In addition to new features just described, procedures throughout the book have been tested
and corrected to match changes that have occurred to Fedora 8 software in this version
Conventions Used in This Book
Throughout the book, special typography indicates code and commands Commands and code
are shown in a monospaced font:
This is how code looks
In the event that an example includes both input and output, the monospaced font is still used,
but input is presented in bold type to distinguish the two Here’s an example:
$ ftp ftp.handsonhistory.com
Name (home:jake): jake
Password: ******
The following boxes are used to call your attention to points that are particularly important
NOTE: A Note box provides extra information to which you need to pay special attention
TIP: A Tip box shows a special way of performing a particular task
CAUTION: A Caution box alerts you to take special care when executing a procedure, or damage to
your computer hardware or software could result
Trang 15CROSS-REFERENCE: A Cross-Reference box refers you to further information on a subject that you can find outside the current chapter
How This Book Is Organized
The book is organized into four parts
Part I: Getting Started in Fedora and RHEL
Part I consists of Chapters 1 through 4 Chapters 1 and 2 contain brief descriptions of the Linux technology and tell you what you need to get the operating system installed Chapter 1 serves as an introduction to the Linux OS and to Fedora in particular I also pay special attention to the division Red Hat, Inc., makes between the Fedora Project and Red Hat
Enterprise Linux Chapter 2 discusses what you need to install Fedora and how to make the decisions you’ll be faced with during installation It includes procedures for installing from DVD, CD-ROM, hard disk, or network connection (NFS, FTP, or HTTP servers)
In Chapter 3, you learn about the GNOME desktop environment, the KDE desktop
environment, and the X Window system These GUIs provide graphical means of using Fedora and RHEL Chapter 4 describes ways of exploring and understanding Fedora and RHEL, primarily from the Linux shell command interpreter You learn how to use the bash shell, the
vi text editor, and the commands for moving around the Linux file system
Part II: Using Fedora and RHEL
Part II consists of Chapters 5 through 9, which include information for the average user who wants to use Linux to run applications and access the Internet
Chapter 5 contains information on obtaining, installing, and running Linux applications It also helps you run applications from other operating systems in Linux Chapter 6 describes both old-time publishing tools and new, graphical word processors that are available with Fedora and RHEL Old tools include the troff and TeX text processing tools, whereas newer
publishing software includes OpenOffice.org utilities (included on the DVD) and StarOffice (commercially available)
GNOME and KDE games that run in Fedora and RHEL are described in Chapter 7 This chapter also describes how to run commercial Windows games using Cedega, and commercial Linux games, such as Civilization: Call to Power and Myth II, some of which have demo versions available Chapter 8 describes how to use audio and video players, as well as how to configure sound cards and CD burners Chapter 9 describes tools for browsing the Web (such
as the Firefox browser) and related tools (such as e-mail clients and newsreaders)
Trang 16Part III: Administering Fedora and RHEL
Part III consists of Chapters 10 through 14, which cover general setup and system maintenance
tasks, including how to set up user accounts, automate system tasks, and back up your data
Chapter 10, in which you learn what you need to know about basic system administration,
describes the root login, administrative commands, configuration files, SELinux, and log files
Chapter 11 describes how to set up and provide support for multiple users on your Fedora or
RHEL system
In Chapter 12 you learn to create shell scripts and to use the cron facility to automate a variety
of tasks on your Fedora and RHEL system Techniques for backing up your system and
restoring files from backup are described in Chapter 13 Chapter 14 describes issues related to
securing your computing assets in Fedora and RHEL
Part IV: Fedora and RHEL Network and Server Setup
Part IV consists of Chapters 15 through 26, which describe step-by-step procedures for setting
up a variety of server types Simple configurations for what might otherwise be complex tasks
are contained in each chapter Learn to arrange, address, and connect your Linux computers to
a local area network (LAN) in Chapter 15 Chapter 16 describes techniques for connecting
your Linux computer and LAN to the Internet, using features such as Point-to-Point Protocol
(PPP), IP forwarding, IP masquerading, routing, and proxy servers
Chapter 17 describes how to set up different types of print server interfaces, including Samba
(to share with Windows systems) and native Linux CUPS printing Chapter 18 describes file
servers, such as Network File System (NFS) servers and Samba file servers Chapter 19
describes how to configure sendmail or postfix e-mail servers
Chapter 20 describes how to configure and secure an FTP server, as well as how to access the
server using FTP client programs Chapter 21 teaches you how to set up Fedora or RHEL as a
Web server, focusing on the popular Apache server software Chapter 22 explains how to use
LDAP to create a shared address book Chapter 23 describes how to set up a DHCP server to
distribute information to client workstations on the network
Chapter 24 describes how to set up and use a MySQL database server in Linux Chapter 25
takes you through the process of making the servers you configured in the other chapters
available on the Internet Setting up a Domain Name System (DNS) server is also described in
Chapter 25 Chapter 26 describes how to set up Fedora or RHEL to be a Macintosh file and
printer server It also describes how to install Fedora on a new Intel-based Mac, so you can
dual boot between Mac OS X and Fedora
Appendixes
This book contains three appendixes Appendix A describes the contents of the companion
media Appendix B provides an overview of setting up and running network services
Appendix C covers features in Red Hat Enterprise Linux 5
Trang 17About the Companion Media
The Fedora 8 DVD that accompanies this book provides the software you need for a complete working Fedora system With this software, you can install sets of software packages that result in an installation from a few hundred megabytes to up to well over 10 gigabytes of software
We also include a Fedora 8 GNOME Desktop Live/Install CD That CD can be booted to run a live Fedora GNOME desktop system, without touching the contents of your hard disk You can install the contents of the live CD to your hard disk, to use that desktop system
permanently from your hard disk
This book describes how to configure and use the software for those different media
About the Companion Web Site
A new feature of the Fedora and RHEL Bible Companion Web site for this release is an advanced links page, specially geared toward helping you overcome common problems with Fedora If you are not finding the answers you need in this book, go to the book’s Web site at www.wiley.com/go/fedora8bible and see if some new information on the subject is available
Even in a book that pushes the 1,000-page boundary, a few topics don’t seem to make the cut The companion Web site contains some bonus material on topics such as using the X Window system, finding neat add-on software, exploring alternative administrative interfaces,
Logsentry, and Portsentry
With the LILO bootloader now gone from the Fedora distribution for several releases, I decided to move descriptions of LILO out of this book and to the Web site Other topics moved to the Web site from previous editions of this book includes information on using legacy UNIX remote commands (rlogin, rcp, and the like), running Tripwire to manage system security, running a NetWare server in Linux (mars_nwe) and using crack and other password protection tools Features moved from the immediately preceding edition include descriptions of the wu-FTPd FTP server, INN news server, and the sendmail.cf file
Reach Out
If you have any questions or comments about this book, feel free to contact me by e-mail at chris@linuxtoys.net I get busy sometimes, but I'll do my best to help
Trang 18Acknowledgments
A special acknowledgment goes to the people at Red Hat, Inc and members of the Fedora Project In particular, Max Spevack (Fedora Project leader) and Greg DeKoenigsberg (Fedora Community leader) deserve praise for their leadership in producing a consistently high-quality Linux distribution Special thanks to Jesse Keating (Red Hat release engineer for Fedora) for helping me use his excellent Pungi tools to produce the 8GB Fedora DVD that comes with this book Also special thanks to the members of the Fedora-marketing-list and Fedora-advisory-board mailing lists who have provided me with insights into the goals and direction of the Fedora project
At Wiley, I’d like to thank Jenny Watson, Colleen Hauser, and Laura Atkinson for helping work out issues related to the publicity, media, and covers for this book Thanks to Sara Shlaer for her continued great editing and production work on this book, and for keeping me on schedule so we could bring this book to you on schedule Tim Boronczyk provided a thorough technical editing pass Thanks also to Margot Maley Hutchison and the others at Waterside Productions for bringing me this project
Thanks, as always, to my dear family for helping me through this project It’s time to party!
Finally, a special thanks goes to those of you who bought this and earlier editions of Red Hat
Linux Bible Go out and become a force for Linux in your work, home, and community If you
feel like expanding your Linux horizons, try some of these other books I’ve written:
• Linux Bible 2008 Edition — Contains 16 different bootable and installable Linux
distributions on DVD and CD, along with descriptions characterizing those and other popular and interesting Linux distributions
• Fedora Linux Toolbox with François Caen — Includes 1000+ command lines to help
Fedora, RHEL, and CentOS power users get the most out of Linux To try other Linux
distributions, check out Ubuntu Linux Toolbox and SUSE Linux Toolbox by the same
authors
• Linux Troubleshooting Bible with Thomas Weeks — Goes beyond this book to help
you safely deploy and troubleshoot Linux systems
• Linux Toys II — If you’re looking for something fun to do with Linux, this book
contains nine fun projects you can build with a PC and open source software
Trang 20Contents
Part I: Getting Started in Fedora and RHEL
Chapter 1: An Overview of Fedora and Red Hat Enterprise Linux 3
Introducing Fedora 8 and Red Hat Enterprise Linux 4
What Is Linux? 5
Linux’s Roots in UNIX 6
Common Linux Features 8
Primary Advantages of Linux 10
What Are Red Hat Enterprise Linux and Fedora? 11
Red Hat forms the Fedora Project 11
Red Hat shifts to Red Hat Enterprise Linux 14
Choosing between Fedora and Enterprise 14
Why Choose Fedora or Red Hat Enterprise Linux? 15
New Features in Fedora 8 17
Getting custom Fedora spins 18
Creating your own spins 19
The GNOME Online Desktop 19
Infinity look-and-feel and Nodoka theme 19
PulseAudio sound system 20
Codeina utility for getting codecs 20
Package Manager 20
IcedTea Java environment 20
Firewall Configuration 20
The Culture of Free Software 20
Chapter 2: Installing Fedora 23
Understanding Fedora Installation Media 24
Using the Fedora 8 Live CD 24
Quick Installation 26
Detailed Installation Instructions 28
Installing Fedora 8 29
Choosing an installation method 29
Choosing computer hardware 31
Installing Fedora on a Laptop 33
Preparing for installation using the live CD 33
Beginning the installation 36
Running Fedora Setup Agent 45
Going forward after installation 48
Special Installation Procedures 49
Trang 21Alternatives for starting installation 49
Installing from other media 52
Starting a VNC install 55
Performing a kickstart installation 56
Special Installation Topics 61
Setting up to dual-boot Linux and Windows 62
Partitioning your disks 67
Using the GRUB boot loader 75
Troubleshooting Installation 81
Spinning Your Own Fedora Install or Live Media 83
Chapter 3: Getting Started with the Desktop 85
Logging in to Fedora or RHEL 86
Getting Familiar with the Desktop 88
Using the GNOME Desktop 97
Using the Metacity window manager 99
Using the GNOME panels 101
Using the Nautilus file manager 106
Changing GNOME preferences 109
Managing removable media (CDs, DVD, and cameras) 110
Trying other GNOME applications 112
Switching to another user 114
Exiting GNOME 114
Setting Up an Online Desktop 115
Switching Desktop Environments 118
Using the KDE Desktop 119
Starting with KDE 120
KDE desktop described 120
Managing files with the Konqueror File Manager 123
Configuring Konqueror options 128
Managing windows 132
Configuring the desktop 133
Adding application launchers and MIME types 136
Running 3D Accelerated Desktop Effects 137
Troubleshooting Your Desktop 140
GUI doesn’t work at start-up 141
Tuning your video card and monitor 142
Configuring video cards for gaming 144
Getting more information 144
Chapter 4: Using Linux Commands 147
The Shell Interface 147
Checking your login session 148
Trang 22Checking directories and permissions 149 Checking system activity 151 Exiting the shell 152 Understanding the Shell 152 Using the Shell in Linux 153 Locating commands 154 Rerunning commands 157 Connecting and expanding commands 163 Using shell environment variables 166 Managing background and foreground processes 169 Configuring your shell 172 Working with the Linux File System 175 Creating files and directories 177 Moving, copying, and deleting files 184 Using the vi Text Editor 184 Starting with vi 185 Moving around the file 188 Searching for text 188 Using numbers with commands 189
Part II: Using Fedora and RHEL
Chapter 5: Accessing and Running Applications 191
Getting and Installing Software Packages 192 Downloading and installing applications with yum 194 Getting Fedora and RHEL software updates 201 Getting updates with Package Updater 202 Managing RPM Packages 203 Using the Package Manager window 203 Using the rpm command 204 Using Software in Different Formats 215 Understanding software package names and formats 215 Using different archive and document formats 217 Building and installing from source code 219 Using Fedora or RHEL to Run Applications 222 Finding common desktop applications in Linux 224 Investigating your desktop 225 Starting applications from a menu 226 Starting applications from a Run Application window 226 Starting applications from a Terminal window 227 Running remote X applications 229 Running Microsoft Windows, DOS, and Macintosh Applications 232 Running DOS applications 234 Running Microsoft Windows applications in Linux 236
Trang 23Running Macintosh applications with ARDI Executor 242 Running Applications in Virtual Environments 242 Running applications virtually with Xen 243 Running applications virtually with KVM and QEMU 247
Chapter 6: Publishing with Fedora and RHEL 251
Using OpenOffice.org 252 Other Word Processors 254 Using StarOffice 255 AbiWord 256 Using KOffice 257 Using Traditional Linux Publishing Tools 258 Creating Documents in Groff or LaTeX 259 Text processing with Groff 259 Text processing with TeX/LaTeX 269 Converting documents 272 Creating DocBook documents 273 Understanding SGML and XML 274 Printing Documents with Fedora and RHEL 277 Printing to the default printer 278 Printing from the shell 278 Checking the print queues 279 Removing print jobs 279 Checking printer status 280 Displaying PDF Files with Adobe Acrobat Reader 280 Working with Graphics 281 Manipulating images with GIMP 282 Taking screen captures 283 Using Scanners Driven by SANE 284
Chapter 7: Gaming in Fedora and RHEL 287
Basic Linux Gaming Information 288 Where to get information on Linux gaming 288 Choosing a video card for gaming 289 Running Open Source Linux Games 291 GNOME games 292 KDE games 293 Adding more games from Fedora repository 294 Commercial Linux Games 304 Getting Started with commercial games in Linux 305 Playing commercial Linux games 305
id Software Games 306 Gaming with Cedega 308
Trang 24Loki Software game demos 309 Neverwinter Nights 312
Chapter 8: Music, Video, and Images in Linux 315
Understanding Multimedia and Legal Issues in Linux 315 Extending Freedom to Codecs 316 Listening to Music in Linux 317 Configuring a sound card 319 Choosing audio players 325 Automatically playing CDs 326 Playing CDs with gnome-cd 328 Playing and managing music with Rhythmbox 328 Playing music with XMMS Audio Player 331 Using ogg123, mpg321, and play command-line players 335 Using MIDI audio players 336 Converting audio files with SoX 336 Extracting and encoding music 338 Creating your own music CDs 341 Creating CD labels with cdlabelgen 345 Viewing TV and Webcams 345 Watching TV with TVtime 346 Video conferencing and VOIP with Ekiga 349 Playing Video 352 Examining laws affecting video and Linux 353 Understanding video content types 354 Watching video with Xine 355 Using Totem movie player 359 Using a Digital Camera 361 Displaying images in gThumb 361 Using your camera as a storage device 363
Chapter 9: Using the Internet and the Web 365
Overview of Internet Applications and Commands 365 Browsing the Web 368 Understanding Web browsing 369 Browsing the Web with Firefox 373 Setting up Firefox 376 Using text-based Web browsers 384 Communicating with E-mail 386 E-mail basics 387 Using Evolution e-mail 388 Thunderbird mail client 391 Text-based mail programs 392
Trang 25Mail readers and managers 393 Participating in Newsgroups 394 Instant Messaging with Pidgin 395 Sharing Files with BitTorrent 397 Using Remote Login, Copy, and Execution 398 Using telnet for remote login 398 Copying files with FTP 400 Getting files with wget 406 Using ssh for remote login/remote execution 409 Using scp for remote file copy 410 Using the “r” commands: rlogin, rcp, and rsh 410
Part III: Administering Fedora and RHEL
Chapter 10: Understanding System Administration 415
Using the root user account 416 Becoming Super User (The su Command) 416 Learning about Administrative GUI Tools, Commands, Configuration Files, and Log Files 418 Using graphical administration tools 419 Administrative commands 423 Administrative configuration files 424 Administrative log files 428 Using other administrative logins 428 Administering Your Linux System 431 Configuring Hardware 432 Checking your hardware 432 Reconfiguring hardware with kudzu 432 Configuring modules 433 Managing File Systems and Disk Space 436 Mounting file systems 439 Using the mkfs command to create a file system 446 Adding a hard disk 447 Using RAID disks 450 Checking system space 452 Monitoring System Performance 454 Watch computer usage with System Monitor 454 Monitoring CPU usage with top 456 Monitoring power usage on laptop computers 456 Choosing Software Alternatives 459 Selecting mail and printing alternatives 459 Using mail alternatives 461 Using Security Enhanced Linux 461 Understanding Security Enhanced Linux 461 Types and roles in SELinux 462
Trang 26Users in SELinux 463 Policies in SELinux 463 Tools in SELinux 463 Using SELinux in Fedora and RHEL 464 Getting SELinux 464 Checking whether SELinux is on 465 Checking SELinux status 466 Learning More about SELinux 467
Chapter 11: Setting Up and Supporting Users 469
Creating User Accounts 469 Adding users with useradd 470 Adding users with User Manager 475 Setting User Defaults 477 Supplying initial login scripts 480 Supplying initial bashrc and bash_profile files 480 Supplying an initial tcshrc file 481 Configuring system-wide shell options 482 Setting system profiles 483 Adding user accounts to servers 484 Creating Portable Desktops 485 Providing Support to Users 486 Creating a technical support mailbox 486 Resetting a user’s password 487 Modifying Accounts 488 Modifying user accounts with usermod 488 Modifying user accounts with User Manager 490 Deleting User Accounts 491 Deleting user accounts with userdel 491 Deleting user accounts with User Manager 493 Checking Disk Quotas 493 Using quota to check disk usage 493 Using du to check disk use 498 Removing temp files automatically 498 Sending Mail to All Users 499
Chapter 12: Automating System Tasks 501
Understanding Shell Scripts 501 Executing and debugging shell scripts 502 Understanding shell variables 503 Performing arithmetic in shell scripts 506 Using programming constructs in shell scripts 506 Some useful external programs 512
Trang 27Trying some simple shell scripts 514 System Initialization 516 Starting init 516 The inittab file 517 System Startup and Shutdown 521 Starting run-level scripts 521 Understanding run-level scripts 522 Understanding what startup scripts do 525 Changing run-level script behavior 527 Reorganizing or removing run-level scripts 528 Adding run-level scripts 530 Managing xinetd services 531 Manipulating run levels 532 Scheduling System Tasks 533 Using at.allow and at.deny 533 Specifying when jobs are run 534 Submitting scheduled jobs 534 Viewing scheduled jobs 535 Deleting scheduled jobs 536 Using the batch command 536 Using the cron facility 537
Chapter 13: Backing Up and Restoring Files 541
Making a Simple Backup Archive 542 Doing a Simple Backup with rsync 543 Backing up files locally 544 Backing up files remotely 545 Choosing Backup Tools 546 Selecting a Backup Strategy 547 Full backup 547 Incremental backup 547 Disk mirroring 547 Network backup 548 Selecting a Backup Medium 548 Magnetic tape 549 Writable CD drives 551 Writable DVD drives 555 Writing CD or DVDs with growisofs 556 Backing Up to a Hard Drive 557 Backing Up Files with dump 558 Creating a backup with dump 559 Understanding dump levels 561 Automating Backups with cron 561
Trang 28Restoring Backed-Up Files 563 Restoring an entire file system 564 Recovering individual files 565 Configuring Amanda for Network Backups 568 Creating Amanda directories 569 Creating the amanda.conf file 569 Creating a disklist file 571 Adding Amanda network services 572 Performing an Amanda backup 573 Using the pax Archiving Tool 574
Chapter 14: Computer Security Issues 579
Linux Security Checklist 579 Using Password Protection 582 Choosing good passwords 583 Using a shadow password file 584 Securing Linux with iptables Firewalls 586 Using the Firewall Configuration window 586 Configuring an iptables firewall 588 Controlling Access to Services with TCP Wrappers 600 Checking Log Files 603 Understanding the syslogd service 603 Tracking log messages with logwatch 606 Using the Secure Shell Package 608 Starting the SSH service 608 Using the ssh, sftp, and scp commands 608 Using ssh, scp, and sftp without passwords 610 Securing Linux Servers 611 Understanding attack techniques 612 Protecting against denial-of-service attacks 613 Protecting against distributed DOS attacks 616 Protecting against intrusion attacks 620 Securing servers with SELinux 623 Protecting Web servers with certificates and encryption 624
Part IV: Fedora and RHEL Network and Server Setup
Chapter 15: Setting Up a Local Area Network 635
Understanding Local Area Networks 635 Planning, getting, and setting up LAN hardware 636 Configuring TCP/IP for your LAN 640 Setting Up a Wireless LAN 646 Understanding wireless networks 647 Choosing wireless hardware 648
Trang 29Getting wireless drivers 653 Installing wireless Linux software 656 Configuring the wireless LAN 656 Testing distances 662 Setting wireless extensions 662 Understanding Internet Protocol Addresses 664
IP address classes 664 Understanding netmasks 665 Classless Inter-Domain Routing 666 Getting IP addresses 667 Troubleshooting Your LAN 668 Did Linux find your Ethernet driver at boot time? 668 Can you reach another computer on the LAN? 669
Is your Ethernet connection up? 670 Troubleshooting a wireless LAN 671 Watching LAN traffic with Wireshark 675
Chapter 16: Connecting to the Internet 681
Understanding How the Internet Is Structured 682 Internet domains 684 Hostnames and IP addresses 685 Routing 686 Proxies 687 Using Dial-Up Connections to the Internet 687 Getting information 688 Setting up dial-up PPP 689 Creating a dial-up connection with the Network Configuration window 689 Launching your PPP connection 692 Launching your PPP connection on demand 692 Checking your PPP connection 693 Connecting Your LAN to the Internet 700 Setting Up Linux as a Router 701 Configuring the Linux router 701 Configuring network clients 704 Configuring Windows network clients 705 Configuring a Virtual Private Network Connection 706 Understanding IPsec 707 Using IPsec protocols 708 Using IPsec in Fedora or RHEL 709 Setting Up Linux as a Proxy Server 709 Starting the squid daemon 710 Using a simple squid.conf file 712 Modifying the Squid configuration file 714
Trang 30Debugging Squid 718 Setting Up Proxy Clients 719 Configuring Firefox to use a proxy 720 Configuring Internet Explorer to use a proxy 721 Configuring other browsers to use a proxy 722
Chapter 17: Setting Up a Print Server 725
Common UNIX Printing Service 725 Setting Up Printers 726 Using the Printer configuration window 727 Using Web-based CUPS administration 736 Configuring the CUPS server (cupsd.conf) 738 Configuring CUPS printer options 740 Using Printing Commands 741 Using lpr to print 742 Listing status with lpc 742 Removing print jobs with lprm 743 Configuring Print Servers 743 Configuring a shared CUPS printer 744 Configuring a shared Samba printer 745
Chapter 18: Setting Up a File Server 747
Goals of Setting Up a File Server 747 Setting Up an NFS File Server 748 Sharing NFS file systems 750 Using NFS file systems 757 Unmounting NFS file systems 763 Other cool things to do with NFS 763 Setting Up a Samba File Server 764 Getting and installing Samba 765 Configuring a simple Samba server 766 Configuring Samba with SWAT 769 Working with Samba files and commands 778 Setting up Samba clients 782 Troubleshooting your Samba server 785
Chapter 19: Setting Up a Mail Server 789
Introducing SMTP and sendmail 790 Installing and Running sendmail 790 Starting sendmail 791 Other programs 792 Logging performed by sendmail 793 Configuring sendmail 794
Trang 31Getting a domain name 795 Configuring basic sendmail settings (sendmail.mc) 795 Defining outgoing mail access 799 Configuring virtual servers 801 Configuring virtual users 802 Adding user accounts 803 Starting sendmail and generating database files 804 Redirecting mail 805 Introducing Postfix 807 Stopping Spam with SpamAssassin 808 Using SpamAssassin 809 Setting up SpamAssassin on your mail server 809 Setting e-mail readers to filter spam 811 Getting Mail from the Server (POP3 or IMAP) 812 Accessing mailboxes in Linux 812 Configuring IMAP and POP3 with dovecot 813 Getting Mail from Your Browser with SquirrelMail 814 Administering a Mailing List with mailman 816
Chapter 20: Setting Up an FTP Server 821
Understanding FTP Servers 822 Attributes of FTP servers 822 FTP user types 823 Using the Very Secure FTP Server 823 Quick-starting vsFTPd 824 Configuring vsFTPd 825 Getting More Information about FTP Servers 831
Chapter 21: Setting Up a Web Server 833
Introduction to Web Servers 834 The Apache Web server 834 Other Web servers available for Fedora and RHEL 835 Quick Starting the Apache Web Server 836 Configuring the Apache Server 838 Configuring the Web server (httpd.conf) 839 Configuring modules and related services (/etc/httpd/conf.d/*.conf) 874 Starting and Stopping the Server 876 Monitoring Server Activities 878 Displaying server information 879 Displaying server status 880 Further security of server-info and server-status 881 Logging errors 881 Logging hits 882
Trang 32Analyzing Web-server traffic 883
Chapter 22: Setting Up an LDAP Address Book Server 887
Understanding LDAP 888 Defining information in schemas 889 Structuring your LDAP directories 890 Setting Up the OpenLDAP Server 891 Installing OpenLDAP packages 891 Configuring the OpenLDAP server (slapd.conf) 891 Starting the OpenLDAP service 894 Setting Up the Address Book 894 More Ways to Configure LDAP 899 Accessing an LDAP Address Book from Thunderbird 900
Chapter 23: Setting Up a DHCP Boot Server 903
Using Dynamic Host Configuration Protocol 903 Setting Up a DHCP Server 904 Opening your firewall for DHCP 905 Configuring the /etc/dhcpd.conf file 905 Starting the DHCP server 912 Setting Up a DHCP Client 913
Chapter 24: Setting Up a MySQL Database Server 915
Finding MySQL Packages 916 Getting More MySQL Packages 916 Configuring the MySQL Server 918 Using mysql user/group accounts 918 Adding administrative users 918 Setting MySQL options 919 Using sample my.cnf files 924 Starting the MySQL Server 925 Checking That MySQL Server Is Working 926 Working with MySQL Databases 927 Starting the mysql command 927 Creating a database with mysql 929 Adding data to a MySQL database table 930 Understanding MySQL Tables 934 Displaying MySQL Databases 939 Displaying all or selected records 940 Displaying selected columns 941 Sorting data 941 Making Changes to Tables and Records 942 Altering the structure of MySQL tables 942 Updating and deleting MySQL records 943
Trang 33Adding and Removing User Access 944 Adding users and granting access 944 Revoking access 945 Backing Up Databases 946 Checking and Fixing Databases 946
Chapter 25: Making Servers Public with DNS 949
Determining Goals for Your Server 950 Using a hosting service 950 Connecting a Public Server 951 Choosing an ISP 951 Getting a domain name 954 Configuring Your Public Server 956 Configuring networking 956 Configuring servers 957 Managing security 958 Setting Up a Domain Name System Server 960 Understanding DNS 961 DNS name server example 964 Quick-starting a DNS server 966 Checking that DNS is working 974 Getting More Information about BIND 975
Chapter 26: Integrating Fedora with Apple Macs 977
Looking Inside Mac OS X 978 Using Network Services from Mac OS X 979 Using AppleTalk (netatalk) from Mac OS X 980 Using AppleTalk from Mac OS 8 or OS 9 982 Using Mac, Windows, and Linux servers (Samba) 982 Sharing X applications 984 Configuring an AppleTalk Server in Linux 985 Before you start using netatalk 985 Setting up the netatalk server 986 Securing netatalk volumes 991 Troubleshooting netatalk 997 Accessing NFS Servers from the Mac 999 Connecting to NFS from the Connect to Server window 999 Connecting to NFS from the command line 1001 Installing Fedora on an Intel-based Mac 1001 Before installing Fedora on your Mac 1002 Installing Fedora 1002
Appendix A: About the Media 1005
Trang 34Fedora Source Code 1006 Fedora Rescue CD 1006
Appendix B: Running Network Services 1009
Checklist for Running Networking Services 1009 Networking Service Daemons 1011 The xinetd super-server 1011 The init.d start-up scripts 1012 Choosing Alternatives 1013 Referencing Network Services 1014 Web server 1014 File servers 1015 Login servers 1016 E-mail servers 1017 News server 1018 Print servers 1018 Network administration servers 1018 Information servers 1020 Database services 1021 User services 1022 Security services 1023
Appendix C: Red Hat Enterprise Linux 5 Features 1031
What’s in RHEL 5? 1031 Choosing an RHEL System 1033 Getting RHEL Evaluation Subscriptions 1034 Hardware Compatibility and Commercial Software 1035 Training and Certification 1035 Documentation and Support 1036 Managing RHEL Systems 1036 Using Red Hat Network 1036 Using RHEL for high-performance computing clusters 1038 Using RHEL Global File System 1038 More Information on RHEL 1039
Index 1041
Trang 36Getting Started in Fedora
and RHEL
Chapter 1: An Overview of Fedora and
Red Hat Enterprise Linux
Chapter 2: Installing Fedora
Chapter 3: Getting Started with the Desktop Chapter 4: Using Linux Commands
Trang 38• Linux’s roots in UNIX
• Common Linux features
• Primary advantages of Linux
• What is Fedora?
• Why choose Fedora?
• The culture of free software
Linux was a phenomenon waiting to happen The computer industry suffered from a rift In the 1980s and 1990s, people had to choose between inexpensive, market-driven PC operating systems from Microsoft and expensive, technology-driven operating systems such as UNIX Free software was being created all over the world, but lacked a common platform to rally around Linux has become that common platform
For several years, Red Hat Linux was the most popular commercial distribution of Linux In
2003, Red Hat, Inc changed the name of its distribution from Red Hat Linux to Fedora Core (later changing the name to simply Fedora) and moved its commercial efforts toward its Red Hat Enterprise Linux products It then set up Fedora to be:
• Sponsored by Red Hat
• Supported by the Linux community
• Inclusive of high-quality, cutting-edge open source technology
• A proving ground for software slated for commercial Red Hat deployment and support Red Hat Enterprise Linux, on the other hand, became the basis for Red Hat’s fully supported product line, geared toward big companies with the need to set up and manage many Linux
Trang 39systems After taking its software through about a year and a half of Fedora releases (about once every six to nine months), a commercial Red Hat Enterprise Linux (RHEL) product line
is released that includes:
• Subscription service to RHEL that offers stable, tested software (mostly the same software in Fedora that has gone through rigorous testing)
• Multiple support programs, ranging from an online knowledge base to assistance with custom deployment, engineering, and software development
• Official documentation, training, and certification programs
Fedora itself has become a respected and active Linux distribution that thousands of people use worldwide as a desktop, server, or programming workstation It is the best way to get the latest Linux software that is being built on a foundation for enterprise-quality systems Using Fedora is a great way to get a head start learning the features of upcoming RHEL releases The latest Fedora Linux operating system (referred to as Fedora 8) is included on the DVD that comes with this book The book also includes a Fedora Live CD with a system that can be installed directly to your hard disk when you are ready
Introducing Fedora 8
and Red Hat Enterprise Linux
With the split between community (Fedora) and commercial (Red Hat Enterprise Linux) versions of what was Red Hat Linux, Red Hat has created a model that can suit the fast-paced changes in the open source software world, while still meeting the demands for a well-
supported commercial Linux distribution
Technical people have chosen Red Hat Enterprise Linux because of its reputation for solid performance With the Fedora Project, Red Hat has created an environment where open source developers can bring high-quality software packages to a freely distributed, community-oriented Linux system
More than 8400 individual software packages (compared to just over 600 in Red Hat Linux
6.2) are included in the single, massive Fedora 8 software repository The Fedora 8 software
repository represents a merging of the basic Fedora system (Fedora Core) and contributed software packages (Fedora Extras) that took place last year These packages contain features that would cost you thousands of dollars to duplicate if you bought them as separate commercial products These features let you:
community-• Connect your computers to a LAN or the Internet
• Create documents and publish your work on paper or on the Web
• Work with multimedia content to manipulate images, play music files, view video, and even master and burn your own CDs and DVD
Trang 40• Play games individually or over a network
• Communicate over the Internet using a variety of Web tools for browsing, chatting, transferring files, participating in newsgroups, and sending and receiving e-mail
• Protect your computing resources by having Fedora or RHEL act as a firewall or a router
to protect against intruders coming in through public networks
• Configure a computer to act as a network server, such as a print server, Web server, file server, mail server, news server, and a database server
This is just a partial list of what you can do with Fedora or RHEL Using this book as your guide, you will find that there are many more features built into Fedora and RHEL as well Support for new video cards, network cards, printers, and storage devices is being added every day Linux programmers around the world are no longer the only ones creating hardware drivers Every day more hardware vendors are creating their own Linux drivers, so they can sell products to the growing Linux market New applications are being created to cover
everything from personal productivity tools to programs that access massive corporate
databases
Remember that old Pentium computer in your closet? Don’t throw it away! Just because a new release of Fedora is out doesn’t mean that you need all new hardware for it to run Support for many old computer components get carried from one release to the next With a Minimal install, you could use Fedora as a router (to route data between your LAN and the Internet), firewall (to protect your network from outside intrusion), or file server (to store shared files on your LAN) — with maybe an Ethernet card or an extra hard disk added
At this point, you may feel that Linux is something you want to try out This brings us to the basic question: What is Linux?
What Is Linux?
Linux is a free operating system that was created by Linus Torvalds when he was a student at
the University of Helsinki in 1991 Torvalds started Linux by writing a kernel — the heart of
the operating system — partly from scratch and partly by using publicly available software (For the definition of an operating system and a kernel, see the sidebar “What Is an Operating System?” later in this chapter.) Torvalds then released the system to his friends and to a community of “hackers” on the Internet and asked them to work with it, fix it, and enhance it