Fedora Unleashed, 2008 Edition presents comprehensive coverage of Fedora 8, the popular Linux distribution developed by the Red Hat-sponsored Fedora Project. This book provides detailed information on installing, using, and administering Fedora. You’ll learn how to set up a desktop workstation or a high-powered server, and you’ll find complete details on Yum, Fedora’s easy-to-use desktop and productivity software. Fedora Unleashed, 2008 Edition covers a wide range of topics, from using the software you need every day for work, such as the OpenOffice.org productivity suite and the Firefox web browser, to configuring your Linux desktop to run smoothly using multiple printers, shell scripts, and more.
- Install and configure the Fedora 8 Linux distribution
- Manage Linux services and users
- Run a printer server with CUPS
- Connect to a local network and the Internet
- Set up and administer a web server with Apache
- Secure your machine and your network from intruders
- Rebuild and install a new Linux kernel
- Learn shell scripting
- Run other operating systems on Fedora with Xen
- Share files with Windows users using Samba
- Get productive with OpenOffice.org
- Play games on Linux
- Use Linux multimedia programs
- Use a database with Fedora
- Set up a firewall
- Set up a DNS server
- Work with the X Window system
- Learn Linux programming (including Mono)
Fedora 8 on DVD: DVD includes the Fedora 8 binary distribution with all the base Fedora packages plus hundreds of additional programs and utilities.
Free Upgrade! Purchase this book anytime in 2008 and receive a free Fedora 9 Upgrade Kit by mail (U.S. or Canada only) after Fedora 9 is released. See inside back cover for details.
About the Author
Andrew Hudson is a regular freelance contributor to Linux Format magazine, the UK’s largest Linux magazine. His particular area of expertise is Fedora and the Red Hat Enterprise Linux platform.
Paul Hudson is Editor of Linux Format magazine, a professional developer, and full-time journalist for Future Publishing. His articles have appeared in Mac Format, PC Answers, PC Format, PC Plus, and Linux Format.
Table of Contents
Part I Installation and Configuration
1 Installing Fedora 9
2 Fedora Quick Start 41
3 Working with GNOME 53
4 Command-Line Quick Start 77
Part II Desktop Fedora
5 On the Internet 105
6 Productivity Applications 125
7 Multimedia 147
8 Printing with Fedora 177
9 Games 191
Part III System Administration
10 Managing Users 203
11 Automating Tasks 231
12 System-Monitoring Tools 259
13 Backing Up 271
14 Networking 297
15 Remote Access with SSH 335
16 Xen 345
Part IV Fedora As a Server
17 Apache Web Server Management 353
18 Administering Database Services 389
19 File and Print 415
20 Remote File Serving with FTP 445
21 Handling Electronic Mail 479
22 Setting Up a Proxy Server 501
23 Managing DNS 511
24 LDAP 551
Part V Programming Linux
25 Using Perl 563
26 Working with Python 579
27 Writing PHP Scripts 599
28 C/C++ Programming Tools for Fedora 629
29 Mono 641
Part VI Fedora Housekeeping
30 Securing Your Machines 655
31 Performance Tuning 669
32 Command-Line Master Class 683
33 Writing and Executing a Shell Script 711
34 Advanced Software Management 737
35 Managing the File System 757
36 Kernel and Module Management 787
Part VII Appendices
A The History of Red Hat and Fedora 813
B Installation Resources 821
C Fedora and Linux Internet Resources 847
Welcome to Fedora Unleashed, 2008 Edition! This book covers the free Linux distribution named Fedora and includes a fully functional and complete operating system produced by the Fedora Project, sponsored by Red Hat.
Fedora is directly descended from one of the most popular Linux distributions ever: Red Hat Linux. Those of you who know nothing about Linux might have heard of Red Hat; it is enough to know that it is the largest Linux vendor in North America. Fedora benefits directly from many Red Hat engineers as well as the wider contributions from free software developers across the world.
If you are new to Linux, you have made a great decision by choosing this book. Sams Publishing's Unleashed books offer an in-depth look at their subjects, taking in both beginner and advanced users and moving them to a new level in knowledge and expertise.
Fedora is a fast-changing distribution that can be updated at least twice a year. We have tracked the development of Fedora from very early on to make sure that the information contained in this book mirrors closely the development of the distribution. A full copy of Fedora is included on the DVD, making it possible for you to install Linux in less than an hour!
This book provides all the information that you need to get up and running with Fedora. It even tells you how to keep Fedora running in top shape, as well as how to adapt Fedora to changes in your needs and requirements. Fedora can be used at home, in the workplace, or, with permission, at your school and college. In fact, you might want to poke around your school's computer rooms: You will probably find that someone has already beaten you to the punchLinux is commonly found in academic institutions. Feel free to make as many copies of the software as you want. No copyright lawyers are going to pound on your door, because Fedora is freely distributable all over the world.
After this brief introduction, you will get straight into the distribution, learning how to install and configure Fedora and find your way around the Gnome graphical interface and learning about the command line. We also take you through installing software, managing users, and other common administrative tasks. For the more technically minded, we cover some starting steps in programming across several languageswhy not pick one and give it a go? Through the book, you will also find information on multimedia applications, digital graphics, and even gaming for after hours when you are finished tinkering. After you make it through the book, you will be well equipped with the knowledge needed to use Linux successfully. We do assume that you are at least familiar with an operating system already (even if it is not with Linux) and have some basic computer knowledge. We round off the book by giving you some reference points for you to access via the web, and we also explore the origins of Fedora and Linux.
Changes from Previous Editions
Readers who may already own previous editions of Fedora Unleashed might wonder what work has gone into this edition. Well, we've overhauled the entire structure of the book, making it far faster for you to get stuck into Fedora.
We have also substantially rewritten several chapters and introduced new ones, such as Chapter 4, "Command-Line Quick Start," and others. This book also looks at the three main ways in which you can obtain Fedora: by using the DVD, Live CD, and KDE Live CD media. There are many changes to this book, and it's taken a long time to come to fruition.
An important thing to consider, given Linux's unique place in the market, is the licensing situation surrounding Fedora. Believe it or not, the software that you are about to install is 100% free in every sense of the word. You may have handed over your money for this book, but you can download the software itself for free from the Internet, or you can purchase a CD for a small price (usually to cover postage and packaging). Not only that, but you are able to examine the code behind all the packages and make changes yourself, if you want to. This is in stark contrast to other vendors, who charge you for the operating system and then prevent you from making any changes at the code level. It is this key difference that makes Linux into an open source operating system. Surprisingly enough, these vendors never actually sell you the software for you to own; rather, they give you only the right to use the software. As mentioned before, this is certainly not the case with the software included with this book. You are entirely free to make copies of the DVD, share them with friends, and install the software on as many computers as you wantwe encourage you to purchase additional copies of this book to give them as gifts, however. Be sure to read the Read Me file on the DVD included with this book for important information regarding the included software and disc contents. Look under the /usr/share/doc/fedora-release-8 directory after you install Fedora to find a copy of the GNU GPL (along with copies of other software licenses). You will see that the GPL provides unrestricted freedom to use, duplicate, share, study, modify, improve, and even sell the software.
You can put your copy of Fedora to work right away in your home or at your place of business without worrying about software licensing, per-seat workstation or client licenses, software auditing, royalty payments, or any other types of payments to third parties. However, be aware that although much of the software included with Fedora is licensed under the GPL, some packages on this book's DVD are licensed under other terms. There is a variety of related software licenses, and many software packages fall under a broad definition known as open source. Some of these include the Artistic License, the BSD License, the Mozilla Public License, and the Q Public License.
For additional information about the various GNU software licenses, browse to http://www.gnu.org/. For a definition of open source and licensing guidelines, along with links to the terms of nearly three dozen open source licenses, browse to http://www.opensource.org/.
Who This Book Is For
This book is for anyone searching for guidance on using Fedora, and primarily focuses on Intel-based PC platforms. Although the contents are aimed at intermediate to advanced users, even new users with a bit of computer savvy will benefit from the advice, tips, tricks, traps, and techniques presented in each chapter. Pointers to more detailed or related information are also provided at the end of each chapter.
Fedora's installer program, named Anaconda, makes the job of installing Linux as easy as possible. However, if you are new to Linux, you might need to learn some new computer skills, such as how to research your computer's hardware, how to partition a hard drive, and occasionally how to use a command line. This book will help you learn these skills and show you how to learn more about your computer, Linux, and the software included with Fedora. System administrators with experience using other operating systems will be able to use the information presented in this book to install, set up, and run common Linux software services, such as the Network File System (NFS), a File Transfer Protocol (FTP) server, and a web server (using Apache, among other web servers).
What This Book Contains
Fedora Unleashed is organized into seven parts, covering installation and configuration, Fedora on the desktop, system administration, Fedora as a server, programming and housekeeping, and a reference section. A DVD containing the entire distribution is included so that you will have everything you need to get started. This book starts by covering the initial and essential tasks required to get Fedora installed and running on a target system.
If you're new to Linux, and more specifically, Fedora, first read the chapters in Part I, "Installation and Configuration." You will get valuable information on the following:
- Detailed steps that take you by the hand through various types of installations
- Critical advice on key configuration steps to fully install and configure Linux to work with your system's subsystems or peripherals, such as pointers, keyboards, modems, USB devices, power management, andfor laptop usersPCMCIA devices
- Initial steps needed by new users transitioning from other computing environments
- Configuration and use of Gnome and X, the graphical interface for Linux
Part II, "Desktop Fedora," is aimed at users who want to get productive with Fedora and covers the following:
- Discovering the many productivity applications that come with Fedora
- Surfing the Internet and working with email and newsgroups
- Using Fedora to listen to music and watch video
- Using Fedora to download and manipulate images from digital cameras
- Setting up local printers for Fedora
- A look at the current state of gaming for Linux
Moving beyond the productivity and desktop areas of Fedora, Part III, "System Administration," covers the following:
- Managing users and groups
- Automating tasks and using shell scripts
- Monitoring system resources and availability
- Backup strategies and software
- Network connectivity, including sharing folders and securing the network
- Internet connectivity via dial-up and broadband connections
Part IV, "Fedora As a Server," looks at the opportunities provided by every Fedora system by covering the following:
- Building and deploying web servers
- Database creation, management, and manipulation
- File and print servers
- Using FTP for serving files across the Internet and local networks
- Building and deploying email servers with Postfix as well as managing mailing lists
- Creating remote access gateways and services
- Configuring DNS for your network
- Using LDAP for storing information on users and security
- Configuring a local news server
Part V, "Programming Linux," provides a great introduction into ways in which you can extend Fedora's capabilities even further, using the development tools supplied with it. This part covers the following:
- Programming in Perl, using variables and scripting
- An introduction to the Python language
- Writing PHP scripts and linking them to databases
- An introduction to the mono programming language
- C and C++ programming tools available with Fedora, and how to use the GNU C Compiler (gcc)
Part VI, "Fedora Housekeeping," looks at some of the more advanced skills you need to keep your system running in perfect condition, including the following:
- Securing your machine against attack from outsiders and viruses
- Performance tuning
- Command-line master class
- Advanced yum
- Kernel and module management and compilation
- Managing the file system
There is also an extensive reference in Part VII, "The Appendices," which gives you an opportunity to explore in even more depth some of the topics covered in this book. It also gives you some history on Fedora and Linux and an installation checklist.
Conventions Used in This Book
A lot of documentation is included with every Linux distribution, and Fedora is certainly no exception. Although the intent of Fedora Unleashed is to be as complete as possible, it is impossible to cover every option of every command included in the distribution. However, this book offers numerous tables of various options, commands, or keystrokes to help condense, organize, and present information about a variety of subjects.
This edition is also packed full of screenshots to illustrate nearly all Fedora-specific graphical utilitiesespecially those related to system administration or the configuration and administration of various system and network services.
To help you better understand code listing examples and sample command lines, several formatting techniques are used to show input and ownership. For example, if the command or code listing example shows typed input, the input is formatted in boldface like this:
If typed input is required, as in response to a prompt, the sample typed input also is in boldface, like so:
Delete files? Y/n y
All statements, variables, and text that should appear on your display use the same boldface formatting. In addition, command lines that require root or super-user access are prefaced with a pound sign like this:
# printtool &
Command-line examples that can be run by any user are prefaced with a dollar sign ($), like so:
The following elements provide you with useful tidbits of information that relate to the discussion of the text:
Note - A note provides additional information you might want to make note of as you are working, augment a discussion with ancillary details, or point you to an article, a whitepaper, or another online reference for more information about a specific topic.
Tip - A tip can contain special insight or a timesaving technique, as well as information about items of particular interest to you that you might not find elsewhere.
Caution - A caution warns you about pitfalls or problems before you run a command, edit a configuration file, or choose a setting when administering your system.
Sidebars Can Be Goldmines - Just because it is in a sidebar does not mean that you will not find something new here. Be sure to watch for these elements that bring in outside content that is an aside to the discussion in the text. You will read about other technologies, Linux-based hardware, or special procedures to make your system more robust and efficient.
Other formatting techniques used to increase readability include the use of italics for placeholders in computer command syntax. Computer terms or concepts also are italicized upon first introduction in text.
Finally, you should know that all text, sample code, and screenshots in Fedora Unleashed were developed using Fedora and open source tools.
Read on to start learning about and using the latest version of Fedora. Experienced users will want to consider the new information presented in this edition when planning or considering upgrades. New users, or users new to Fedora, will benefit from the details presented in this book.
© Copyright Pearson Education. All rights reserved.