Chapter 1. Introducing Fedora

IN THIS CHAPTER

  • What Is Fedora Core?

  • Fedora for Business

  • Fedora in Your Home

  • 64-bit Fedora

  • Getting the Most from Fedora and Linux Documentation

  • Fedora Developers and Documentation

  • Reference

Welcome to Red Hat Fedora 4 Unleashed! Fedora Core is a unique Linux distribution and is the first and primary product of The Fedora Project, an open-source, community-driven project sponsored by Red Hat. Fedora Core, or more simply, Fedora, is a base Linux distribution available free over the Internet at http://fedora.redhat.com. Alternatively, places like linuxcentral.com or even your local Linux user group can supply you with a copy if you don't have a good Internet connection.

Fedora represents an evolution in the business direction of its sponsor, Red Hat. For nearly 10 years, Red Hat provided copies of its commercial Linux distribution, Red Hat Linux, free over the Internet. All that changed in October 2003, when Red Hat discontinued the sale and free distribution of its consumer-oriented Red Hat Linux.

As the company has since its inception, Red Hat then released all its work on the freely licensed software in the former consumer distribution. The work, which was to be a new version of Red Hat Linux, was then merged with an existing Fedora Linux project and was reborn as Fedora Core. Red Hat now focuses its efforts on enterprise and corporate Linux-based products and services, but again, continues to make source code available for all its products that are under an open-source license.

Red Hat's Enterprise Linux is a series of software products aimed for corporate and enterprise migration, deployment, and use. Although all Linux distributions could be considered the same underneath because all use the Linux kernel, Red Hat takes special pains to create, test, sell, and support commercial Linux distributions optimized for deployment on multiple hardware and CPU architectures. These high-performance enhancements include hardware-tweaked Linux kernels, fail-over and load-balancing clustering, and integrated Java support—essential for mission-critical applications and production environments.

About Red Hat

Red Hat is one of the world's foremost open-source development houses and returns nearly all its development efforts back to the Linux development community.

The company has been involved in many open-source and GNU GPL projects, such as the Apache web server, the glibc software libraries, the GNU Network Object Model Environment (GNOME), various GNU software tools and packages, the Linux kernel and device drivers, the PostgreSQL database system, and the Red Hat Package Manager (RPM).

Red Hat also supports many other projects by providing FTP service and web hosting and is one of the few companies actively promoting and using the open source business development model. This means that, although many of its products are free, revenue streams are derived from spin-off and related technologies and services. These pursuits include embedded development (the open-source eCos operating system); training and certification programs such as the Red Hat Certified Engineer (RHCE) track; commercial software development; fee- and subscription-based support; consulting; and advanced software products, such as an advanced e-commerce platform, a secure web server, a credit card verification system (CCVS), and the Red Hat Database.

One possible reason for the success of Linux could be "Best hack wins." In other words, software that works well, fills a critical need, is readily available in source form, and is distributed under a free software license (such as the GNU GPL) will quickly spread and see extensive use. The growth in popularity and widespread adoption of Linux around the world is a testament to quality, licensing, and need for Linux.

Unix enjoyed a similar rapid-fire adoption after it was distributed in the early 1970s and fulfilled user needs on a number of fronts. However, its licensing was restrictive, caused much grief in some open-source communities (such as education), and continues to spawn problems to this day.

Here is the bottom line: You are holding nearly $1 billion worth of software in your hands. That is one estimate of what it would cost to develop as complete an operating system, graphical interface, and related software to equal the operating system included with this book.

It was not long ago that any new major project involving use of Linux by big business, government (on any level), or academia would have been big news. Today, Linux is increasingly used by IS/IT strategists for computing solutions. Linux and related open-source software rule the Internet. It is the host platform of choice for traditional server operations. Linux is poised to take over the desktop, occupying the number two spot behind a monolithic software entity.

NOTE

The list of Linux projects, efforts, and partnerships reads like a Who's Who of the software industry: Amazon, Ameritrade, Borland, Computer Associates, Dell, Hewlett-Packard/Compaq, IBM, Oracle, and SAP are just some of the enterprise-level players using Linux. Linux is also a key ingredient and shares an ever-increasing portion of server hardware sales from all large vendors, such as IBM, Hewlett-Packard/Compaq, and Dell.


What Is Fedora Core?

Fedora is the natural successor to Red Hat Linux and incorporates many of the features and software tools included with previous Red Hat Linux distributions. Red Hat Linux spawned many imitators in the Linux world in the past decade, and many of these imitators have gone on to create credible products and distributions.

As you learn in this chapter, Fedora is one of the most up-to-date Linux distributions available on the Internet. Here, you see why Fedora can be a good choice for a variety of computing environments and how, when combined with advances provided by the latest Linux kernel, it can provide multitiered support for the academic, home, small business, and even corporate user.

Inside Fedora Core

A complete copy of the Fedora Core distribution requires eight CD-ROMs, but only the first four are necessary for a full install of the operating system. Half of the distribution consists of source code for all the included software. More than 1,450 separate software packages are in Fedora Core. This distribution comprises the Linux kernel, installation utilities, thousands of pages of documentation, several thousand fonts, a comprehensive graphical networking interface, and several thousand individual commands and clients.

Fedora provides a base, or core, framework operating system and desktop comprised entirely of free software. Fedora includes the Bluecurve desktop theme and has an improved consistency in the two major graphical desktops available for use: the GNU Network Object Model Environment (GNOME) and the K Desktop Environment (KDE).

You can expect an extensive amount of Linux software to be supported by Fedora, and it is eventually expected to have an extensive library of contributed software packages outside the Fedora Core release. This means your first four Fedora Core CD-ROMs or DVD are just the beginning of a large collection of Linux software!

NOTE

Read more about GNOME and KDE in Chapter 6, "The X Window System."

Fedora provides the latest version of the X Window System and its server, X11R6 6.8.2, which sports improved and integral font handling. The Linux desktop has never looked better, and you will notice the difference when you browse the Web, use one of the dozen or so word processors and text editors included with Fedora, or view text at the command line in a terminal window.

If you are a veteran Red Hat user, you will feel at home with Fedora because it includes Red Hat's comprehensive suite of graphical administrative programs. The tools, shown in Table 1.1, combine and expand on the capabilities of standard Linux system utilities and are intended for use by the root operator (known as the superuser) to administer a Fedora system. The software takes the place of (and in some cases upgrades and augments) many of the legacy command-line-based tools traditionally used on a Unix system. You will learn how to use these tools throughout this book.

Table 1.1. Red Hat Software Tools Included with Fedora Core Graphical Administration Tools

Name

Description

neat

Creates, edits, and manages network devices

system-config-authentication

Manages user information and authentication protocol

system-config-bind

Configures Domain Name Service

system-config-boot

Manages boot loading

system-config-date

Sets date and time zone

system-config-display

Configures X to work with your PC hardware

system-config-httpd

Apache web server administration

system-config-keyboard

Configures keyboard type

system-config-kickstart

Creates automated install script

system-config-language

Sets system language

system-config-mouse

Configures mouse type and features

system-config-netboot

Configures network booting

system-config-network

Manages system network devices and settings

system-config-nfs

Configures Network File System

system-config-packages

Manages system software

system-config-printer

Creates, edits, and manages printers

system-config-proc

Manages kernel settings and processes

system-config-rootpassword

Sets and changes root password

system-config-samba

Manages a Session Message Block (SMB) server

system-config-securitylevel

Configures firewall service

system-config-services

Starts, stops, restarts, or sets boot services

system-config-soundcard

Configures Fedora for sound

system-config-time

Sets system date and time zone

system-config-users

Manages system users

system-switch-mail

Toggles use of Sendmail or Postfix email services

Fedora includes Internet programs such as Mozilla's open-source web browser, Firefox, along with productivity applications such as Ximian's Evolution (a mail, contact, and calendaring client) and OpenOffice.org (a Microsoft-compatible open-source office suite). You'll find all these and many more applications on this book's CD-ROMs and DVD.

Other major features are the inclusion of the latest GNU gcc compiler system, supporting C/C++ language program development. You will also get the newest version of the Apache web server, and the Common Unix Printing System (CUPS), which supports more than a thousand different printers.

Fedora Core, as the next generation of Red Hat Linux, is slated for upgrades two or three times a year, according to the Fedora Project. In reality, however, work never ceases on the distribution because open-source developers, along with Red Hat engineers, cross-pollinate Red Hat's Enterprise Linux and Fedora with software package upgrades, security updates, and bug fixes. Fedora's free, online upgrade system will be available via the Internet.

Red Hat uses a 12- to 18-month release cycle for Enterprise Linux. This cycle is required to provide third-party application developers time to test, deploy, and market products. In the past, Red Hat has used a 6-month release schedule for the consumer version of Red Hat Linux, with a 3- to 4-month beta cycle for development and testing. Fedora Core will have a similar schedule; the Fedora Project has stated it intends to "produce time-based releases of Fedora Core about two to three times a year."

As a Fedora user, you will be able to obtain the latest software for your system at any time using a variety of commands and software management tools:

yum— The Yellowdog Updater Modified, an automated software package manager based on RPM technology that resolves RPM dependencies.

apt-get— The APT command-line software package tool from The Debian Project, it's used to upgrade, install, check, or remove software.

system-config-packages— Red Hat's graphical package manager, it's used to install or remove applications (refer to Table 1.1).

rpm— The Red Hat Package Manager, which uses a database of installed packages to manage software on your system.

up2date— Red Hat's Red Hat Network update manager.

Distribution Version and Kernel Numbering Schema

There is a specific numbering system for Linux kernels, kernel development, and Fedora's kernel versions. Note that these numbers bear no relation to the version number of your Fedora Linux distribution. Fedora distribution version numbers are assigned by the Fedora Project, whereas most of the Linux kernel version numbers are assigned by Linus Torvalds and his legion of kernel developers.

To see the date your Linux kernel was compiled, use the uname command with its -v command-line option. To see the version of your Linux kernel, use the -r option. The numbers, such as 2.6.7-1, represent the major version (2), minor version (6), and patch level (7). The final number, (1), is the developer patch level and is assigned by the Fedora Project.

Even minor numbers are considered "stable" and generally fit for use in production environments, while odd minor numbers (such as a Linux 2.7 source tree) represent versions of the Linux kernel under development and testing. You will only find stable versions of the Linux kernel included with this book. You can choose to download and install a beta (test) version of the kernel, but this is not recommended for a system destined for everyday use. Most often, beta kernels are installed to provide support and testing of new hardware or operating system features.

Features of the Fedora Install

Installing Fedora can be accomplished in a number of ways. Many new users choose to simply boot from the first CD-ROM or from the DVD. The Fedora installer, named Anaconda (because it is written in the Python programming language), provides a default graphical interface for the installation process. The installer can be used to perform various initial actions before proceeding to an install, such as

  • Testing the installation media— Useful for testing the integrity of your copies of the Fedora CD-ROMs/DVD. If you download .iso images of the Fedora CDs or DVD, you can also use an MD5SUM client to compare the prepublished checksums for the media against your .iso files.

  • Testing your PC's memory— Useful for ensuring that your PC is in good form with functioning memory. Linux will use every available byte of RAM, and you should ensure that you do not run into problems after the operating system is installed.

  • Updating the installer before the install— In some cases, you might need to use the latest version of the installer to work around a bug or problematic hardware, and this option can be used to use a new version of the installer even though it is not on the CD-ROM or DVD.

  • Rescuing the system— In instances where a boot loader configuration has failed, or for some reason the system will not boot, the installer can be used to boot to a rescue mode; the existing file system can then be mounted and data can be rescued or the system reconfigured to resolve the problem.

  • Specifying hardware workarounds— Various options at the installer command line can be used to get around problematic or unsupported hardware posing an obstacle to your install.

  • Specifying an install method— Fedora Core can be installed from a hard drive partition or over a network using FTP, NFS, HTTP, or virtual networking.

See Chapter 3, "Installing Fedora," for specific details about various installer options. After the initial install and several screens to set install options, you can choose a class of installation, such as

  • Custom— This option is used to install your own selection of software packages, which can be useful to trim unwanted software from your new Fedora system.

  • Upgrade— Use this option to upgrade an existing Red Hat/Fedora system with the new Fedora desktop and software packages.

  • Server— Select this option to create a web, File Transfer Protocol (FTP), network file system (NFS), or other server.

  • Personal Desktop— Choose this install use the new Fedora desktop and create an Internet or multimedia workstation.

  • Workstation— Choose this class to install development software, such as the gcc compiler suite and other programming tools to create a development system.

Fedora's installation process also allows you to install Linux in a variety of ways, using a text-based or graphical interface. See Chapter 3 to learn how to install using CD-ROM/DVD, a hard drive, or a network. See Chapter 2, "Preparing to Install Fedora," for some important considerations to help you prepare to install Fedora.

Fedora File System Features

Fedora also uses the ext3 file system, developed by Dr. Stephen C. Tweedie and used by Red Hat's Enterprise Linux products. ext3 supports a form of low-level storage data handling known as journaling, previously available only under very expensive computer platforms. Journaling is accomplished using a variety of techniques, but the end result aims to ensure that data remains intact on the disk despite a system crash, a power outage, or other mishap.

However, because Fedora is designed to be flexible and accommodating of all new Linux technologies, you can use other file systems for your workstation or server. This includes IBM JFS, a journaled file system designed for servers and used on many enterprise-level platforms. If you want to take advantage of fast restarts and enjoy good performance and reliability, JFS can be used as an alternative to ext3. However, ext3 offers benefits such as quick switching between legacy ext2 file systems and widespread use in the Linux community.

NOTE

More information about IBM's JFS file system for Linux can be found at http://oss.software.ibm.com/jfs/.

NOTE

Read Dr. Stephen Tweedie's presentation, "EXT3, Journaling File System," at http://olstrans.sourceforge.net/release/OLS2000-ext3/OLS2000-ext3.html for more details. You can also read how ext3 is used with the 2.4-series Linux kernel by browsing to Andrew Morton's page at http://www.zip.com.au/~akpm/linux/ext3/index.html.

Other journaling file systems should be supported by Fedora (such as reiserfs) and have similar features.

Fedora also supports the creation of large RAID arrays, both via software using one or more storage devices and using hardware with specific device controllers. You can also use logical volume management (LVM), a sophisticated file system handling feature that allows parts of the file system (directory layout) to span one or more portions of separate physical storage media. This feature also allows resizing of the resulting partitions if system resource requirements change after initial configuration, and while the pertinent file systems are unmounted or mounted.

Other benefits of using Fedora are the inclusion of digital signature verification of RPM packages (for enhanced security), RPM package dependency resolution suggestion (to more easily fix dependency diagnosis), and the privoxy server (to help filter out unwanted web page pop-ups and so on).


Fedora for Business

Linux has matured over the last 10 years, and features considered essential for use in enterprise-level environments, such as CPU architecture support, file systems, and memory handling, have been added and improved. The addition of virtual memory (the capability to swap portions of RAM to disk) was one of the first necessary ingredients, along with a copyright-free implementation of the TCP/IP stack (mainly due to BSD Unix being tied up in legal entanglements at the time). Other features quickly followed, such as support for a variety of network protocols.

Fedora includes a Linux kernel that has the capability to use multiple processors. This allows you to use Fedora in more advanced computing environments with greater demands on CPU power. This kernel will support at least 16 CPUs, but in reality, small business servers typically only use dual-CPU workstations or servers. However, Fedora has the capability to run Linux on more powerful hardware.

Fedora will automatically support your multiple-CPU Intel-based motherboard, and you will be able to take advantage of the benefits of symmetric multiprocessors (SMPs) for software development and other operations.

The Linux kernels included with Fedora can use system RAM sizes up to 64GB, allow individual file sizes in excess of 2GB, and host the demands of—theoretically—billions of users.

Businesses that depend on large-scale, high-volume, and high-availability systems can now turn to Red Hat's Enterprise Linux products for stable, robust, scalable, and inexpensive solutions for various platform hosting. Storage requirements in the terabyte range, no lengthy file system checks, and no downtime are just a few of the minimum requirements in such environments.

However, Fedora can be used in many of these environments by customers with widely disparate computing needs. Some of the applications for Fedora include desktop support; small file, print, or mail servers; intranet web servers; and security firewalls deployed at strategic points inside and outside company LANs.

Commercial Red Hat customers will benefit from Red Hat's engineering and support teams because Red Hat works closely with many computer industry leaders, such as HP, Fujitsu Limited, and IBM. This enables Red Hat Enterprise Linux to work well on a wide range of computers such as laptops, mid-range Intel Xeon and Itanium platforms, and some of the most powerful enterprise-class servers in the world.

Red Hat also develops platform and development tools for other CPUs, such as the Xstormy16 CPU from Sanyo, NEC's VR5500 MIPS, Motorola's 128-bit AltiVec and Book E PowerPC e500, SuperH's SuperH SH-5, and Intel's Xscale-based chips.

Red Hat Enterprise Linux in Government

Red Hat Enterprise Linux has a presence in many government entities at various levels across the world. For example, the New Jersey State Police use a Red Hat–based Oracle system, whereas India's Centre for Development of Advanced Computing uses Red Hat Linux in its high-performance computing lab.

Use of Linux is expanding rapidly in the U.S. federal sector. Red Hat Enterprise Linux is on the General Services Administration Schedule, and the U.S. National Security Agency has offered a series of kernel patches to assist in building secure versions of Linux. This has quickened the development of SELinux within both Fedora and Red Hat Enterprise Linux. Other agencies and departments, such as the U.S. Air Force; U.S. Marine Corps; Federal Aviation Administration; NASA; and the Departments of Defense, Agriculture, and Energy also use Linux-enabled platform solutions from IBM and Hewlett-Packard/Compaq.

Small business owners can earn great rewards by stepping off the software licensing and upgrade treadmill and adopting a Linux-based solution. Using Fedora not only avoids the need for licensing accounting and the threat of software audits, but also provides viable alternatives to many types of commercial productivity software.

Using Fedora in a small business setting makes a lot of sense for other reasons as well, such as not having to invest in cutting-edge hardware to set up a productive shop. Fedora easily supports older, or legacy, hardware, and savings are compounded over time by avoiding unnecessary hardware upgrades.

Additional savings will be realized because software and upgrades are free. New versions of applications can be downloaded and installed at little or no cost, and office suite software is free.

Fedora is easy to install and network and plays well with others, meaning it works well in a mixed-computing situation with other operating systems.

A simple Fedora server can be put to work as an initial partial solution or made to mimic file, mail, or print servers of other operating systems. Clerical help will quickly adapt to using familiar Internet and productivity tools, while your business gets the additional benefits of stability, security, and a virus-free computing platform.

By carefully allocating monies spent on server hardware, a productive and efficient multiuser system can be built for much less than the cost of comparable commercial software. Combine these benefits with support for laptops, PDAs, and remote access, and you'll find that Fedora supports the creation and use of an inexpensive yet efficient work environment.


Fedora in Your Home

Fedora's Personal Desktop install copies a special set of preselected software packages onto your hard drive; these are suitable for small office/home office (SOHO) users. This option provides a wealth of productivity tools for document management, printing, communication, and personal productivity.

NOTE

Don't confuse Personal Desktop with Red Hat Enterprise Linux. Fedora is a free community project, so it can only include nonproprietary software. RHEL comes with specialist business applications that Red Hat licenses from other companies. Fedora and RHEL mirror each other in a number of ways but are not identical!

The Personal Desktop installation requires nearly 2GB of hard drive space but should easily fit onto smaller hard drives in older Pentium-class PCs. The install also contains administrative tools, additional authoring and publishing clients, a variety of editors, a GNOME-based X11 desktop, support for sound, graphics editing programs, and graphical and text-based Internet tools. You can customize the selection to include or sidestep installation of unwanted software. See Chapter 3 for details.

Connecting to the Internet is a snap, and Fedora supports modem dialup and other broadband connections, such as cable modems or digital subscriber line (DSL). See Chapter 18, "Internet Connectivity," for more information. When you do connect, you can do so in relative confidence because firewall protection from malicious intruders and other attackers can be thwarted by running the lokkit or system-config-securitylevel clients. See Chapter 17, "Network Connectivity," to learn how to set up a network.

If you have a digital camera, run the gphoto2 client to download, organize, and manage your digital images. You can then fine-tune your pictures by editing them using one of the finest digital image editors in the world: The GIMP. See Chapter 10, "Multimedia Applications," for details on editing graphics.

Fedora can be used for a variety of purposes, and every user has different needs. Some of them might be esoteric. For example, I use Fedora to program and manage thousands of frequencies on various radio scanners and amateur radio transceivers, run a high-frequency shortwave radio via a graphical interface on the desktop, host wireless (802.11a/b/g) printing for several workstations, manage digital recording of my favorite TV episodes, provide secure remote access via a firewall, and listen to my favorite music playlists via a server.


64-bit Fedora

Recent advances in computing saw the introduction of 64-bit x86-compatible CPUs from AMD in the spring of 2003. The only platform at launch to support the new technology was Linux, and even at the time of writing, it is still the only mainstream operating system actively using the power of the 64-bit x86 architecture. Intel's EM64T extensions for x86, which largely mirror the advances made by AMD, have further increased the availability of commodity x86-64 hardware.

As a direct response to the growing 64-bit user base, the Fedora project released an x86_64 version of Fedora Core 2, allowing the use of Fedora on AMD64 and Intel hardware. If you have a 64-bit CPU, you are strongly encouraged to get involved and have a go—just bear in mind that, because the architecture is still quite new, there might not be 64-bit versions of all the software you require.


Getting the Most from Fedora and Linux Documentation

Nearly all commercial Linux distributions include shrink-wrapped manuals and documentation covering installation and configuration. You will not find official documentation included on the CD-ROMs or DVD provided with this book. However, you can read or get copies of assorted manuals or topic discussions online at http://fedora.redhat.com/projects/docs/. There you will find the Fedora Project's links to various documentation projects.

You can also turn to Red Hat's official manuals and guides, particularly for Red Hat Linux 9, for interim information about Red Hat tools (such as those listed in Table 1.1) at http://www.redhat.com/docs/manuals/linux/RHL-9-Manual/. Note that the names that began with redhat-config in Red Hat Linux 9 now begin with system-config in Fedora Core.

Documentation for Fedora (and many Linux software packages) is distributed and available in a variety of formats.

Some guides are available in Portable Document Format (PDF) and can be read using Adobe's Acrobat Reader for Linux or the xpdf client. Guides are also available as bundled HTML files for reading with a web browser such as links, KDE's Konqueror, GNOME's Epiphany, or Firefox. Along with these guides, Red Hat provides various tips, frequently asked questions (FAQs), and HOWTO documents.

You will find traditional Linux software package documentation, such as manual pages, under the /usr/share/man directory, with documentation for each installed software package under /usr/share/doc.

Linux manual pages are compressed text files containing succinct information about how to use a program. Each manual page generally provides a short summary of a command's use, a synopsis of command-line options, an explanation of the command's purpose, potential caveats or bugs, the name of the author, and a list of related configuration files and programs.

For example, you can learn how to read manual pages by using the man command to display its own manual page like so:

$ man man

After you press Enter, you see a page of text appear on the screen or in your window on the desktop. You can then scroll through the information using your keyboard's cursor keys, read, and then press the Q key to quit reading. More information about using the command line can be found in Chapter 5, "First Steps with Fedora."

Many of the software packages also include separate documents known as HOWTOs that contain information regarding specific subjects or software.

If the HOWTO documents are simple text files in compressed form (with filenames ending in .gz), you can easily read the document by using the zless command, which is a text pager that allows you to scroll back and forth through documents (use the less command to read plain-text files). You can start the command by using less, followed by the complete directory specification and name of the file, or pathname, like this:

$ less /usr/share/doc/httpd-2.0.50/README

To read a compressed version of this file, use the zless command in the same way:

$ zless /usr/share/doc/attr-2.4.1/CHANGES.gz

After you press Enter, you can scroll through the document using your cursor keys. Press the Q key to quit.

If the HOWTO document is in HTML format, you can simply read the information using a web browser, such as Firefox. Or if you're reading from a console, you can use the links or lynx text-only web browsers, like this:

$ links /usr/share/doc/stunnel-4.0.5/stunnel.html

The links browser offers drop-down menus, accessed by clicking at the top of the screen. You can also press the Q key to quit.

If the documentation is in PostScript format (with filenames ending in .ps), you can use the gv client to read or view the document like this:

$ gv /usr/share/doc/iproute-2.4.7/ip-crefs.ps

Finally, if you want to read a document in Portable Document Format (with a filename ending in .pdf), use the xpdf client like this:

$ xpdf /usr/share/doc/xfig/xfig-howto.pdf

NOTE

This book was developed and written using a complete install of all the software included with Fedora. You can use the CD-ROMs and DVD included with this book for your install or download your own copy, available as ISO9660 images (with filenames ending in .iso), and burn it onto 700MB CDRs or a DVD.

Along with the full distribution, you will get the complete source code to the Linux kernel and source for all software in the distribution—more than 21 million lines of C and nearly 5 million lines of C++ code. Browse to http://fedora.redhat.com/download/ to get started.


Fedora Developers and Documentation

If you are interested in helping with the Fedora Project, you can assist in the effort by testing beta releases, writing documentation, and contributing software for the core or contributed software repositories. You should have some experience in installing Linux distributions, a desire to help with translation of documentation into different languages, or be able to use various software project management system, such as CVS.

Going beyond future versions of Fedora, you can also get involved with the continuing support of legacy versions. The Fedora Legacy project aims to provide security and critical bug fixes for retired versions of Fedora. Fedora Core 1 was the first version to be moved to the Fedora Legacy project, and future versions will be moved across once their operational lifetime is up. Because Red Hat views Fedora as a sand pit in which to test new technologies for possible inclusion into Red Hat Enterprise Linux, it is frequently updated and versions supersede each other. A rough guide of each version is supported for about 11 months, at which time it is moved into the Fedora Legacy Project. The project can be found at http://fedoralegacy.org—bear in mind that it is a community-supported project and, as such, is reliant upon the contributions of people just like you.

Reporting problems with Fedora Core during development is also part of the process! Bug reports are welcome and can be submitted according to guidelines outlined in Tammy Fox's and Havoc Pennington's Fedora Project Developer's Guide, found at http://fedora.redhat.com/participate/developers-guide/.

Writing documentation for Fedora requires a bit of discipline and experience with open-source document publishing tools. You can read more about the process by browsing to http://fedora.redhat.com/participate/documentation-guide/.

Mailing lists are also available as an outlet or forum for discussions about Fedora. The lists are categorized. For example, general users of Fedora Core can discuss issues on the fedora-list mailing list. Beta testers communicate via the fedora-test-list, developers via the fedora-devel-list, and documentation contributors via the fedora-docs-list. Mailing lists can be subscribed to by sending mail to name_of_the_list-request@redhat.com.


Reference

Each chapter in this book includes a "Reference" section listing links to additional or related information covered in the text. You can use these links to learn more about Fedora, Linux, and related technologies. You can also use the "Reference" section material to build custom sets of bookmarks to use while browsing or researching for more information about Linux.

http://www-1.ibm.com/linux/—Information from IBM regarding its efforts and offerings of Linux hardware, software, and services.

http://www.dwheeler.com/sloc—David A. Wheeler's amazing white paper covering the current state of GNU/Linux, its size, worth, components, market penetration.

http://fedora.redhat.com—Home page for the Fedora Project, sponsored by Red Hat, and your starting point for learning more about Fedora.

http://www.redhat.com/solutions/info/casestudies/—A listing of government and corporate Red Hat customers.

http://fedora.redhat.com/docs/—Web page with links to current Fedora documentation and release notes.

http://www.tldp.org—The definitive starting point for the latest updates to generic Linux FAQs, guides, and HOWTO documents.

http://www.ciac.org/ciac/—The U.S. Dept. of Energy's Computer Incident Advisory website, with details of security problems and fixes pertaining not only to Red Hat Linux, but many other operating systems. This site is useful for federal software contractors, developers, and system administrators.

http://www.justlinux.com/—One site to which new Linux users can browse to learn more about Linux.

http://fedorafaq.org/basics/—Another site that provides an easy introduction to Linux and Fedora.


Chapter 2. Preparing to Install Fedora

IN THIS CHAPTER

  • Planning Your Fedora Deployment

  • Hardware Requirements

  • Preparing for the Install Process

  • Partitioning Before and During Installation

  • Using Fedora's kickstart Installation Method

  • Reference

Proper preparation and planning before installation can pay big dividends later on. If you are deploying Linux using Fedora Core, you will need to decide how you want to put it to use.

Installing Linux for the first time can seem daunting to inexperienced users or system administrators, but this chapter shows you how easy the installation can be if you make some simple preinstallation plans and decisions. Disk partitioning can be one of the most unfamiliar parts of the installation process, but it's an essential step toward configuring a multiplatform system. As you learn in this chapter, disk partitioning also is a manageable process when you take the time to plan ahead.

In this chapter, you learn how to prepare for an effective, efficient Fedora Core installation. The chapter begins with a checklist of considerations that can help you to plan how you will use Linux after installation, so you can plan for making the right choices during the installation itself. This chapter also outlines some of the basic hardware requirements for using Linux (with some specifics for the Fedora Core release on this book's CD-ROMs and DVD), and it highlights some potential hardware problems you can plan for—and avoid. The chapter also walks you through a general overview of the installation process, and it offers in-depth planning advice for partitioning your hard disk to support different configurations.

As you are about to learn, Fedora is a flexible Linux distribution that can adapt to a variety of hardware configurations and can be installed in a number of ways.


Planning Your Fedora Deployment

Before planning the specific steps of an installation, you need to make decisions about the type of deployment you want to undertake. Computing needs dictate the type of hardware and software solutions required for a successful deployment, but before making the plunge, some hard questions need to have been asked and answered, such as, "How will you use Fedora?" You learn more about these issues in the sections that follow. These sections also include a table you can use as a pre-deployment planning checklist and some final advice for planning the installation.

Business Considerations

Choosing an operating system for use in your business is an important decision. Migration to or adoption of a new hardware or software platform can have immediate and long-term effects on your organization. There is no magic formula to use in the decision-making process when contemplating a move, and freelance consultants, small business owners, medium-sized business, corporations, and other large business organizations will have different computing resources, objectives, and needs. For many businesses, computers are a critical and sometimes central component of business operations.

NOTE

Browse to Red Hat's Migration Center at http://www.redhat.com/business/utol/success/ to read success stories, market analyses, and technical reports on using Red Hat's Enterprise Linux products for business.

Fortunately, Linux is flexible enough to provide a full or partial migration and supports all of the major computing services required in today's business operations. Some of the more traditional services include electronic mail, file servers, network services (including firewalls), printing, web hosting (Internet and intranet-based), and database servers. If you desire commercial support, Red Hat can provide one, more, or all of these services. Linux can also be put to work in stages to ease migration issues such as training or support.

Some of the ideas, issues, and concerns surrounding the Linux deployment are listed in Table 2.1, titled "Deploying Fedora." One consideration is the context of how Fedora will be put to work. In other words, how will the new operating system fit in with your existing hardware and software needs? Another consideration is the level of consensus in management and user willingness to change to or adopt a new software environment. However, this issue can be sidestepped by making the transition as invisible as possible to users, such as when Linux-based web, file, or printing services replace existing servers.

Table 2.1. Deploying Fedora

Consideration

Description

Applicability

How is Fedora going to be used?

Boot Management

Will remote booting be required?

Connectivity

Will the system be an intranet? Bandwidth requirements? Wireless? Mobile?

Context

How does this install fit in with academic, business, or corporate needs?

Consensus

Are managers and potential users on board with the project?

Comparison

Is this install part of platform comparison or benchmarking?

Development Platform

Will development tools be used?

Embedded Device

Is it an embedded device project?

Hardware

Are there any special hardware or device interfacing requirements?

Finance

How much is in the budget? Will cost comparison be required?

Marketing

Will a product or service be offered as a result?

Networking

What type of networking will be required?

Objective

Is there a specific objective of the install?

Power Management

Any special power or energy requirements?

Prototype Project

Is this a prototype or test install?

Public Relations

Does the public need to know?

Quality of Service

Is high availability or data integrity an issue?

Roadmap

What other steps might precede or follow the install?

Reporting

Are follow-up reports required?

Security

What level or type of security will be required?

Server

Is this a server installation?

Site Considerations

Does the location provide needed temperature and security, or does it even matter?

Software

Are any special device drivers needed for success?

Storage

Are there size or integrity needs? Has a backup plan been devised?

Timeline

Are there time constraints or deadlines to the install?

Training

Will special training be required for users or administrators?

Users

How many and what type of users are expected?

Workstation

Is this a workstation or personal desktop install? Is the workstation portable?

The transition cost is another issue to consider. Fedora offers flexibility and reliability, but transitioning to a new platform can have unforeseen costs. Linux detractors sometimes point to added Total Cost of Ownership (TCO) factors, such as support and training, and argue that these issues add significantly to the cost of a Linux migration. Although there might be some additional support costs, again, training might not be an issue, especially if Linux is invisibly deployed. Hidden charges might be offset by the low cost in licensing, deployment, scaling, maintenance, resource requirements, and support of legacy hardware.

You should know what you are going to do with Linux before you install it. In other words, what is the objective of your migration? If Fedora will be used as a replacement platform for network services, what services will be replaced? What types of applications will need support If Fedora is deployed as a new desktop for administrative users?

Some research might be required beforehand, and you might want to compare software performance of desired services against your existing infrastructure, using a time-lined prototype install or deployment. Such testing is not a special requirement unique to a Linux migration, but a normal part of a careful consideration process before investing time and effort—which will represent your major costs because Linux and its major software is free.

System Considerations

Fedora is a perfect solution for many computing needs. However, choosing an operating system platform mandates consideration of a number of issues. Some of these issues are listed in Table 2.1. For example, how you choose to use Fedora will affect your choice of computer hardware, might affect your network configuration, and could dictate software policy issues (such as access, security, and allowable protocols).

Linux-based operating systems can be used to provide many different services. For example, one server might be boot management for a thin-client network in which workstations boot to a desktop by drawing a kernel and remotely mounted file systems over a network. This mechanism is not supported out of the box, so some effort can be expended if such a system is required. Other services more easily implemented (literally in an hour or less) could be centralized server environments for file serving, web hosting for a company intranet, or bridging of networks and routing services.

Linux supports nearly every network protocol, which enables it to be used to good effect even in mixed operating system environments. The security features of the Linux kernel and companion security software also make Linux a good choice when security is a top priority. Although no operating system or software package is perfect, the benefit of open source of the kernel and other software for Linux allows peer review of pertinent code and rapid implementation of any necessary fixes. Even with the secure features of Linux, some effort will have to be made in designing and implementing gateways, firewalls, or secure network routers.

Fedora can serve as a development platform for applications, e-commerce sites, new operating systems, foreign hardware systems, or design of new network devices using Linux as an embedded operating system. Setting up workstations, required servers, source code control systems, and industrial security will require additional effort.

Hardware compatibility can be an issue to consider when setting up a Linux server or building a Linux-based network. Fortunately, enlightened computer equipment manufacturers are beginning to realize that Linux-based operating systems (like other open-source operating systems such as BSD) are increasingly popular, support open standards, and offer technologies that can help rapid introduction of products into the market (through third-party developer communities).

Fedora can help ease system administration issues during migration. The latest suite of Fedora's configuration utilities provide intuitive and easy to use graphical interfaces for system administration of many common services, such as networking, printing, and Windows-based file sharing. Fedora can also be used to support legacy application environment, such as DOS, if required.

User Considerations

Humans are creatures of habit. So it can be hard to transition a workforce, customer base, or other community to a new environment. The Fedora desktop, however, provides a friendly and familiar interface with menus and icons that new users can readily learn and put to work.

Part of the migration process can involve addressing user concerns, especially if Linux will take over the desktop. Fedora can be deployed in stages to make the migration process a bit easier, but the issue of user training will need to be addressed early on. This is especially true if users will be required to develop new skills or be aware of any caveats when using Linux (such as deleting all files in one's home directory). Although Fedora can be configured to provide a "turn-key" desktop in which only several graphical applications (such as a web browser, organizer, or word processor) can be used, some users will want and need to learn more about Linux.

You can turn to formal Linux training from commercial vendors. System administrators can get training directly from Red Hat (go to http://www.redhat.com/training). For other issues concerning Linux in larger computing environments, browse to Linas Vepstas's Linux Enterprise Computing pages at http://linas.org/linux/.

A Predeployment Planning Checklist

Table 2.1 provides a minimal checklist you can use to help plan a deployment.

Do not forget to address follow-up issues on your migration roadmap. You should pay attention to how satisfied or how well new users, especially those new to Linux, are adapting if a new desktop is used. However, if Fedora is deployed in a mixed environment, many users might not even know (or need to know) that Linux is being used!

Planning the Installation

There are many factors in favor of using Fedora Core as a computing solution. The current distribution can fill many different roles on various tiers and hardware platforms because its preconfigured installation scripts are a tailored fit for development, work station, e-commerce, server, and mobile platforms—only the required software will be installed.

Addressing concerns beforehand can help quell any worries or fears felt by new users. Some key factors for a successful installation include

  • Preparation— Thoroughly discuss the migration or deployment, along with benefits, such as greater stability and availability of service.

  • Preconfiguration— If possible, give users a voice in software choices or categories and poll for comments regarding concerns.

  • Correct installation— Ensure that the installed systems are working properly, including access permissions, password systems, or other user-related issues and interaction with the deployment.

  • The right hardware to do the job— Make sure that users have the hardware they need for their work, and that computers match the tasks required. For example, developers will have workstation requirements vastly different from administrative personnel.


Hardware Requirements

Fedora can be installed on and will run on a wide variety of Intel-based hardware. This does not include pre-Pentium legacy platforms, but many older PCs, workstations, rack-mounted systems, and multiprocessor servers are supported. Small, medium-sized, and even large-scale deployments of specially tuned Linux distributions are available through a number of companies such as IBM, which offers hardware, software, and service solutions (with more than 200 software solutions for clustering applications alone).

TIP

It is always a good idea to explore your hardware options extensively before jumping on board with a specific vendor. You can buy computer hardware with a Linux distribution preinstalled. At the time of this writing, Dell Computers offered Linux systems (such as desktop PCs and notebooks) through http://www.dell.com/redhat/. IBM also offers Linux on its product line, and more information can be found through http://www.ibm.com/linux/. To find HP and preinstalled Linux systems, browse to http://www.hp.com/linux/. You can also buy low-cost desktop PCs with Linux through Wal-Mart's online store at http://www.walmart.com (click to select the electronics department).

In the first section of this chapter, you learned to consider how Linux can be used in your environment and how you can prepare for its installation and deployment. These considerations also play a role in determining the types of hardware you need in your installation. But the type of deployment you choose also determines the hardware required for a successful deployment of Linux—and post-deployment satisfaction. The range of Linux hardware requirements and compatible hardware types is quite wide, especially when you consider that Linux can be used with mainframe computers as well as embedded devices.

Meeting the Minimum Fedora Core Hardware Requirements

The Fedora Project publishes general minimum hardware requirements for installing and using its base distribution in a file named RELEASE NOTES on the first CD-ROM, or available at http://fedora.redhat.com/docs/release-notes/. For the current release, your PC should at least have a 200MHz Pentium CPU, 620MB hard drive space, and 64MB RAM for using (and installing) Fedora without a graphical interface. For obvious reasons, a faster CPU, larger capacity hard drive, and more RAM are desired. Servers and development workstations require more storage and RAM.

Using Legacy Hardware

If you have an older PC based on an Intel 486 CPU with only 32MB RAM and a 500MB hard drive (which can be hard to find nowadays), you can install other Linux distributions such as Debian from The Debian Project at http://www.debian.org.

CAUTION

One caveat is that if you prepare a hard drive with Linux in a PC with one CPU, such as a Pentium, and then install the drive in a PC with a 486 CPU, you should either make sure that a 486-based Linux kernel is installed, or perform a post-install of an appropriate kernel after moving the hard drive.

Installing Fedora on legacy hardware will be easier if you choose to use more recent Pentium-class PCs, but even older Pentium PCs can be used and purchased at a fraction of their original cost. Such PCs can easily handle many mundane but useful tasks. Some of the tasks suitable for older hardware include

  • Acting as a firewall, router, or gateway

  • Audio jukebox and music file storage server

  • Handling electronic mail

  • Hosting a remote printer and providing remote printing services

  • Network font server

  • Providing FTP server access

  • Remote logging capture

  • Secondary network-attached backup server

  • Serving as an Intranet (internal LAN) web server

  • Unattended dial-up gateway, voice mailbox, or fax machine

  • Use as a "thin client" workstation for basic desktop tasks

Older PCs can handle any task that does not require a CPU with a lot of horsepower. To get the most out of your hardware, do not install any more software than required (a good idea in any case, especially if you are building a server). To get a little performance boost, add as much RAM as economically and practically feasible. If you cannot do this then cut down on memory usage by turning off unwanted or unneeded services. You can also recompile a custom Linux kernel to save a bit more memory and increase performance (see Chapter 38, "Kernel and Module Management").

NOTE

Fedora does not include XFree86 3.3.6. This version might be important because older, legacy video cards are no longer supported in the newer X11R6 7.0 distribution. You can download version 3.3.6 from The XFree86 Project, Inc. through http://ftp.xfree86.org/pub/XFree86/3.3.6/binaries/. Make sure to choose the appropriate version for your operating system!

Planning for Hard Drive Storage for Your Fedora Installation Class

Making room for Fedora requires you to decide on how to use existing hard drive space. You might decide to replace existing hard drives entirely, for example, or you might decide to use only one operating system on your computer, making partitioning unnecessary. A full install from this book's CD-ROMs or DVD will require at least 7GB hard drive space just for the software, so if you plan to install everything, a 10GB hard drive could be ideal for a workstation. Note that depending on how you plan to use Linux, a smaller capacity disk can be used, or a disk capacity many times the size of your system will be required.

NOTE

The following recommended installations and minimal storage requirements are based on a full install of the freely available version of Fedora Core distributed on the Internet. The copy of Fedora included with this book is the same, but you may find many additional software packages available from third-party Fedora contributors. Installing additional software will impact your storage requirements.

The Fedora installer offers a choice of installation types or classes, and each has its own hard drive storage requirements:

  • Workstation— You'll need a minimum of 3GB hard drive storage, but much more if you choose to install everything. This installation is intended for developers and other users who want to use the entire spectrum of Linux software offered by the distribution.

  • Personal Desktop— This is a new installation class for SOHO (small office/home office) users that installs a basic graphical desktop, along with requisite office and Internet productivity software; you'll need around 2.3GB of storage if you don't customize the default software selections.

  • Server— You need at least 1.1GB of storage for the operating system and server software, but you also must take into consideration other storage requirements. For example, if you plan to run a website with a lot of graphics or serve other files, you might need to add storage to your system or accommodate remotely mounted storage locally.

  • Custom— This installation supports a minimal install requiring a little over 600MB; however, you can also choose to install all the software in the distribution; in which case, you'll need 7GB or more of storage, along with several hundred megabytes of free space for temporary files.

The storage requirements for each of these classes can be revised somewhat, depending on the X desktop environment you choose (such as KDE or GNOME). Choosing the Custom install will let you choose specific software packages from the group package categories. Here are some software packages you might want to consider passing up in the installation process for a minimalist system:

  • X Window System

  • GNOME Desktop Environment

  • KDE Desktop Environment

  • Graphical Internet

  • Office/Productivity

  • Documentation

  • Sound and Video

  • Graphics

  • All Development software or libraries

Checking Hardware Compatibility

Fedora software for Intel-based PCs is compiled for the minimum x86 platform supported by the Linux kernel.

NOTE

The compatibility information in this chapter relates to Fedora Core. Other distributions might have different storage and CPU requirements.

Specific issues regarding Linux hardware compatibility can be researched online at a number of sites. Red Hat, Inc. offers a hardware compatibility database at http://hardware.redhat.com/hcl/. You can select hardware class, manufacturer, the version of Red Hat Linux, platform, and status of support.

Other sites, such as the Linux-USB device overview at http://www.qbik.ch/usb/devices/, offer an interactive browsing of supported devices, and printer compatibility can be researched at LinuxPrinting.org at http://linuxprinting.org/. Some hardware categories to consider in your research include

  • Controller cards— Such as SCSI, IDE, FireWire

  • CPUs— Intel, AMD, and others

  • Input devices— Keyboards

  • Modems— External, PCMCIA, PCI, and controllerless workarounds

  • Network cards— ISA, PCI, USB, and others

  • Pointing devices— Mice, tablets, and possibly touchscreens

  • Printers— Various printer models

  • RAM— Issues regarding types of system memory

  • Sound cards— Issues regarding support

  • Specific motherboard models— Compatibility or other issues

  • Specific PCs, servers, and laptop models— Compatibility reports

  • Storage devices— Removables, fixed, and others

  • Video cards— Console issues (X compatibility depends on version of X11R6 or vendor-based X distribution used)

If you have a particular laptop or PC model, you should also check with its manufacturer for Linux support issues. Some enlightened manufacturers now offer a Linux operating system preinstalled, or have an in-house Linux hardware certification program. Laptop users will definitely want to browse to Linux on Laptops at http://linux-laptop.net/.

If you cannot find compatibility answers in various on-line databases, continue your research by reading the Linux Hardware HOWTO at http://www.tldp.org/HOWTO/Hardware-HOWTO/.

At that address, you will find loads of general information and links to additional sources of information. Keep in mind that when PC hardware is unsupported under Linux, it is generally because the manufacturer cannot or will not release technical specifications or because no one has taken the time and effort to develop a driver. If you hit a roadblock with a particular piece of hardware, check the hardware manufacturer's support web pages, or Google.com's Linux pages at http://www.google.com/linux. You can then type in a specific search request and hopefully find answers to how to make the hardware work with Linux. This is also a good way to research answers to questions about software issues.

Preparing for Potential Hardware Problems

Fedora Core will work "out-of-the-box" with nearly every Intel-based Pentium PC motherboard and laptop; drivers for thousands of different types of hardware peripherals are included. But you can sometimes run into problems if Linux does not recognize a hardware item, if Fedora does not correctly initialize the hardware, or if an initialized item is incorrectly configured. For these reasons, some hardware items are prone to creating problems during an install. In the sections that follow, you learn some important pointers for avoiding these problems or resolving those that do occur.

Controllerless Modems

As you read earlier, most Linux hardware-related installation problems stem from a lack of technical specifications from the manufacturer, thwarting efforts of open-source developers to create a driver. In the recent past, one hardware item that triggered both types of difficulties was the controllerless modem, also colloquially known as a WinModem. The good news is that modem chipset manufacturers have been more forthcoming with driver details. Some original equipment manufacturers, such as IBM, have made a concerted effort to provide Linux support. Support for the ACP Mwave modem, used in ThinkPad 600/Es and 770s, is included in the Linux kernel. Drivers have been developed for many of the controllerless modem chipsets that formally did not work with Linux.

If a driver is not available for your controllerless modem, you have a few options. You can download the driver's source code and build the driver yourself. Alternatively, you can download a binary-only software package and install the driver.

Some controllerless modems might also need to be initialized and configured using a separate utility program. The modem, if supported, should work normally after installing and configuring the driver.

You can research Linux support for controllerless modems by browsing to http://www.linmodems.org/.

Universal Serial Bus Devices

Fedora supports hundreds of different Universal Serial Bus devices. USB is a design specification and a protocol used to enable a host computer to talk to attached peripherals. Because of lack of manufacturer and device ID information or lack of technical specifications regarding certain chipsets, some devices might not work with Fedora. USB 1.1 devices are designed to support data transfer speeds between 1.5 and 12Mbps.

Common USB devices include cameras, keyboards, mice, modems, network interfaces, printers, scanners, storage devices, video (such as webcams), and hubs (to chain additional devices). Some problematic USB devices (at the time of this writing) include

  • Wireless— Many 802.11b wireless USB network adapters, with the exception of those using Atmel chipsets.

  • Scanners— Many Canon, Visioneer, and Hewlett-Packard USB scanners

  • Webcams— Selected Logitech and Creative Labs webcams

Although some enlightened manufacturers are aware of opportunities in the Linux marketplace, most still do not support Linux. It pays to determine Linux support before you buy any USB device; again, research Linux USB support and its current state of development by browsing to http://www.qbik.ch/usb/devices/.

The newer USB 2.0 specification enables devices (such as hard and CD drives) to use speeds up to 480Mbps. Fedora supports USB 2.0 with the ehci-hcd kernel module. This driver, in development since early 2001, enables the use of many forms of newer USB 2.0 devices as long as you have a supported USB controller. Check out the current state of Linux USB 2.0 support by browsing to http://www.linux-usb.org/usb2.html.

Motherboard-based Hardware

Small form factor PCs, thin-clients, notebooks, and embedded devices are part of a growing trend in the PC industry. Manufacturers are cramming more functionality into fewer chips in order to simplify design and lower power requirements. Today, many computers come with built-in video graphics, audio chipsets, and network interfaces, along with a host of peripheral support.

Common modern (1996-onward) PC motherboard form factors are designed according to industry-assigned specifications (usually from Intel), and are ATX (12–9.6 inches); MicroATX (9.6–9.6 inches); and FlexATX (9–7.5 inches). One of the newest and even smaller motherboard forms is from VIA Technologies, Inc.—the mini-ITX (approximately 6.5–6.5 inches), which has an embedded CPU. CPUs commonly used in all these motherboards will vary, and have different socketing requirements based on chipset pins: Socket 478 for K7-type CPUs (from AMD); Socket 370 for Pentium IIIs and Celerons from Intel, or C3s from VIA; and Socket 478 for Intel's Pentium 4s (early versions of which used a 423-pin socket). Older socket types are Socket A, Socket 7 (and Super 7), Slot 1, and Slot 2.

Fortunately, nearly all controllers, bridges, and other chipsets are supported by Linux. Although flaky or unsupported built-in hardware can (usually) be sidestepped by installing a comparable PCI card component, cutting-edge notebook users are at the most risk for compatibility problems because internal components are not user-replaceable. Potential pitfalls can be avoided through careful research (vote with your money for Linux-compatible hardware), or by choosing PC motherboards with a minimum of built-in features, and then using PCI (Peripheral Component Interconnect) or AGP (Accelerated Graphics Port) cards known to work.

CPU, Symmetric Multiprocessing, and Memory Problems

Fedora supports all Intel-based Pentium CPUs. Code is included in the Linux kernel to recognize the CPU type when booting, and to then implement any required fixes to overcome architecture bugs (such as the now-infamous divide-by-zero error). After you install Fedora Core, you can also rebuild the Linux kernel to specifically support and take advantage of the host PC's CPU. You might not realize extreme improvements in computational speed, but you'll be assured that Linux is crafted for your CPU's architecture, which can help stability and reliability. Details about rebuilding the Linux kernel are in Chapter 38. Some of the Intel-based CPUs with specific supporting code for Linux include those from Advanced Micro Devices, Transmeta, and VIA Technologies.

Fedora's Linux kernel also should automatically recognize and use the amount of installed RAM. The Linux kernel should also recognize and map out any memory holes in system memory (perhaps used for video graphics).

If you are installing Fedora on a working, stable PC, you should not have any problems related to the system's memory. If you are putting together a new system, you need to avoid combining or configuring the system in ways that will interfere with its ability to process data. Some issues to be aware of are

  • Do not expect similar CPU performance across product lines from different manufacturers, such as AMD or VIA. Some CPU models offer better floating point or integer math operations, which are important for a number of CPU-intensive tasks (such as graphics, audio, and video rendering or conversion). If you need better performance, try to find a faster CPU compatible with your motherboard, or switch to a CPU with better Floating Point Unit (FPU) performance.

  • Overclocking can cause problems with overheating, memory access, and other hardware performance, and it is not a good idea for any Linux system. Overclocking is a popular geek pastime and a great way to get a bit of performance boost out of slower CPUs by altering voltage settings and/or clock timings via the BIOS. You can try to push your CPU to higher speeds, but this approach is not recommended if your aim is system stability. The Linux kernel will report the recognized CPU speed upon booting (which you can view using the dmesg command).

  • Along the same lines, CPU and motherboard overheating will cause problems. Proper attachment of the CPU's heatsink using a quality thermal paste (never use thermal tape), along with one or more fans providing adequate airflow will lessen the chance of hardware damage and system failure.

  • You can run into problems if you switch the type of CPU installed in your computer, and especially if your PC's BIOS does not automatically recognize or configure for newly installed mainboard hardware and components. In some instances, a system reinstall is warranted, but BIOS issues should be resolved first.

  • Not all CPUs support Symmetric Multiprocessing, or SMP. Fedora readily supports use of two or more CPUs, and during installation will automatically install an appropriate Linux kernel. You can avoid problems by reading the Linux SMP HOWTO (available through http://www.tldp.org). Note that some CPUs, such as the current crop of VIA C3s, may not be used for SMP. Also, SMP motherboards require that all CPUs be identical. This means that you will need two identical CPUs to take advantage of SMP.

  • Faulty or bad memory will cause Linux kernel panics or Signal 11 errors (segmentation faults) causing a system crash or a program to abort execution. Linux is quite sensitive to faulty hardware, but will run with great stability in a correctly configured system with good hardware. Problems can arise from incorrect BIOS settings, especially if video memory must occupy and use a portion of system RAM. Always install quality (and appropriate) memory in your PC to avoid problems.

Preparing and Using a Hardware Inventory

Buying a turn-key Linux solution is one way to avoid hardware problems, and many vendors are standing by, ready to prescribe solutions. However, managing deployments aimed at using existing hardware requires some information collection.

If you are a small business or individual user, you are well-advised to prepare detailed checklists of existing hardware before attempting a migration to Linux. Not only will you benefit from the collected information, but you might also be able to sidestep or anticipate problems before, during, or after installation. Problems are most likely to occur with newer hardware, cutting-edge hardware such as new motherboard chipsets and video cards, or extraneous hardware such as operating system–specific scanners, printers, or wireless devices.

Table 2.2 provides a comprehensive checklist you can use to take inventory of target hardware, such as the computer and any peripherals. Veteran Linux users can take the collected information to build custom systems by adding known hardware or substituting cheaper but equivalent hardware.

Table 2.2. System and Peripheral Inventory Checklist

Item

Errata

Audio Devices

Microphone:

Line out:

Line in:

BIOS

Type:

Revision:

ACPI:

APM:

CD-ROM Drive

Brand:

Type:

CD-RW Drive

Brand:

Type:

CDR Write Speed:

CD Re-Write Speed:

CD-ROM Read Speed:

DVD Drive

Brand:

Type:

DVD+/-RW Drive

Brand:

Type:

Digital Camera

Brand:

Model:

Interface:

CPU

Brand:

Socket Type:

Speed:

Firewire (IEEE 1394)

Chipset:

Device(s):

IrDA Port

Device number:

Port IRQ:

Keyboard

Brand:

Type:

Laptop

Brand:

Model:

Hibernation partition:

Legacy Ports

Parallel type:

Parallel IRQ:

RS-232 number(s):

RS-232 IRQ(s):

Mice

Brand:

Type:

Modem

Brand:

Type:

Motherboard

Brand:

Type:

Chipset:

Monitor(s)

Brand:

Model:

Horizontal freq:

Vertical freq:

Max. Resolution:

Network Card

Wireless:

Brand:

Type:

Speed:

PCI Bus

Version:

Model:

Type:

PCMCIA

Controller:

Cardbus:

Brand:

Type:

Printer(s)

Brand:

Model:

System RAM

Amount:

Type:

Speed:

S-Video Port

X Support:

Scanner

Brand:

Model:

Interface type:

Sound Card

Chipset:

Type:

I/O Addr:

IRQ:

DMA:

MPU Addr:

Storage Device(s)

Removable:

Size:

Brand:

Model:

Controller(s):

Rotational Speed:

Storage Device Controller

Type:

Tablet

Brand:

Model:

Interface:

Universal Serial Bus

Controller:

BIOS MPS Setting:

BIOS Plug-n-Play Setting:

Device(s):

Video Device(s)

Brand:

Model:

Xinerama:

Chipset:

VRAM:

Use the checklist in Table 2.2 as a general guideline for recording your computer's hardware and other capabilities. You can get quite a bit of information through hardware manuals or other documentation included with your PC, video, sound, or network interface card. Don't worry if you cannot fill out the entire checklist; Fedora will most likely recognize and automatically configure your PC's hardware during installation. Much of this information can be displayed by the dmesg command after booting. However, some of these details, such as your video card's graphics chipset and installed video RAM, can come in handy if you need to perform troubleshooting. You can also use the list as a post-installation check-off sheet to see how well Fedora works with your system.


Preparing for the Install Process

The basic steps in installing Fedora are to plan, install, and configure. You'll need to decide on how to boot to an install and how much room to devote to Linux. Then perform the install (a sample step-by-step installation is in Chapter 3, "Installing Fedora") and afterward, configure your system to host new users and specific software services. Much of the initial work will be done during the install process because the installer, Anaconda, will walk you through partitioning, configuring the desktop, and configuration of any recognized network adapter.

There are many different ways to install Fedora Core, and selecting an installation method might depend on the equipment on hand, existing bandwidth, or equipment limitations.

Here are some of the most commonly used installation methods:

  • CD-ROM/DVD— Using a compatible CD-ROM or DVD drive attached to the computer (laptop users with an external CD-ROM drive will need PCMCIA support from a driver disk image included under the first CD-ROM's images directory).

  • DOS— By using LOADLIN, you can boot to a Linux install by pointing LOADLIN to use a Fedora installation kernel and ramdisk. Run the DOS batch file, autoboot.bat, found under the dosutils directory on the first Fedora CD-ROM or DVD.

  • Network File System (NFS)— You can install Fedora from a remotely mounted hard drive containing the Fedora Core software. To do this installation, you need to have an installed and supported network interface card, along with a boot floppy with network support. (You learn how to make boot floppies later in this section of the chapter.)

  • File Transfer Protocol (FTP)— As with an NFS install, installation via FTP requires that the Fedora software be available on a public FTP server. You also need an installed and supported network interface card, along with a boot floppy with network support.

  • Hypertext Transport Protocol (HTTP)— As with the FTP and NFS installs, installation via HTTP requires that the Fedora software be available on an accessible website. You also need an installed and supported network interface card, along with a boot floppy with network support.

  • Installation via the Internet— If you have the bandwidth, it may also be possible to install Fedora via the Internet; however, this method might not be as reliable as using a Local Area Network (LAN) because of availability and current use of Fedora Project or other servers on mirror sites.

  • A hard drive partition— By copying the .iso images to a hard drive partition, you can then boot to an install.

  • Preinstalled media— It is also possible to install Linux on another hard drive and then transfer the hard drive to your computer. This is handy, especially if your site uses removable hard drives or other media.

NOTE

More esoteric installations may be possible. Some Linux distributions support booting to an install via an Iomega Zip drive, via the Parallel Port Internet Protocol (PLIP), and even a null modem cable supporting the Serial Line Internet Protocol (SLIP) or Point-to-Point Protocol (PPP). Browse to http://www.tldp.org and read Gilles Lamiral's PLIP Install HOWTO to see how to install Red Hat 7.0 using your PC's parallel port. Once installed, you can then try to upgrade to Fedora.

After booting and choosing to use either a graphical or text-based install interface, the installation procedure is nearly the same for each type of install. Chapter 3 walks you through a typical CD/DVD–based installation.

Preparing to Install from a CD-ROM

Installing Fedora can be as simple as inserting the first CD/DVD into your computer's CD drive and rebooting the computer. But if you choose this method, you should first make sure that your system's BIOS is set to boot from CD-ROM.

Entering the BIOS to make this change is usually accomplished by depressing a particular key immediately after turning on the computer, such as Del or F2. After entering the BIOS, navigate to the BIOS Boot menu, perhaps such as that shown in Figure 2.1.

Figure 2.1. To boot to an install using your Fedora Core CD-ROM or DVD, set your BIOS to have your computer boot using its CD drive.

    Previous Section < Day Day Up > Next Section


Partitioning Before and During Installation

Partitioning your hard drive for Linux can be done before or during installation.

If you plan to prepare your partitions before installing Linux, you'll need to use commercial partitioning software. Some of the popular commercial software you can use to create Linux partitions are Symantec's PartitionMagic or VCOM Products' Partition Commander. Alternatively, it may be possible to prepare partitions before installing Fedora by using the free FIPS.EXE command.

If you want to partition a hard drive using an existing Linux system, you can attach the hard drive to a spare IDE channel, and then use the Linux fdisk or GNU parted partitioning utilities. Both utilities offer a way to interactively partition and prepare storage media. Linux recognizes IDE hard drives using a device name such as /dev/hda (for the master device on IDE channel 0), /dev/hdb (for the slave device on IDE channel 0), /dev/hdc (for the master device on IDE channel 1), and /dev/hdd (for the slave device on IDE channel 1).

If a new hard drive is properly attached to your PC and you then boot Linux, you can see if the kernel recognizes the device by viewing the output of the dmesg command. You can then use fdisk with the device name to begin partitioning like so:

# fdisk /dev/hdb

Note that you will need root permission, and in this example, the new drive is attached as a slave on IDE channel 0. Do not change partitioning on your root device, or you'll hork your system! The fdisk command is interactive, and you can press m to get help when using the utility. You can use parted in much the same way if you specify the i, or interactive option on the command line like so:

# parted -i /dev/hdb

To get help when using parted interactively, press ? or type help followed a command keyword. The parted command has other helpful features, such as the ability to copy a file system directly from one partition to another.

Finally, you can prepare partitions ahead of installation by booting your system using a live Linux distribution (such as the LNX Bootable Business Card, available at http://www.lnx-bbc.org/) and then using a native Linux utility such as fdisk to partition your drive. For details on using the fdisk partitioning utility and alternative software tools to partition your hard drive, see the section "How to Access and Manipulate the Partition Table" in Chapter 37, "Managing the File System."

TIP

You can use the first Fedora CD or the DVD to perform other tasks aside from installing Linux. The CD-ROM/DVD features a rescue mode and can also be used to partition and prepare a hard drive for Linux. See Chapter 3.

NOTE

It is possible to create a dual-boot configuration, which allows the choice of booting Fedora and another operating system, such as Windows XP. To configure your system for dual-booting, you must first install Windows and then install Linux. Note that many Windows system-restore CD-ROMs will wipe out all data on your hard drive, including Linux. During installation of Fedora, you install the GRUB Linux bootloader in the primary drive's Master Boot Record, or MBR. When properly configured, GRUB allows your system to reboot to Windows or Linux. See Chapter 16, "Backing Up, Restoring, and Recovery," for information on using GRUB, or browse to http://www.gnu.org/software/grub/manual/ to read the GRUB manual.

CAUTION

Before you begin partitioning your drive, get your safety nets in order. First, back up all critical data! Any changes to your system's hard drive or operating system put your existing data at risk. To prevent the loss of time and resources that inevitably follow data loss, do full backups before you make any changes to your system. Create a bootdisk during the install (you will be asked before the install finishes), so you will be able to at least boot Linux if something goes wrong. See Chapter 16 for information on backups with Linux.

Choosing a Partitioning Scheme

Likedeployment and installation of Linux, partitioning your hard drive to accept Fedora requires some forethought, especially if the target computer is going to be used other than as a home PC on which to learn Linux.

If Linux is to be the only resident operating system, you can have the installer automatically create and use a partition scheme according to the type of installation you select during the install. If you plan to have a dual-boot system in which you can boot Linux or another operating system, you'll need to manually partition your hard drive before and possibly during the install.

The simplest and most basic partitioning scheme for a Linux system requires a Linux native root partition and a swap partition. On a single-drive system with 10GB storage and 128MB RAM, the scheme might look like this:

Hard Drive Partition    Mount Point    Size

/dev/hda1               /              9.74GB

/dev/hda2               swap           256MB

On a system running Windows, the scheme might look like this:

Hard Drive Partition    Mount Point    Size

/dev/hda1               /mnt/dos       2GB

/dev/hda2               /              7.74GB

/dev/hda3               swap           256MB

CAUTION

Notebook users should be careful when partitioning. Many notebooks use a special partition equal to the size of install RAM in order to perform suspend-to-disk or other hibernation operations. Always examine your computer's initial partitioning scheme if configuring a dual-boot system, and leave the special partition alone! One way around this problem is to use a software suspend approach as outlined at http://swsusp.sourceforge.net/.

Hosting Parts of the Linux File System on Separate Partitions

Your specific partitioning scheme will depend on how Fedora will be used. On a system being designed for expansion, greater capacity, or the capability to host additional software or users, you can use separate partitions to host various parts of the Linux file system. Some candidates for these separate partitions include

  • /home— Users will store hundreds upon hundreds of megabytes of data under their directories. This is important data, perhaps even more so than the system itself. Using a separate partition (on a different volume) to store this user data helps make the data easier to find, and it segregates user and system data. You will have to decide ahead of time how much storage to allocate to users. For a single work station, you should reserve several gigabytes of storage.

  • /opt— As the home directory for additional software packages, this directory can have its own partition or remote file system. Fedora does not populate this directory, but it might be used by other software packages you install later on. One gigabyte of storage should be adequate, depending on applications to be installed.

  • /tmp— This directory can be used as temporary storage by users, especially if disk quotas are enforced; as such, it could be placed on its own partition. This directory can be as small as 100MB.

  • /usr— This directory holds nearly all the software on a Fedora system and can become quite large if additional software is added, especially on a workstation configuration. Using a separate partition can make sense. A full install will require at least 6GB for this directory or more if additional software is added.

  • /var— Placing this directory (or perhaps some of its subdirectories) on a separate partition can be a good idea, especially because security logs, mail, and print spooling take place under this tree. You should reserve at least one gigabyte of storage for /var, especially if using Fedora as a print server (as spooled documents will reside under /var/spool).

TIP

As a general rule, it is a good idea to segregate user and system data. Although a Linux system can be quickly restored, user data has a much greater value and can be much more difficult to replace. Segregating data can make the job of backing up and restoring much easier. If you ever have a problem accessing your partition, we recommend that you get the excellent Knoppix distribution that boots and runs entirely from CD. This will enable you to access your partitions and make any necessary repairs.


Using Fedora's kickstart Installation Method

Automating the installation process can save system administrators a lot of time and effort during an initial deployment, upgrade, or maintenance cycle by managing multiple computers at one time. Fedora offers a highly automated installation technique called kickstart, developed by Red Hat, which can be used for unattended installation of Linux.

Fedora's kickstart installation uses a single configuration file with a special, extensive syntax on a server, boot floppy, or other medium to install Fedora via CD/DVD, a hard drive partition, or a network connection. Using kickstart is easy and involves passing a kernel argument to the Fedora Linux boot kernel. The various arguments tell the boot kernel to look for a configuration file on floppy, a designated server, via a network, specific file, or CD/DVD.

You can use kickstart to install Fedora on one or more computers at the same time. First, set up a web or FTP server with Fedora's installation files. For directions, see the section "Installing Using a Network" in Chapter 3. Next, create a network boot floppy using the techniques described in this chapter's "Creating a Boot and Auxiliary Driver Disk" section. Follow the directions given here (choosing an FTP install) and then copy the custom kickstart file to the network boot floppy. You can then use this floppy (and copies) to boot one or more PCs to a network install using your FTP server.

TIP

Fedora does not automatically install ksconfig, the utility used to create and customize kickstart files. Be sure you install it using either yum or the Add/Remove Programs tool.

To begin the automated installation process, you create the configuration file that will be used by kickstart as an installation profile. You can configure the complex configuration file with Fedora's Kickstart Configurator. To start the configuration, click the Kickstart item from the System Tools menu on the desktop, or run the system-config-kickstart or ksconfig command, like so:

# /usr/sbin/ksconfig

After you press Enter, you see the Kickstart Configurator dialog box, as shown in Figure 2.2.

Figure 2.2. Fedora's kickstart configuration tool, ksconfig, can be used to quickly and easily create installation profiles for use in automated installations.

[View full size image]

Click to select various options, and then enter the specifics desired for the target system. Start by selecting the default system language, type of keyboard, mouse, and so on. Of course, automated installations work best when installing to similar equipment. When finished, press Ctrl+S, or use the Save file item from the File menu. The configuration will be saved with the name ks.cfg. When you use the kickstart installation method, the kickstart file will be read by computers booting to the install. The kickstart language covers nearly every aspect of an install with the exception of sound card, printer, or modem setup.

For example, a portion of a kickstart file generated for an install might look like

#Generated by Kickstart Configurator

#System language

lang en_US

#Language modules to install

langsupport en_US

#System keyboard

keyboard us

#System mouse

mouse genericps/2

#System timezone

timezone --utc America/New_York

#Root password

rootpw --iscrypted $1$/n3yjyDV$AWoBZgRQq/lAxyRhX1JSM1

...

Note that not all the output of a sample ks.cfg is shown. However, you can see that this file will feed kickstart directions for an install, including an encrypted root password to be installed on the target system.

The next step is to copy your new ks.cfg to a boot disk created using one of the boot floppy images (found under the images directory on the first Fedora CD/DVD). You can do this with Linux by using the mount and cp commands. For example, take your boot disk, insert it into your PC, and then use the mount command (as root) like so:

# mount /mnt floppy

If Fedora has mounted your floppy automatically, you'll receive an error message such as /dev/fd0 already mounted. You can then simply copy the ks.cfg file to your floppy like so:

# cp ks.cfg /mnt/floppy

You can verify the contents of the floppy using the ls command like this:

# ls /mnt/floppy

boot.msg       general.msg     initrd.img        ks.cfg          ldlinux.sys

options.msg   param.msg      rescue.msg    snake.msg  splash.lss

syslinux.cfg    syslinux.png     vmlinuz

Then unmount the floppy using the umount command like so:

# umount /mnt/floppy

Remove the disk. It is now ready for use. When you use the disk to boot a PC, after booting, tell the install boot image that you'd like to perform a kickstart install like this:

linux ks=floppy

The installer will then use the specifications you outlined in the Kickstart Configurator and saved in ks.cfg to install Fedora.


Reference

The following is a list of references you can use to learn a bit more about partitioning, installation tools, and installing Fedora Core and Linux variants on a variety of hardware. You'll also find information about installation on hardware employed for embedded and mainframe solutions.

http://www.redhat.com/solutions/migration/—Red Hat's helpful Migration Center, with news, views, white papers, and other tips and research on migrating to a Linux solution.

http://www.yale.edu/pclt/BOOT/DEFAULT.HTM—A basic primer to partitioning that is operating system nonspecific.

http://www-1.ibm.com/linux/—Home page for Linux at IBM, with links to products, services, and downloads.

http://www-124.ibm.com/developerworks/opensource/linux390/—Home page for IBM S/390 Linux solutions.

http://www.dell.com/linux/—Dell Computer's Linux information pages.

http://hardware.redhat.com/hcl/—Entry point to Red Hat's hardware compatibility database.

http://www.linux1394.org/—Home page for the Linux Firewire Project, with information regarding the status of drivers and devices for this port.

http://www.linux-usb.org—Home page for the Linux USB Project, with lists of supported devices and links to drivers.

http://elks.sourceforge.net/—Home page for Linux for x286 and below CPUs, ELKS Linux.

http://www.lnx-bbc.org—Home page for the Bootable Business Card, a 50MB compressed Linux distribution that offers hundreds of networking clients, a live X session, web browsing, PDA backup, wireless networking, rescue sessions, and file recovery.

http://www.coyotelinux.com—Home page for several compact Linux distributions offering firewalling and VPN services; the floppy-based distribution works quite well on older PCs and does not require a hard drive.

http://www.freesco.org/—Home page for a floppy-based Linux router solution that works on 386 PCs, requires only 6MB RAM, and provides bridging, firewalling, IP masquerading, DNS, DHCP, web, telnet, print, time, and remote access functions.

http://www.bitwizard.nl/sig11/—A detailed overview of some root causes of Linux Signal 11 errors.

http://www.gnu.org/software/parted/parted.html#introduction—Home page for the GNU parted utility.

http://www.linux.org/vendors/systems.html—One place to check for a vendor near you selling Linux preinstalled on a PC, laptop, server, or hard drive.


Chapter 3. Installing Fedora

IN THIS CHAPTER

  • Before You Begin the Installation

  • Choosing How to Install Fedora

  • Step-by-Step Installation

  • Logging In and Shutting Down

  • Reference

In this chapter, you learn how to do a basic installation of Fedora. You will see how to boot and then install Fedora using the CD-ROMs included with this book. The chapter first shows how to prepare and research your install, choose a strategy on how Fedora will use your computer's hard drive, decide how to boot Fedora, and then how to complete the Fedora installation. You will get a step-by-step walkthrough of a sample installation, and then learn how to log in to Fedora and shutdown or reboot the system.


Before You Begin the Installation

Part of the process of installing Fedora (or any operating system for that matter) is to research how well the new operating system will fit into an existing hardware environment, or if new hardware will be required to host the operating system. The following sections provide some basic points to consider when installing Fedora and augment the checklists and ideas presented in Chapter 2, "Preparing to Install Fedora."

You start by researching and documenting your hardware. This information will prove helpful later on during the installation.

Research Your Hardware Specifications

You should first have a basic understanding of your system's hardware, such as the type of mouse, keyboard, or monitor, the amount of installed system memory, and the size of the hard drive. You need to know the storage capacity of your hard drive in order to choose a partitioning scheme, for example. Knowing the difference between a PS/2 and USB mouse will ensure proper pointer configuration—something that Fedora should do for you, but there is no harm being prepared. Such information will help make the installation as trouble-free as possible.

Use the checklist shown in Table 2.2 in Chapter 2 to inventory or at least record some basic features of your system. Some items you will need to know include the amount of installed memory, size of your hard drive, type of mouse, capabilities of the display monitor (such as maximum resolution), and number of installed network interfaces (if any).

Choose an Installation Type

You should also know what type of installation you plan to do beforehand (such as a workstation, server, firewall, gateway, router, development system, and so on). The type of install, or rather, the purpose of your intended install, will dictate the type and amount of software installed, and also influence hard drive storage requirements.

For convenience, the Fedora installer offers quick presets for a personal desktop, workstation, and server installation. Each type will install a set of preselected software libraries and applications. Use the custom installation option to select individual software packages and fine-tune your software selection. See Chapter 2 for details and hardware requirements for these installs.

NOTE

Although you can support nearly any operation (such as a development workstation or server) by installing all the software included with this book's CD-ROMs and DVD, this approach generally is not a good idea unless you are testing new hardware or learning how to use Linux at home. The reason for this is that installing extraneous software not relevant to support specific operations, especially in a business or production environment, can introduce security risks.

Choose Software Installation Options

Most new users with standalone Linux workstations will install all the software included with Fedora and depend on Red Hat's RPM technology (using up2date) or Fedora's support of yum to sort out and handle software dependencies (see Chapter 7, "Managing Software and System Resources," for more details about using these programs). Although Fedora is very stable and robust, crafting an efficient, stable, and working system can sometimes require consideration about the type of software to use given your existing hardware. For example, don't expect to run a fully loaded multimedia workstation if you plan to use Fedora Core on an early Pentium-based PC. However, that same PC can easily support email, print, or FTP server operations and even perform light duty as an intranet documentation web server.

Planning Partition Strategies

Part of planning a custom system involves implementing a partitioning strategy based on how you plan to use Fedora and, as previously mentioned, the capabilities of your existing hardware. For example, if you plan to host thousands of images or audio files, how much storage will you need? If you plan to back up this collection, will you use a tape drive, burn copies of directories onto optical media, transfer files across a network, or will you simply copy the files to another hard drive?

If you are planning an installation for a corporate or environment, you must also consider future expansion of the system. You will want to craft a flexible system that can evolve with your business and its system needs.

Knowing how software is allocated on your hard drive for Linux involves knowing how Fedora organizes its filesystem, or layout of directories on storage media. This knowledge will help you make the most out of hard drive space; and in some instances, such as planning to have user directories mounted via NFS or other means, can help head off data loss, increase security, and accommodate future needs. Create a great system, and you'll be the hero of information services.

To plan the best partitioning scheme, research and know the answers to these questions:

  • How much disk space does your system require?

  • Do you expect your disk space needs to grow significantly in the future?

  • Will the system boot just Fedora, or do you need a dual-boot system?

  • How much data will require backup, and what backup system will work best? (See Chapter 16, "Backing Up, Restoring, and Recovery," for more information on backing up your system.)

CD-ROM Installation Jumpstart

To install Fedora from the CDs or DVD included with this book, you must have at least a Pentium-class CPU, 800MB hard drive, and 64MB RAM. You will need at least 128MB to install using Fedora's graphical installer. A 10GB hard drive can easily host the entire distribution, leaving about 3GB free for other data. That said, hard disks are so cheap now that it costs almost the same to get an 80GB drive as it is to get a 20GB—even 250GB drives are affordable.

To begin the installation, set your PC's BIOS to boot from CD-ROM. Next, insert the first CD-ROM and boot your computer. Press Enter at the first screen and follow through the subsequent dialogs to install.

Remember or write down your system's root password. Also, even if you thoroughly test configuration of a graphical desktop during installation, you can choose to have Fedora boot to a text-based login (see the section "Step-by-Step Installation" later in this chapter). You can then start a graphical session after you finish the install, reboot, and log in. You can always set Fedora to boot to a graphical login later (see Chapter 6, "The X Window System," to see how).

If you have a floppy drive, create a boot disk during the install (see the "Step-by-Step Installation" section). Finally, finish the install, remove the CD-ROM from your computer, and reboot. Then log in and enjoy Fedora!

The Boot Loader

You will need to decide how to boot your system. For example, you can boot Fedora from a hard drive or floppy disk using the default boot loader, the Grand Unified Boot Loader (known as GRUB), use a commercial boot loader (as discussed in Chapter 2), or choose to not use a boot loader at all. Not using a boot loader can make booting Fedora difficult, but not impossible. For example, you can use another operating system such as DOS to jump-start to a Fedora session.

A boot loader is most often installed in the Master Boot Record (MBR) of an IDE hard drive, but can also be installed in the root Linux partition, or on a floppy disk. The boot loader can be used to pass essential kernel arguments to the Linux kernel for use during the boot process. Some arguments might include special disk geometry settings or specifying additional network interfaces. Fedora's boot loader, GRUB, supports special operations, such as booting from read-only memory (ROM) or flashed memory chips containing boot-loading code. Using a bootloader from floppy disk will work with many PCs, but you should be aware that not all PC hardware BIOS supports booting via Universal Serial Bus (USB) removable media or from a floppy disk. In fact, many PCs no longer include a floppy disk drive!

The GRUB loader works with all BSD Unix variants and many proprietary operating systems. This utility also supports menuing, command lines, installed RAM detection, and diskless and remote network booting. GRUB also offers password protection.

NOTE

Fedora's mkbootdisk command can be used to create floppy and CD-ROM boot media while using Linux. To do so, use the Linux kernel release number (returned by using the uname -r command) and a specified device. For example, to create a boot floppy, use the command like this:

# mkbootdisk --device /dev/fd0 `uname -r`

To create a CD-ROM boot image (which must then be burned onto a CD-R or CD-RW blank), use the command with its -iso option like this:

# mkbootdisk --iso --device boot_cd.img `uname -r`

Fedora can also be booted from a DOS session using the LOADLIN program, a DOS PATH to the Linux kernel, and the location of Linux kernel, such as

LOADLIN c:\KERNEL\VMLINUZ root=/dev/hda2 ro

In this example, the kernel named VMLINUZ is loaded, and the second primary partition of the first IDE hard drive is specified at the root (/) partition of a Linux system.

NOTE

If you find that LOADLIN fails to boot Linux and complains about a large kernel size, you can either try using make bzimage to build a smaller kernel or rebuild a kernel that relies less on built-in features and more on loadable modules. See Chapter 38, "Kernel and Module Management," for more information.

When choosing a commercial boot loader, weigh its capabilities and options. A good boot loader will support multiple operating systems, the ability to boot different Linux kernels (in order to change the characteristics of a system or easily accommodate new hardware), password protection, custom boot displays, and sane defaults, such as requiring verification before overwriting existing configurations and accommodating other recognized filesystems or previously installed boot code.

If you run into trouble after installing Fedora Core, make sure to read the documentation for your boot loader to acquire any diagnostic information. Most boot loaders will report on any problems, and the solution might be commonly fixed. Your best (and least expensive) bet is to use GRUB because it is the default boot loader for Fedora Core.


Choosing How to Install Fedora

Fedora can be installed in a variety of ways using different techniques and hardware.

Most users will install Fedora by booting to the installation directly from a CD or DVD. Other options include

  • Booting to an installation using a floppy disk.

  • Booting to an installation using Fedora's mini CD-ROM.

  • Using a hard drive partition to hold the installation software.

  • Booting from a DOS command line.

  • Booting via a virtual network session. (See the file Release Notes included on the first Fedora CD-ROM for details.)

  • Booting to an installation and installing software over a network using FTP or HTTP protocols.

  • Booting to an installation and installing software from an NFS-mounted hard drive.

How you choose to install (and use) Fedora depends on your system's hardware, networking capabilities, corporate information service policy, or personal preference. The following sections describe the issues surrounding each of these types of installation.

Installing from CD or DVD

Most PCs' BIOS support booting directly from a CD or DVD drive, and offer the capability to set a specific order of devices (such as floppy, hard drive, CD-ROM, or USB) to search for bootable software. Turn on your PC, set your PC's BIOS if required (usually accessed by pressing an F or Del key after powering on); then insert Fedora's first disc, and boot to install Fedora.

To use this installation method, your computer must support booting from your optical drive, and the drive itself must be recognizable by the Linux kernel. You can verify this by checking your BIOS and then booting your PC.

Older PCs might prove problematic when you desire to boot to an install using optical media. The good news is that this should no longer be a problem with most post-1995 personal computers.

The file boot.iso is a 4.5MB CD-ROM image found under the images directory on the first Fedora CD-ROM. The image can be burned onto a CDR, mini CDR, or business-card sized CDR and supports booting to a network install. This is a convenient way to boot to a network install on a PC with a bootable CD-ROM drive, but no installed floppy drive, or when you don't want to use multiple floppies during an install requiring driver disks.

You burn the image onto optical media using the cdrecord command. For example, copy the file to your hard drive, insert a blank CDR into your CDRW drive, and then use a command line like so:

# cdrecord -v speed=4 dev=0,0,0 -data -eject boot.iso

This example will create a bootable CD-ROM, and then eject the new CD-ROM after writing the image. The speed (4 in this example) depends on the capabilities of your CD writing device. The device numbers are those returned by running cdrecord with its scanbus option, like so:

# cdrecord -scanbus

Installing Using a Network

Fedora can be installed using a local network (or even over the Internet if you have broadband access). You will need access to a web, FTP, or NFS server hosting the installation packages. To boot to a network install, use a network boot floppy, a bootable CD-ROM created using the boot.iso boot image, or the first Fedora Core CD-ROM included with this book. Boot your PC with the boot floppy or, if you use CD-ROM, type linux askmethod at the boot prompt. Follow the prompts, and you'll then be asked to choose the type of network installation.

TIP

Just press Enter at the boot prompt if you boot to a network install using a CD-R created with the boot.iso image. You will boot a graphical network install.

To install using FTP, select the network IP address assignment for your target PC, such as DHCP, or manually enter an IP address along with optional gateway IP address and nameserver addresses. You will then be asked for the FTP site name. You can enter the name or IP address of a remote FTP server hosting the Fedora release. The name of the remote directory will depend on where the Fedora install files are located on the remote server.

Installing Fedora using the File Transfer Protocol (FTP) will require access to an FTP server (see Chapter 22, "Remote File Serving with FTP," to see how to set up a server and use FTP). You'll need to know the hostname or IP address of the server, along with the path (directory) holding the Fedora Core software. One way to prepare a server to host installs is to

1. | Create a directory named Fedora under the FTP server's pub directory. The directory will usually be /var/ftp/pub on a Linux server.
2. | Create a directory named base and a directory named RPMS underneath the Fedora directory.
3. | Copy or download all RPM packages included with Fedora Core into the pub/Fedora/RPMS directory.
4. | Copy all original base files (comps.rpm, comps.xml, hdlist, hdlist2, hdstg2.img, netstg2.img, stage2.img, trANS.TBL) from the first CD-ROM's base directory into the pub/Fedora/base directory.

Using this approach, enter pub when asked for the name of the remote directory holding the Fedora Core install software.

Installing Fedora using a remotely mounted Network File System (NFS) is similar to a hard drive installation, but requires access to an NFS server. You will need access permission, a permitted IP address or hostname for your computer, the hostname or IP address of the NFS server, and the path to the Fedora software. See Chapter 17, "Network Connectivity," for more information about NFS and network addressing.

To install Fedora using HTTP, you will need the hostname or IP address of the remote web server, along with the directory containing Fedora's software. See Chapter 19, "Apache Web Server Management," to see how to set up a web server.

NOTE

See Chapter 22 for details on how to configure the vsftpd FTP server. Chapter 19 provides information on how to set up and configure Apache for web service. See Chapter 17 for Samba settings. Note that you can have your server perform all three duties.


Step-by-Step Installation

This section provides a basic step-by-step installation of Fedora from CD-ROM. There are many different ways to proceed with an install, and the installer can provide a graphical or text-based interface in a variety of modes.

This example installation prepares a computer for general duties as a server, perhaps to host a File Transfer Protocol (FTP) site, a web server using Apache, or Session Message Block (SMB) services using Samba.

Before you begin, you should ensure that your computer is not connected to the Internet. Although you can use the installer to set up network protection during the install, it is best to check your system settings after any install and before opening up any public services (see the section "Firewall and Security Configuration" later in this chapter).

TIP

If you are installing to a system that has an older display monitor, it is a good idea to have your monitor's manual handy during the installation. If the install does not detect your monitor settings, you might need to specify the monitor's vertical and horizontal frequencies. This does not happen often, but if it does, you will be prepared.

NOTE

Fedora's graphical installation dialogs are convenient and easy to use. However, you can use a text-based installation, which works with any PC. Simply specify linux text at the install boot prompt. Use the graphical install outlined here as a starting point for learning more about installing Fedora.

Starting the Install

To get started, insert the first Fedora disc and reboot your computer. You'll first see a boot screen that offers a variety of options for booting (see Figure 3.1). Options may be passed to the Linux install kernel by typing special keywords at the boot prompt. Note that the install kernel is different from the kernel that will be installed on your system during installation!

Figure 3.1. Select an installation option in this first Fedora Core boot screen.

[View full size image]

The basic options most often used are

  • <ENTER>— Starts the install using a graphical interface. The graphical interface supports a mouse and offers check boxes and text fields for choosing software, configuring options, and entering information.

  • linux text— Starts the install using a graphical text interface.

To install using a text-based interface (used for our example), type linux text and press Enter; otherwise, just press Enter to start the install.

Several function keys can be used at this first boot screen to cycle through four help screens providing additional install information. Use these function keys at the boot prompt to jump to different screens describing alternative installation options and modes:

  • Pressing F1 returns to the initial boot screen.

  • Pressing F2 details some boot options.

  • Pressing F3 gives general installation information (described next in this chapter).

  • Pressing F4 describes how to pass kernel video arguments, useful for configuring video hardware to support a graphical install at a specific resolution (such as 800 x 600 pixels).

  • Pressing F5 describes Fedora's rescue mode.

Some of the options you can use at the boot prompt include

  • linux noprobe— Disables probing of the system's hardware.

  • linux mediacheck— Verifies the integrity of one or more install CD-ROMs.

  • linux rescue— Boots to single-user mode with a root operator prompt, disabling X, multitasking, and networking; this option can be used if you need to reconfigure your boot loader or to rescue data from your system.

  • linux dd— Uses a driver disk (a floppy image) and possibly one or more kernel arguments (such as linux mem=512M expert) to enable certain types of hardware, such as networking cards.

  • linux askmethod— Prompts for the type of install to perform, such as over a network.

  • linux updates— Starts an installation update.

  • memtest86— Starts a cyclical, intensive series of memory tests of your PC's RAM.

  • linux nofb— Starts a graphical installation, but does not use a framebuffer (helpful with problematic or unsupported video).

  • linux resolution=width x height— Installs using a graphical display of width-by-height pixels (such as resolution=800x600), which can help match older or less capable display monitors and video cards.

The F4 screen lists options that can be used at the boot prompt to set a specific resolution for the installation. For example, this is done by typing linux resolution= at the boot prompt, along with an option such as "800x600". Other options, such as optional arguments for kernel modules (in order to properly configure or initialize hardware) may be passed to the install kernel if you use the noprobe option.

TIP

The installer will start automatically in 60 seconds. Press the spacebar, reboot, or turn off your PC if you need to halt the install.

After you press Enter, the installer's kernel loads, and you're asked (in a text-based screen) if you would like to perform a media check of your CD-ROM, as shown in Figure 3.2.

Figure 3.2. You can check your CD-ROM media before installing Fedora.

[View full size image]

This check can take quite some time (depending on the speed of your CD drive), but can ensure the integrity of the CD-ROM's contents, as an md5sum value is embedded on each CD-ROM. This check can help foil installation of malicious software from CD-ROMs with tampered contents. The check can also be helpful to make sure that the CD-ROM you are using will work on your PC and in your CD drive. To perform the check, choose OK; otherwise, use the Tab key to navigate to the Skip button and press Enter to choose it.

After checking your CD-ROM or skipping the check, the display will clear. The Fedora installer, Anaconda, will load, and you are presented with a graphical welcome screen as show in Figure 3.3. The installer should recognize your PC's graphics hardware and mouse. You can then click on the Release Notes button to get detailed information about Fedora Core, along with tips on hardware requirements and how to perform various installs.

Figure 3.3. Read Help or Release Notes before installing Fedora.

[View full size image]

If your pointing device (mouse) is not recognized, you can press Alt+R to "press" the Release Notes button. Similarly, you can click Alt+H to hide text shown on the left side of the screen, but you should take a minute to read frame's contents.

Click Next (or press Alt+N) to continue, and the installer asks you to select one of 31 different languages for the installation, as shown in Figure 3.4.

Figure 3.4. Select a language to use when installing Fedora.

[View full size image]

You can navigate the installer's dialogs (during a text-based or graphical install) using the Tab key. You can scroll through lists using your cursor keys. Note that you can now "step backward" through the install by using a Back button. Select a language and click the Next button.

You'll then be asked to select a keyboard for the install, as shown in Figure 3.5.

Figure 3.5. Select a default keyboard to use when installing and using Fedora.

[View full size image]

Scroll to the appropriate keyboard option. You use this option to configure the install to support one of 53 different language keyboards. Click Next after making your selection.

If your PC's monitor was not detected, you might be asked to select your model from 132 different manufacturers. In rare instances, you might have to specify your monitor's exact horizontal and vertical frequencies. This can happen with older displays.

If an existing Linux install is detected, you'll be asked if you want to upgrade and reinstall; otherwise, you're then asked to select a type of installation, as shown in Figure 3.6.

Figure 3.6. Select a type of installation.

[View full size image]

Select a type of installation suitable for your intended use—we'll use a Server install for our example. As we mentioned earlier, you can use the Custom install instead to select the specific packages to be installed. This can be helpful in order to prune unnecessary software from your system and might save some time later on. After you select the installation type, click Next to continue. You will then see a screen that offers a choice of partitioning schemes and tools.

NOTE

Fedora's installer also supports the ability to monitor background and install processes running during an installation. You can watch the progress of an install and hardware information reported by the Linux install kernel by navigating to a different console display or virtual console by simultaneously pressing the Ctrl, Alt, and appropriate Fn key (such as F1–F5).

Use this approach to watch for kernel messages, monitor hardware detection, gain access to a single-user shell, and view the progress of the installer script.

When using a graphical installer, press Ctrl+Alt+F4 (then Alt+F2 or Alt+F3) to navigate to the various screens. Press Alt+F7 to jump back to the installer. When performing a text-based installation, use Alt+F2 (then Alt+F3 or Alt+F4). Use Alt+F1 to jump back to a text-based install.

Partitioning Your Drive

You learned how to choose and plan a partitioning scheme in "Planning Partition Strategies," earlier in this chapter, based on the more specific partitioning information offered in Chapter 2. The Disk Partitioning Setup screen, shown in Figure 3.7, offers two options for disk partitioning. Here is what the options do:

  • Using the Automatically Partition button conveniently partitions your hard drive according to the type of installation you selected and configures the partitions for use with Linux.

  • Choosing the Manually Partition with Disk Druid button launches a graphical partition editor that enables the creation of custom partition schemes.

Figure 3.7. Select a partitioning scheme or tool.

[View full size image]

NOTE

See the section "Partitioning Before and During Installation" in Chapter 2. Chapter 10, "Multimedia Applications," contains information on using another partitioning utility, the text-based Linux fdisk command.

For this example, select Manually Partition with Disk Druid button and click Next. If you are using a new hard drive that hasn't previously been partitioned, you will be asked if you would like to create new partitions on the drive. Click the Yes button to initialize the drive. If you are using a hard drive that has been previously partitioned or formatted and the partitions are recognized, Disk Druid will present the partitions in its partition dialog. Figure 3.8 shows the graphical interface presented for a 6GB hard drive that hasn't been partitioned.

Figure 3.8. You can use Disk Druid to partition your drive before installing Fedora.

[View full size image]

To use Disk Druid, select any listed free space, and then click the New button (or press Alt+W) to create a new partition. Alternatively,

  • To get help, see the help frame on the left.

  • To create free space, scroll to an existing partition and use the Delete button to delete the partition.

After you choose the New button, you see a screen as shown in Figure 3.9.

Figure 3.9. Set partition information about a selected or new partition on a hard drive.

[View full size image]

You use the Add Partition dialog to assign a mount point (such as /boot or /), assign a filesystem (such as ext2, ext3, RAID, swap, or vfat) by using the drop-down menu set at ext3 by default, and assign the size of the partition. Remember that, at a minimum, your system should have a root (/) and swap partition. The ext3 filesystem is the best choice for your Linux partitions because it is the default and specifically supported by Fedora, but you can also use ext2 (and convert to ext3 later on—see Chapter 37, "Managing the File System"). The size of the partition can be fixed by entering a number (in megabytes), or if you select the Fill All Available Space field, will use all remaining free space (but not yet, as you need to create a partition for swap). Click OK to save the new partition information.

TIP

You can perform diagnostic checks on your storage media after installing Fedora by using various Linux software tools, as shown in Chapter 37.

Remember: Linux requires at least a root (/) and swap partition. The swap partition should be about twice as large as the amount of installed memory (or more) in order to get the most from your computer if you run a lot of programs or host many users. After you create an initial partition for the root filesystem, repeat the steps to create a new partition, but select swap as the filesystem type using the drop-down menu. Figure 3.10 shows a simple, completed partitioning scheme with a separate /home partition on a server using a 6GB hard drive.

Figure 3.10. Review your partitioning scheme for your hard drive.

[View full size image]

Take a moment to review your partitioning scheme. If you are not satisfied with the partitioning, you can make changes by selecting a partition and then using the Edit button to change the partition's information (such as mount point or type of filesystem). Use the Delete button to delete the partition entry and to free up partition space. You can then use the New button again to create partitions in the space that is now free. When satisfied, click Next to continue the install.

Choosing, Configuring, and Installing the Boot Loader

After you accept the partitioning scheme, a screen appears asking you to select a boot loader for booting Fedora (see Figure 3.11). This screen also enables you to choose not to use a boot loader (when booting from floppy, a commercial boot utility, a DOS partition, or over a network), and the ability to boot other operating systems if you have configured a dual-boot system. Review "Choosing a Boot Loader," shown previously in this chapter, for more information on making this choice.

Figure 3.11. Select whether you want to use a boot loader and configure other boot options.

[View full size image]

TIP

Fedora will work well with other operating systems, but the reverse is not always true. If you need specialized help with configuring a dual-boot system, check various HOWTOs at http://www.tldp.org for hints and tips.

Select the GRUB boot loader. GRUB is typically installed in the MBR of the first IDE hard drive in a PC. However, the boot loader can also be installed in the first sector of the Linux boot partition, or even not installed on the hard drive. In this situation, you will need to create a boot floppy during the install; see "Create a Boot Disk," later in this chapter. Note that you can also backtrack through the install process to change any settings.

Note that you can assign a password for the boot loader. If you choose to use this option, you will need to enter a password at the GRUB boot screen (see the section "Login and Shutdown" at the end of this chapter for information on graphical logins). Carefully note the password! It does not have to be the same password used to log in, but if you password protect booting through your computer's BIOS and use a boot loader password here, you will subsequently need to enter three passwords (BIOS, boot loader, and login) in order to access Linux. Type in a password of at least eight characters twice (once on each line); then click OK or Cancel to exit the dialog.

If you click the Configure Advanced Boot Loader Options button, you're asked for arguments to pass to the Linux kernel before booting. Kernel arguments are used to enable or disable various features of Linux at boot time. If you install the source to the Linux kernel, you'll find documentation about the more than 200 different kernel arguments in the file kernel-parameters.txt under the /usr/src/linux/Documentation directory.

Click Next to set your boot loader configuration. You'll then proceed to network interface configuration, as shown in Figure 3.12.

Figure 3.12. Select or enter networking configuration information.

[View full size image]

Network Configuration

If you have an installed network adapter, you are asked for network configuration details, as shown in Figure 3.12. Fedora can be set to automatically configure networking upon booting. Note that you can also configure networking following installation using Fedora's system-config-network graphical network administration tool (see Chapter 13, "Managing Users," for details about using these tools).

NOTE

If the Linux kernel finds more than one network interface installed on your computer, you might be asked to configure a second Ethernet device. This might be the case, for example, if you are installing Fedora on a computer that will serve as a gateway or firewall. If you configure more than one Ethernet device, the device named eth0 will be the first active interface when you start Fedora.

You can choose to have your interface information automatically set using DHCP. Otherwise, especially if you are configuring a DHCP server, manually enter an IP address, hostname, or gateway address (such as for a router), along with DNS information if you click the Edit button listed by the interface (such as eth0 in the example).

After making your selection, click Next to continue. You'll be asked to select a firewall configuration.

Firewall and Security Configuration

Figure 3.13 shows the Fedora installer Firewall Configuration dialog, which offers an opportunity to set default security policies for the new server. Protecting your system using a firewall is especially important if your server is connected to a network (although it is best to first install Linux, set security policies, and then connect to a network). These settings in this installation screen determine how remote computers or users will be able to access your server. You can change these policies after finishing the install and logging in. Also on this screen is the option to either enable or disable SELinux, the more secure version of Fedora. If you have not come across SELinux before, you should consider setting it to either warn or disable because it will enable you to learn how SELinux could potentially impact your installation.

Figure 3.13. Select a desired security level and allowed services.

[View full size image]

If you have a general idea of how you want to protect your computer, use the dialog shown in Figure 3.14 to turn on firewalling.

Figure 3.14. Select your time zone.

[View full size image]

Choosing the No Firewall setting is not recommended; use this setting only if Fedora will be used as a non-networked workstation.

NOTE

Note that you can also manually configure security settings after installation using the text-based lokkit command, system-config-securitylevel client, or graphical gnome-lokkit client. See Chapter 33, "Securing Your Machines," for details on how to protect your system using these clients and various security level settings.

Click any allowable services, as shown in Figure 3.14. For some servers, HTTP, FTP, and Simple Mail Transport Protocol (SMTP) requests are acceptable and reasonable. Do not select or use the Telnet service, which is used to allow remote network logins. For security reasons, the Secure SHell (SSH) service is a much better choice (see Chapter 5, "First Steps with Fedora," on how to use the ssh client).

Click Next to install the firewall security settings. You will then be asked to select additional language support on your server. Again click Next when finished.

Setting the Time Zone

You are next shown a Time Zone Selection dialog (see Figure 3.14). There are two "clocks," or times, when using a PC: the hardware clock, maintained by hardware in the computer and a backup battery; and the system time, set upon booting and used by the Linux kernel. It is important to keep the two times accurate and in synchronization because automated system administration might need to take place at critical times. Many computer installations use computers with hardware clocks set to GMT, which stands for Greenwich Mean Time. The more modern designation is UTC or Coordinated Universal Time. The Linux system time is then set relative to this time and the default time zone, such as Eastern Standard Time, which is –5 hours of UTC.

Setting the computer's hardware clock to UTC (GMT) has the advantage of allowing the Linux system time to be easily set relative to the geographic position of the computer and resident time zone (such as a Linux laptop user who would like to create files or send electronic mail with correct time stamps, and who has traveled from New York to Tokyo). See Chapter 4, "Post-Installation Configuration," for details on setting the date and time for Linux.

TIP

Read the manual page for the hwclock command to learn how to keep a running Linux system synchronized with a PC's hardware clock. See Chapter 4 for more details on using the hwclock command and Linux time-related software.

Choose your time configuration, and then click Next.

Creating a Root Password and User Accounts

You are next asked to enter a root operator password, as shown in Figure 3.15. Type in a password, press Tab or Enter, and then type it again to make sure that it is verified. The password, which is case sensitive, should be at least eight characters (or more) and consist of letters and numbers. Note that the password is not echoed back to the display. Your root password is important because you will need it to perform any system administration or user management with Fedora.

Figure 3.15. Type in, and do not forget, your root password.

[View full size image]

CAUTION

Do not forget your system's BIOS, boot loader, or root passwords! Some equipment, such as notebook computers, might require factory replacement of motherboard components if the owner forgets the BIOS password. The BIOS settings on most desktop PCs can usually be reset via a jumper or removal and insertion of the motherboard battery. If you forget your boot loader password, use a boot disk (perhaps created during installation as shown later on in this chapter) or boot to a rescue mode using your first Fedora Core CD-ROM and reset the root password using the passwd command.

When finished, click Next to continue on to software package selection for your new server.

NOTE

You can only create a root account during a Fedora install. You will have to create user accounts later on after booting, using command-line programs (such as adduser) or the graphical system-config-users client. Create an account for yourself and any additional users. Usernames traditionally consist of the first letter of a person's first name and the last name. For example, Cathy Taulbee would have a username of ctaulbee. Do not forget to enter a password for any new user! If you create a user without a creating a password, the new user will not be able to log in.

You should create at least one user for your server besides the root operator. This is for security purposes and to avoid logging in as root, either through the keyboard at the server or remotely over the network. The default shell and home directory settings should remain set at the defaults, which are the Bourne Again SHell (bash) and the /home directory.

NOTE

See Chapter 5 for how to become the root user or run root commands as a regular user. See Chapter 13, "Managing Users," for details on managing users.

Software Selection and Installation

The Package Group Selection dialog shown in Figure 3.16 displays the installer's suggested software for your class of installation (a server in our example).

Figure 3.16. Select software package groups for installation.

[View full size image]

If you choose to install a personal desktop, workstation, or other installation type, the software packages appropriate for that installation will be automatically selected for you. Each package (actually a Group) provides many different individual software packages (refer to "Choosing Software Installation Options," earlier in the chapter).

Scroll through the list of package groups, and then click a software package check box to select or deselect software to be installed. Note that the entire size (drive space requirements) of the installed software will be dynamically reflected by your choices.

Click the Next button when finished to start installing Linux and the Fedora Core software.

The installer will then perform a quick dependency check and present a dialog informing you that a log of the install will be saved under the /root directory in the file named install.log. Press the Enter key to begin the installation of the software on your system. Be certain that you are ready when you confirm the process, as you cannot step back from this point on!

The installer will then format and prepare your new Linux partitions.

Next, the installer will prepare for the install by gathering a list of the RPM files and will start placing the software on the newly formatted partitions. This process can take anywhere from several minutes to two or more hours, depending on your PC and the amount of software you have chosen to be installed. The installer reports on the name of the current package being installed and the remaining time, as shown in Figure 3.17.

Figure 3.17. The Fedora installer formats your drive, and then installs selected software package groups.

[View full size image]

If you are installing over a network, go take a break because the install will proceed unattended through the software installation. If you are using this book's CD-ROMs, you might be prompted to remove the first CD-ROM and insert another. You might also be asked to repeat this operation using the third CD-ROM at some point.

Creating a Boot Disk

When the software installation finishes, the installer will perform some temporary file cleanup, install the boot loader, and then ask if you would like to create a boot disk for possible use later on, as shown in Figure 3.18.

Figure 3.18. Create a boot disk for use with Fedora.

[View full size image]

You can create this boot disk now, or, as mentioned earlier, you can use Fedora's mkbootdisk command later on while using Fedora. Select Yes or No. Having a boot disk can be handy, especially if an error was made during the install and the boot loader fails to boot Linux.

If you choose to create a boot disk, you will need to have a blank disk on hand. Select Yes, insert a blank disk when prompted, create the boot disk, and continue the install.

TIP

If you chose the X Window System, you can skip X configuration during the install and configure X after installation. This might be a better approach if the install fails to accurately probe your hardware or cannot configure X during the install, but you still desire to have X software installed. See Chapter 6 for details on configuring X to work with your PC's graphics card.

Finishing the Install

You are done! Press the Exit button, and the installer will eject any inserted CD-ROM and reboot. The GRUB boot loader will present a boot prompt as shown in Figure 3.19.

Figure 3.19. Boot Fedora with GRUB by pressing the Enter key or waiting 10 seconds.

If you have set a GRUB password, press the p key, type your password, and press Enter. If you do nothing for 10 seconds or press Enter, either boot loader will boot Linux.

NOTE

After installation, you can edit the file /boot/grub/grub.conf and change the timeout= setting to change the boot time to a value other than 10 seconds.


Logging In and Shutting Down

After rebooting your PC, you will be able to log in to a Linux session. If you did not choose to use X11 software during the installation, you will log in at a text-based login prompt. If you configured X and enabled a graphical login, the screen will clear after your system boots, and you will be presented with a graphical login screen, as shown previously in Figure 3.19.

To log in at the text-based prompt, type your username and press Enter. You will then be prompted for your password. After you press Enter, you will be at the Linux command line. If you use a graphical login, you can use the shutdown or reboot menus in the screen's dialog to shut down or reboot your system. To immediately shut down your system from the command line of a text-based session, use the su command and its -c option to run the halt command, like this:

$ su - c halt

You can also use the reboot command to restart your computer like this:

$ su -c reboot

For new users, installing Fedora is just the beginning of a new and highly rewarding journey on the path to learning Linux. See Chapter 5 for additional information about using Linux commands. For Fedora system administrators, the task ahead is to fine-tune the installation and to customize the server or user environment.

Related Fedora and Linux Commands

You might use the following commands while installing Fedora:

dd— Convert and copy data

fdisk— The Linux disk partitioning utility

grub— The GNU boot loader for Linux and other operating systems

LOADLIN— A Linux boot loader for DOS

mkbootdisk— Red Hat's Linux boot disk creation utility

RAWRITE— A disk image utility for DOS


Reference

http://fedora.redhat.com—The place to start when looking for news, information, and documentation about installing, configuring, and using Fedora.

http://www.powerquest.com/partitionmagic/—Powerquest's PartitionMagic utility includes BootMagic, which can be used to support booting of Linux or, regrettably, other less-capable operating systems, such as Windows XP.

http://www.v-com.com/product/System_Commander_Home.html—V Communications, Inc.'s System Commander, a commercial 4.2MB download that can be used to support booting of any operating system capable of running on today's PCs. An intelligent partitioning utility, Partition Commander, is included.

http://www.nwc.com/columnists/1101colron.html—How to use Intel's Pre-execution Environment (PXE) protocol to remote boot workstations.

http://www.gnu.org/software/grub/—Home page for the GRUB boot loader.

http://elserv.ffm.fgan.de/~lermen/HOME.html—The somewhat outdated home of the LOADLIN Linux loader.

http://www.ibiblio.org/pub/Linux/docs/HOWTO/other-formats/html_single/BootPrompt-HOWTO.html—The BootPrompt-HOWTO, a guide to using the boot prompt for passing kernel arguments.

http://www.tldp.org/HOWTO/Installation-HOWTO/index.html—The Linux Installation-HOWTO, a guide to installing Linux by Eric S. Raymond.


Chapter 4. Post-Installation Configuration

IN THIS CHAPTER

  • Troubleshooting Post-Installation Configuration Problems

  • Your Hardware and Kudzu

  • Pointer and Keyboard Configuration

  • Configuring Display Graphics

  • Configuring Sound Devices

  • Detecting and Configuring a Modem

  • Configuring Power-Management in Fedora

  • Resetting the Date and Time

  • Managing PCMCIA

  • Configuring and Using CD, DVD, and CD-RW Drives

  • Reference

As Chapter 3, "Installing Fedora," demonstrates, installing Fedora is an easy task in most situations. The installation process includes hardware probing, in which the installer surveys your system's hardware and then configures system settings accordingly. This process ensures that when the system boots, nearly all hardware is recognized and ready to operate.

If you are a system administrator (which you are even if you use Linux on a standalone workstation), you can expect to perform some post-installation configuration of your system. This chapter starts with some general advice on troubleshooting, and then offers some insight on how Fedora is set up to track your system's hardware. You will then see how to start and use the command line or the desktop to display and diagnose the Linux kernel's output regarding several common PC hardware components. You will also see several graphical configuration clients in action.


Troubleshooting Post-Installation Configuration Problems

As Linux continues to be developed, it has become increasingly fault-tolerant, meaning that if errors are encountered during the boot process, the errors will not cause a complete kernel or boot failure. Often, your computer might appear to be running fine, even though some device or process is not working correctly. The sources of such problems might include modules that did not load, services that did not start, or devices that are being used at sub optimum levels (such as hard drive transfer speeds).

You will find clues to many problems in dmesg output, or in the /var/log/messages file, a simple text file containing constantly updated kernel and system information that you can view in any editor. Take a moment to review this file or dmesg output after installing or configuring new hardware; you will see that they show the progress of booting and starting services on your system.

The messages are generated by the kernel, other software run by /etc/rc.d/rc.sysinit, and Fedora's runlevel scripts. You might find what appear to be errors at first glance, but some errors are not really problems (for example, if a piece of hardware is configured but not present on your system).

When troubleshooting error messages, remember that "Google is your friend." Simply copy part or all of the error message and paste the information into a search field at http://www.google.com/linux/ and at http://marc.theaimsgroup.com/. You might find links to pages with information to help you solve your problem. It is quite likely that you are not the first person to encounter the problem. Reading the manual page for modprobe.conf and having perused /usr/src/linux-2.6/Documentation/devices.txt (and other files) will go a long way in helping you troubleshoot any problems.

Remember to only solve one problem at a time and always make a backup copy of any system file before you modify it. Do not use the common extension .bak because files with that extension can sometimes be overwritten. Here is a good method of copying the file:

# cp filename filename.original

And when restoring from that backup, do not rename the file, just copy it, like so:

# cp filename.original filename

(When these tips have saved you countless hours of frustration, thank us by purchasing copies of this book as gifts for your friends.)


Your Hardware and Kudzu

When you add or replace hardware, for example, you will need to configure the operating system to recognize and boot with the new components working properly. If you have enabled the kudzu service, Fedora will automatically detect new hardware upon rebooting; Kudzu then enables you to remove configuration information about missing hardware and configure the new device. If you do not use Kudzu, however, you might need to perform configuration manually without the support of automated hardware detection and configuration.

NOTE

The kudzu service maintains a database of your system's hardware information under the /etc/sysconfig directory in a file named hwconf. This service can be started, stopped, or restarted (like other operating system services) from the command line by using a script under the /etc/rc.d/init.d directory (named kudzu). You can add options or enable various features of Kudzu, such as timeouts, by editing the KUDZU_ARGS= entry in the kudzu script (see the kudzu man page for the options). You can also use the command-line based service command or the graphical system-config-services client to control kudzu. See Chapter 14, "Automating Tasks," for more information on using these commands.

You can perform many post-installation tasks without rebooting or downtime. With proper planning, you also can create a server or workstation configuration that allows "hot-swapping" of system storage and other components, eliminating the need for downtime. In this chapter, you learn how to configure various USB and Firewire (IEEE-1394) devices in addition to keyboards, modems, and notebook PCMCIA services.

Information about your system's installed hardware is contained in a number of files under the Fedora directory system. Aside from one or two symbolic links, or shortcut-type files created under the /dev directory for the convenience of system utilities, nearly all these hardware settings are in text files under the /etc directory. The contents of these files are used by various software services to manage your system's hardware, save changes to your hardware, ensure that settings are saved between reboots, and to properly configure your system upon booting. A number of these files are used by the /etc/rc.d/rc.sysinit script when Linux starts. For example, some of these files include

/etc/sysconfig/hwconf— Lists the currently configured system hardware (used by kudzu)

/etc/sysconfig/apmd— Lists system power-management settings (used by the apmd deamon)

/etc/sysconfig/clock— Contains time zone, clock, and hardware clock settings (used by the hwclock command)

/etc/sysconfig/harddisks— System hard drive tuning parameters (using options available with the hdparm command)

/etc/sysconfig/irda— Provides configuration data concerning Infrared Data Association (IrDA) hardware

/etc/sysconfig/keyboard— Lists current keyboard mapping (and provides language settings)

/etc/sysconfig/mouse— Details the current system pointing device (such as whether or not a PS2 or USB mouse is used)

/etc/modprobe.conf— Defines device names, kernel hardware support modules to load, and any optional parameters (see Chapter 38, "Kernel and Module Management," for more information about Linux kernel modules)

/etc/pcmcia— A directory containing a Personal Computer Memory Card International Association (PCMCIA) hardware database and device settings (see the section "Managing PCMCIA" later in this chapter)

You will find additional information about the files in /etc/sysconfig in the file named sysconfig.txt under the /usr/share/doc/initscripts directory.

CAUTION

Do not edit kudzu's text-file database of installed hardware; these files are updated dynamically by Kudzu. If you have trouble with a device, however, you can check the information in these files when troubleshooting to see if the device is properly recognized and its definition matches the actual hardware.


Pointer and Keyboard Configuration

Fedora includes graphical tools that can quickly and easily change existing mouse and keyboard configuration settings. You also can use these tools to add support for a new keyboard or mouse on your system. These tools include

  • mouseconfig— A dialog-based graphical mouse configuration tool for text-only consoles

  • system-config-mouse— A graphical mouse configuration tool for the Red Hat desktop

  • system-config-keyboard— A graphical keyboard configuration tool for the Fedora desktop or to configure a keyboard using a text console

The following sections explain how to use these tools to configure keyboards and pointing devices in Fedora.

Configuring Keyboards with Linux

NOTE

Linux supports many different types of keyboards. Up to the last few years, most keyboards used the PS/2 protocol (originally developed by IBM) and attached to a PC with a 6-pin mini- connector. Today, however, nearly all computers use Universal Serial Bus (USB) connectors for user input devices. Although many of today's PCs (and notebooks) continue to provide PS/2 ports, most manufacturers are now introducing "legacy free" computers without direct PS/2 support.

You can make a number of keyboard configuration choices in Fedora. You can choose a keyboard language that supplies the keyboard letters, diacritical marks, and layout appropriate for the language you will be typing in during your console or graphical sessions. Other configuration options include changing the keyboard's translation table to remap the order of keys on your keyboard, swapping specific keys (such as Caps Lock and Ctrl), or changing the delay period between the press of the key and the appearance of the character onscreen. (This configuration can help you synch the character entry to your typing speed.)

You can make keyboard configuration changes through text-based (console) keyboard commands or by using the graphical user interface.

If you do not use X, use Red Hat's system-config-keyboard command to change your keyboard type and language. This command can be used without an active X session (or if you are using X, from inside a terminal window) like this:

# system-config-keyboard

After you press Enter, you will see the Configure Keyboard dialog, as shown in Figure 4.1.

Figure 4.1. The system-config-keyboard command can be used to choose a keyboard map (language) for Fedora.

This dialog enables you to choose a new keyboard type.

Scroll through the list to highlight a desired keyboard type, and then use the Tab key to highlight the OK button and press Enter. The listings represent entries under the /lib/kbd/keymaps/i386 directory, which are used to associate your keyboard's layout and keys with a language. The keyboard configuration is stored in the file /etc/sysconfig/keyboard, which might look like this:

KEYBOARDTYPE="pc"

KEYTABLE="us"

If you are using the Fedora desktop during an X session, you can use the graphical interface to select a keyboard language. To open the keyboard configuration dialog box, click the desktop panel System Settings Keyboard menu item, or use the system-config-keyboard client at the command line of a terminal window, like so:

$ system-config-keyboard

After you press Enter, you will be prompted for the root password. Enter the password and click OK. You will then see the Keyboard dialog box shown in Figure 4.2. This dialog box is similar to that displayed by system-config-keyboard.

Figure 4.2. The system-config-keyboard client is used during an X session to choose the language you will be keyboarding in during your desktop sessions.

Scroll through the list of languages, highlight a language, and then click OK to save your change.

Table 4.1 lists text-based and graphical commands you can use to manipulate or get information about your keyboard.

Table 4.1. Linux and X Keyboard-Related Commands

dumpkeys

Displays keyboard translation tables

kbd_mode

Modifies current keyboard mode

kbdrate

Changes keypress delay, repeats

loadkeys

Loads new keyboard table

showkey

Prints character, keycode, and other keystroke information

setleds

Displays, changes keyboard light-emitting diode (LED) settings

xkbcomp

Shows, sets keyboard character translations for X

xkbprint

Displays or saves X keyboard mappings

xset

Modifies keyboard settings for X

xmodmap

Changes key mappings for X

The X11 keyboard and other clients can be used to input a keyboard description into a running X server, show current keyboard character translations, change a keyboard map, and set other keyboard (and pointer) preferences. X11 settings are generally contained in a system's xorg.conf file (see Chapter 6, "The X Window System," for more information).

As a trivial example, the following short shell script (see Chapter 14 for more information on how to use shell scripts) can be used to blink the keyboard Caps Lock LED on and off each second (press Ctrl+C to stop the blinking) while using the console:

#!/bin/sh

while :

  do

   setleds -L +caps ; sleep 1 ; setleds -L -caps ; sleep 1;

done

Perhaps a more useful example is to switch the Caps Lock and Ctrl keys on your keyboard. Some users might find typing sessions a bit more comfortable if the locations are swapped. There are a number of ways to swap the keys. For your console-based sessions, use the loadkeys command to read in a file containing reverse key values for the keys:

keymaps 0-15

keycode 58 = Control

keycode 29 = Caps_Lock

You can then immediately swap the keys by using loadkeys to read in the file (perhaps named swapkeys) like so:

# loadkeys <swapkeys

The same swapping can be used for your Red Hat desktop by editing your /etc/X11/xorg.conf file's keyboard InputDevice section and adding

Option     "XkbOptions"  "ctrl:swapcaps"

Yet another way to get the same results is to create a file named .Xmodmap in your home directory that contains

remove Lock = Caps_Lock

remove Control = Control_L

keysym Control_L = Caps_Lock

keysym Caps_Lock = Control_L

add Lock = Caps_Lock

add Control = Control_L

Or you can save the settings in a file (such as mykeyswap) and use the xmodmap client to directly read in the new keys like so:

$ xmodmap mykeyswap

Note that this will only work if you use the xterm or rxvt terminal clients. See Chapter 6 for more information about the Fedora desktop.

TIP

The system-config-keyboard command will present its graphical interface if launched from the command line during a graphical desktop session (that is, while using the X Window System).

However, you can force system-config-keyboard to use its text-based console interface by including the --text option on the command line like this:

# system-config-keyboard --text

This technique can also be used with the system-config-mouse client discussed next and the sndconfig command discussed later in this chapter. Using a console-based interface with one of these commands can be handy if you do not want the client to launch over a network after you have connected from a remote host.

Configuring Pointing Devices in Fedora

This section introduces pointer device configuration for Fedora Core. You will see how to use the mouseconfig command to configure a mouse from a text-based console, or the graphical system-config-mouse client for configuring a mouse for your desktop.

NOTE

Many pointing devices, such as the IBM Trackpoint (found in several versions of IBM non- notebook keyboards) work fine with Fedora. However, if you use a trackball, joystick, or other devices such as the Synaptics TouchPad, the Cirque GlidePoint, and wireless or infrared (IrDA) pointers, you might need to experiment with different configuration settings or use a driver provided (hopefully) by the manufacturer.

Linux PC tablet users will have good reason to rejoice with the release of the Linux 2.6–series kernel. The new kernel will feature built-in touchscreen support and other improvements to make life easier when using Linux on a tablet PC. Compaq Tablet TC1000 users can browse to http://linux-tablet-pc.dhs.org/ for links to various drivers and supporting software. Some manufacturers provide direct links to Linux drivers or support reports. For example, Toshiba 3501 Tablet PC users can browse to http://linux.toshiba-dme.co.jp/linux/eng/pc/ptg3501_report.htm for additional information.

Fedora does include some support for joystick use through the jsattach, jscal, and jstest commands (installed from the joystick*.rpm package). You can use these commands to support, calibrate, and test certain joystick makes and models.

The Fedora installer generally recognizes and correctly configures a computer's pointing device, but if you install a new pointing device, you will need to reconfigure the system for its use.

When using a PS/2 pointing device, a file named /dev/mouse will point to /dev/psaux; when using a USB pointing device, /dev/mouse will point to /dev/input/mice. A serial mouse will have /dev/mouse point to a specific serial port, perhaps /dev/ttyS0. The /dev/mouse file is a symbolic link, used for the convenience of many Linux applications. It is much more convenient for a program to look for /dev/mouse instead of /dev/input/mice, /dev/psaux, or /dev/ttyS0.

USB service (most likely initially configured by the installer) is started during the boot process by an entry in the system's module configuration file, /etc/modprobe.conf:

alias usb-controller usb-uhci

In this example, the PC platform uses a Universal Host Controller Interface (uhci), and the uhci.o kernel module will be loaded from the /lib/modules/2.6-X/kernel/drivers/usb directory when Linux boots. Another USB controller commonly in use is the Open Host Controller Interface (ohci), requiring loading of the ohci.o module to enable USB service.

If your pointing device does not work, you can use the dmesg command to see if Linux has recognized the device during the boot process. This can provide some diagnostic information because Linux or the driver (perhaps a module) usually outputs diagnostic information:

...

usb-uhci.c: USB UHCI at I/O 0xd800, IRQ 15

usb-uhci.c: Detected 2 ports

usb.c: new USB bus registered, assigned bus number 2

hub.c: USB hub found

hub.c: 2 ports detected

usb-uhci.c: v1.275:USB Universal Host Controller Interface driver

hub.c: USB new device connect on bus1/1, assigned device number 2

usb.c: USB device 2 (vend/prod 0x1241/0x1122) is not claimed by any \

active driver.

usb.c: registered new driver hiddev

usb.c: registered new driver hid

input0: USB HID v1.00 Mouse [1241:1122] on usb1:2.0

hid-core.c: v1.8 Andreas Gal, Vojtech Pavlik <vojtech@suse.cz>

hid-core.c: USB HID support drivers

mice: PS/2 mouse device common for all mice

...

In this example (your output might look different), the kernel has recognized a generic USB mouse. USB support is initially enabled by the usbcore.o kernel module. In this example, the USB controller interface is initialized and configured by loading the usb-uhci.o kernel module, and then additional modules, such as input.o and hid.o, will be loaded to support a mouse (and/or keyboard) USB device.

You can see what modules have been loaded by using the output of the lsmod command. Note that you might see different memory size values, depending on your computer and module version:

# lsmod

...

mousedev        4288  1

hid          18720  0 (unused)

input          3744  0 [mousedev hid]

usb-uhci        21636  0 (unused)

usbcore        59072  1 [hid usb-uhci]

As you can see, USB device support, especially for pointing devices, involves proper loading of a chain of modules rather than a single driver.

TIP

Upon booting or connection, every USB device reports a pair of numbers representing a vendor and associated product (model). Problems can arise if the vendor and product ID are not recognized by a pertinent Linux kernel module. If a device is not properly recognized, it might not work with Linux. It is sometimes possible to rebuild a USB kernel module and include your device's vendor and product ID in order to get the device to work. For example, if you have installed the Linux kernel source, the file named scanner.h under the /usr/src/linux-2.6/drivers/usb directory contains many popular USB scanner vendor and product IDs that are used by the kernel's scanner.o kernel module. See Chapter 38 for more information about rebuilding the Linux kernel and kernel modules. For a list of the latest USB devices supported with Linux, browse to http://www.qbik.ch/usb/devices/.

After Linux has recognized your hardware, you can use the mouseconfig command to configure a new pointer. Start the command like this:

# mouseconfig

TIP

If Linux recognizes a two-button pointer, the mouseconfig command automatically selects three-button emulation. (A simultaneous depress of both buttons will send a middle-button click.)

Using a three-button mouse is essential for copy and paste operations—either at a text console or during X sessions. The left mouse button is most often used for clicking and selection, whereas the right mouse button is generally used for configuration or property display. The middle button is used for scrolling and pasting text or graphics.

After you press Enter, the Configure Mouse dialog appears, as shown in Figure 4.3.

Figure 4.3. The mouseconfig command can be used to configure a new pointing device.

[View full size image]

Scroll through the list of pointers. Tab to select the OK button and press Enter when finished.

If you're using X, use the desktop panel System Settings Mouse menu item, or the system-config-mouse client at the command line of a terminal window, like so:

$ system-config-mouse

After you press Enter, you will be prompted for the root password. Type the password and then click the OK button; a graphical interface similar to mouseconfig's Configure Mouse dialog appears. Scroll through the listings, select an entry corresponding to your pointer, and then click the OK button.

Pointer configuration entries are stored in the file /etc/sysconfig/mouse, and can be examined like this:

# cat /etc/sysconfig/mouse

MOUSETYPE="ps/2"

XMOUSETYPE="PS/2"

FULLNAME="Generic Mouse (USB)"

XEMU3=yes

DEVICE=/dev/mouse

In this example, a two-button USB pointer emulates a PS/2 pointing device.

The corresponding entry contained in the /etc/X11/xorg.conf, used by X.org for the Fedora desktop looks like

Section "InputDevice"

    Identifier   "Mouse0"

    # Modified by mouseconfig

    Driver     "mouse"

    Option     "Device"        "/dev/mouse"

    Option     "Protocol"       "PS/2"

    Option     "Emulate3Buttons"    "yes"

    #Option     "ZAxisMapping"     "4 5"

EndSection

This entry enables the use of a USB pointing device during X sessions. See Chapter 6 to learn about X.

The ZAxisMapping enTRy (disabled in the preceding example) enables scrolling with a mouse that has a combination scroll-wheel and middle button. Many other types of input devices can be used with Linux and X.org. For information about using a mouse with X.org, read the file README.mouse under the /usr/X11R6/lib/X11/doc directory.

Mouse support for copy and paste operations during a Linux console session is provided by the General Purpose Mouse driver (gpm). gpm is a daemon, or software that runs in memory as a background process while you use Linux. If you make the appropriate configuration choices, the /etc/rc.d/init.d/gpm script starts the gpm daemon when Fedora boots. If you're not using X, you can configure Linux to start gpm when booting by using the ntsysv command from the console. Run the ntsysv command as root, like this:

# ntsysv

After you press Enter, you will see the Services dialog, as shown in Figure 4.4.

Figure 4.4. Use the ntsysv command to produce the Services dialog, in which you can select the gpm driver to start at boot time.

[View full size image]

Scroll through the list of services using the Up or Down cursor keys to highlight the gpm service. Press the spacebar to toggle use of the service on (an asterisk will appear between the brackets) or off (no asterisk). Then tap the Tab key to highlight the OK button and press Enter to save your changes. The changes will take effect the next time you boot Red Hat.

NOTE

You can use the chkconfig command or the system-config-services client to configure Linux to run the gpm daemon when you're working in console mode (but not during X Window System sessions). Use the chkconfig command like this:

# chkconfig –-level 3 gpm on

# chkconfig –-level 5 gpm off

See Chapter 14 to see how to configure when services run under Fedora.


Configuring Display Graphics

When you add or change the graphics devices used in your system after the initial installation, you must configure those devices. Adding or changing the display for your system can be as simple as swapping out the monitor or replacing a display adapter. For Intel-based PCs, this can mean switching from the use of the motherboard's built-in display adapter (if available)—by inserting a graphics card in the Accelerated Graphics Port (AGP) or Peripheral Component Interface (PCI) slot—or perhaps adding a second display adapter to support the use of multiple display monitors for X sessions.

Although a display monitor can be easily disconnected or reattached to a running system, insertion or removal of a graphics display adapter will require downtime—the bane of academic, enterprise, corporate, or small-business operations.

Linux and KVM

Keyboard, video, and mouse (KVM) hardware provides the capability to quickly switch display and control between banks of individual computers using a single monitor, keyboard, and pointer. This provides efficient organization, diagnostics and use of computers in larger installations, and allows a single operator to perform system administration tasks without physically moving to each computer.

Using KVM can bring other cost savings. Eliminating the need for some monitors reduces the amount of storage required for the system and the amount of energy used to run and cool the system.

Linux system administrators should be careful to research any hardware compatibility issues before implementing KVM. Many switches work regardless of the operating system and application used; however, take time to research what keyboard and pointer devices you will need to use (such as whether serial I/O, PS/2, or USB devices might be required). Some KVM switches come with some form of an embedded operating system (even Linux) that provides hardware emulation; these switches will have power requirements.

Other issues to consider include cable construction, compatibility, and distance limitations, hardware or software switch configuration (such as providing push-button or key-combination switching), security, and scalability.

If you use X and want to control the graphical desktops of remote hosts on your network, use the Xvnc server and vncviewer clients, discussed in "Remote X" in Chapter 25, "Remote Access with SSH and Telnet." You can also try the x2x and X2vnc clients. Although not included with Red Hat, you can find these clients at http://ftp.digital.com/pub/Digital/SRC/x2x/ and http://www.hubbe.net/~hubbe/x2vnc.html.

Smaller Linux–based operations can avoid the use of KVM switching hardware by instead leveraging the graphical networking features of X11, multiple terminal sessions, and virtual desktops. Text-based virtual consoles can also be used on servers or workstations that do not use X11 to manage multiple computers or to receive logging messages from various services (such as email or web servers and the kernel). See Chapter 5, "First Steps with Fedora," to learn more about using virtual consoles. If you are limited to a single remote session window, use the screen command, a text-based window manager that enables a single terminal session to manage several shells. For additional information on using virtual consoles, see http://www.tldp.org/HOWTO/Keyboard-and-Console-HOWTO.html.

Your Fedora desktop is provided by the X Window System, a client and server software package that is configured to use your computer's video card, monitor, keyboard, and mouse. If you use the graphical desktop and kudzu (discussed earlier in this chapter) and change your graphics card, monitor, keyboard, or mouse, you might be asked to remove existing hardware configuration and reconfigure the new equipment the next time you boot.

The details about configuring X.org for Linux are covered in Chapter 6, but the basic utility used to configure a new xorg.conf file is system-config-display, Red Hat's graphical X configuration tool. You can also use Xorg -configure, which can generate an xorg.conf file by probing installed hardware.

NOTE

Connecting and using an external monitor with a notebook can be convenient, especially if the external monitor provides a larger desktop than the notebook's built-in display. However, configuring an external display for a notebook can sometimes be a problem when using X11. The notebook's graphics chipset must be supported by an X.org driver module, and the module must enable switching or concurrent use of an external monitor. Fortunately, many notebook chipsets are supported, and some notebook manufacturers provide support information for configuring external displays. For example, if your notebook has a Neomagic chipset, use the internDisp and externDisp options in the notebook's xorg.conf to enable use of an external display. Keep in mind that although Red Hat, Inc. encourages and supports X.org development efforts, The X.Org Foundation LLC controls X.org development and X graphics support. See Chapter 6 for more information about Linux and X11.

Fortunately, creating a working xorg.conf file (found in the directory /etc/X11) is usually easily accomplished when installing Fedora. If a new video card or monitor is put in use before installation, it will most likely work because X.org supports many families and types of graphics chipsets. Although newer graphics chipsets might cause some display compatibility problems, it is usually possible to configure a basic working display using existing software. The X.Org Foundation and contributing developers do a great job of providing software that works with nearly every product on the market.

If you are experiencing X11 configuration problems during installation, skip the configuration. Boot Fedora, and then look for a document under the /usr/X11R6/lib/X11/doc directory with information about your computer's graphics card. Various README files with specifics about a particular chipset are included with X.org. You can also check the X.Org Foundation website (see the "Reference" section at the end of this chapter) for any errata, changes, updates, or new releases.

TIP

Before running any X configuration tool, be sure to make a copy or back up any working xorg.conf configuration file.


Configuring Sound Devices

Most workstation users want to have a configured sound card working with Linux. Sound support is generally configured when Linux first boots (or during the install process if the sound card is recognized). Fedora Core uses the Advanced Linux Sound Architecture (ALSA) to enable sound support on your workstation.

To use sound, you should then use ALSA's alsamixer command to unmute your sound card's channels and save the settings using the alsactl command:

# alsactl store 0

The state of your sound card will be saved in the file /etc/asound.state. These settings, such as channel volumes, can be retrieved later by using the restore option instead of store.

NOTE

You will find complete documentation about the Linux kernel's sound support in various text files under the /usr/src/linux-2.6/Documentation/sound/alsa directory if you install the source code to Linux.

Configuration problems can arise, especially if your sound card's manufacturer will not or cannot release specifications to help open-source developers create working drivers. If your sound card is not recognized, or is recognized but will not work, and using ALSA fails, you can turn to commercial sound drivers from 4Front Technologies. These relatively inexpensive drivers support more than 350 sound systems and are installed, configured, and controlled using shell scripts. Browse to http://www.opensound.com for more information.

Fedora also includes a Red Hat-derived graphical sound card configuration client that can be used during an X session. Start the system-config-soundcard client by clicking your desktop panel's System Settings Soundcard Detection menu or item, or by using the command at a terminal window like so:

$ system-config-soundcard

After you press Enter, you will be prompted for the root password. Enter the password and click OK. The system-config-soundcard will try to automatically detect and configure your sound card. You will then see a dialog you can use to test your sound card settings, as shown in Figure 4.5. Click on the Play test sound button to listen to a sample sound.

Figure 4.5. The system-config-soundcard client is used during an X session to configure a sound card for Fedora.

    Previous Section < Day Day Up > Next Section


Detecting and Configuring a Modem

More than 33 million users in the United States now connect to the Internet with cable or DSL service, but for many users a modem is the standard way to connect with an Internet service provider (ISP) using the Point-to-Point Protocol (PPP). Other common tasks for modems include sending and receiving faxes. If you add or change your modem after the initial installation, you will need to configure Fedora to use the new modem to perform all these tasks.

Fedora includes several tools you can use to configure and use an internal or external modem in your notebook or PC. Chapter 18, "Internet Connectivity," contains the details about configuring Fedora to connect to the Internet using a modem. This section covers how to configure and use modems using serial ports (using a standard formerly known as RS232, but now termed EIA232) or USB.

Configuring a Serial-Port Modem

Linux uses /dev/ttySX, /dev/ttyUSBX, or /dev/usb/ttyUSBX for serial ports, where X can range from 0 to 15. Many additional ports can be added to a system using multiport cards or chained USB devices. A PC's integral serial ports are generally recognized at boot time. To see a list of recognized ports for your system, pipe the dmesg command output through the fgrep command like so:

# dmesg | grep tty

ttyS00 at 0x03f8 (irq = 4) is a 16550A

ttyS01 at 0x02f8 (irq = 3) is a 16550A

In this example, the grep command reports that two serial ports have been recognized in the dmesg output. Note that the device matching ttyS00 is /dev/ttyS0, despite the kernel output. The PC's external modem can be attached (most likely using a male DB9 adapter) to either port. Under Linux, nearly all modem-dependent software clients look for a symbolic link named /dev/modem that points to the desired device. This link is not created by default, but as root, you can create this device manually using the ln command like this:

# ln -s /dev/ttyS0 /dev/modem

In this example, /dev/modem will point to the first serial port.

You can also use the graphical X client neat to configure a modem after the initial installation. Internet connection software such as Fedora's system-config-network client (shown in Figure 4.6) will try to probe the system for an available modem. If a modem is not found, you can manually enter modem data.

Figure 4.6. Red Hat's system-config-network client will probe for an available modem.

KDE provides the kppp client (shown in Figure 4.7) that can also be used to look for and set up a modem when you set up a new Point-to-Point Protocol (PPP) connection. Click the Query Modem button in kppp's dialog to search for an installed modem.

Figure 4.7. KDE's kppp client can be used to find and configure an available modem.

Fedora includes command-line–based diagnostic and serial port configuration tools for the system administrator. For example, to get more information about a specific port, you can use the statserial command, along with a designated device like this:

# statserial /dev/ttyS0

Device: /dev/ttyS0

Signal Pin Pin Direction Status Full

Name  (25) (9) (computer)       Name

-----  --- --- --------- ------ -----

FG      1   -    -         -    Frame Ground

TxD     2   3    out       -    Transmit Data

RxD     3   2    in        -    Receive Data

RTS     4   7    out       1    Request To Send

CTS     5   8    in        0    Clear To Send

DSR     6   6    in        0    Data Set Ready

GND     7   5    -         -    Signal Ground

DCD     8   1    in        0    Data Carrier Detect

DTR    20   4    out       1    Data Terminal Ready

RI     22   9    in        0    Ring Indicator

The sample output is a display of the associated device's port signals. Another tool is the setserial command that can be used to display port statistics and reconfigure a serial port's system interrupt or speed. This can be handy when using some serial devices, such as a cellular phone that requires specific serial port characteristics. To get information about a specific port, use setserial, along with the device name like this:

# setserial -a /dev/ttyS0

/dev/ttyS0, Line 0, UART: 16550A, Port: 0x03f8, IRQ: 4

    Baud_base: 115200, close_delay: 50, divisor: 0

    closing_wait: 3000

    Flags: spd_normal skip_test

In this example, the characteristics of /dev/ttyS0 are displayed. The setserial command can also be used to configure or fine-tune a port's characteristics using 32 different command-line options and values.

One option for using a legacy serial device such as a modem on PC that does not have a serial port but supports USB is to use a USB-to-serial converter. These devices provide a serial port dongle and plug in to a USB hub or port. You can see the output and designated serial port by looking at the output of the dmesg command:

usb.c: registered new driver serial

usbserial.c: USB Serial support registered for Generic

usbserial.c: USB Serial Driver core v1.4

usbserial.c: USB Serial support registered for Keyspan PDA

usbserial.c: Keyspan PDA converter detected

usbserial.c: Keyspan PDA converter now attached to ttyUSB0 \

(or usb/tts/0 for devfs)

usbserial.c: USB Serial support registered for Keyspan PDA - (prerenumeration)

usbserial.c: USB Serial support registered for Xircom PGS - (prerenumeration)

usbserial.c: USB Serial support registered for Entregra PGS - (prerenumeration)

keyspan_pda.c: USB Keyspan PDA Converter driver v1.1

Configuring a Fax Modem

Linux should recognize and configure a designated serial port (such as /dev/ttyUSBX in the example) when the device is plugged in. Fedora also comes with a number of fax utilities that can be used to configure a system to send or receive phone faxes. One of the easier to configure fax utilities is the fax command. As root, you can configure the software by editing a few entries in the /usr/bin/fax shell script:

DEV=modem

FROM="1 555 555-1212"

NAME="Company Name"

The most important entry is DEV=, which will not need to be changed as long as /dev/modem points to an active fax-capable modem. You can also edit /usr/bin/fax to customize other entries, such as the fax viewing command. Use the test command-line option to check the settings like this:

# fax test

Sending a fax using the fax command is straightforward:

# fax send 5551212 document.txt

Configuring minicom for Modem Use

Use the minicom or xminicom script (used for launching minicom in a terminal window during an X session) for dial-up connections and terminal sessions to remote Linux systems. To configure this terminal program for use with an attached modem, start the client as root with its -s or setup option like this:

# minicom -s

After you press Enter, you will see a setup dialog. Select Serial-Port Configuration and press Enter. You will then see a Configuration Settings dialog as shown in Figure 4.8 that you can use to configure the program to work with an attached modem.

Figure 4.8. Use minicom's setup dialog to configure the program to work with an attached modem.

[View full size image]

Configuring WinModems for Laptops

Other issues regarding modems focus on Linux notebook users with laptops using controllerless modems. These modems use proprietary software to emulate a hardware modem and are commonly referred to as WinModems due to the software being available only on Windows. Despite the release of binary-only drivers to enable use of some of these modems, these devices remain the bane of Linux notebook and some desktop users.

You might find some support for Lucent (but not Lucent AMR), Motorola SM56-type, the IBM Mwave, and Conexant HSF (not HCF) controllers. At the time of this writing, there was no support for any 3Com or U.S. Robotics controllerless modems. For links to drivers and more information, browse to the Linux Winmodem web page at http://www.linmodems.org.


Configuring Power-Management in Fedora

Advanced Power Management (APM) enables workstations and servers to automatically turn off when instructed to shut down. Most often used by Linux mobile users, APM can help extend battery sessions through the use of intelligent storage-cell circuitry, CPU "throttling" (similar to, but not the same as safety thermal throttling incorporated by Intel in Pentium III and IV CPUs), and control of displays and hard drives.

Most PCs support APM via the BIOS and hardware. APM support is configured, enabled, and then incorporated in the Linux kernel.

APM information is constantly updated in the file /proc/apm, which can look like this:

# cat /proc/apm

1.14 1.2 0x03 0x01 0x03 0x09 100% 10800 sec

This example provides information such as battery charge, along with time and percentage of time remaining. From left to right in the example is the driver version, BIOS version, status, AC status, battery status, battery state, remaining battery life, and number of seconds of life remaining. Some X11 clients, such as the asapm, xapmload, or GKrellM clients, parse this file and display icons or graphical power LEDs to present the information in an easier to digest form. These clients can be especially helpful for notebook users.

APM is supported by all kernels included with Fedora. However, problematic hardware or APM misconfiguration can cause kernel panics with some hardware, resulting in the inability to boot Linux. When this happens, you must reconfigure APM, and then build and install a new Linux kernel. (Refer to Chapter 38 for more information.)

Basic Linux kernel APM configuration options include

  • CONFIG_APM— Whether or not to configure APM support

  • CONFIG_APM_IGNORE_USER_SUSPEND— Ignores keyboard suspend instruction

  • CONFIG_APM_DO_ENABLE— Enables APM at boot

  • CONFIG_APM_CPU_IDLE— Idle CPU when not used

  • CONFIG_APM_DISPLAY_BLANK— Enables monitor or LCD panel blanking

  • CONFIG_APM_RTC_IS_GMT— Determines clock setting

  • CONFIG_APM_ALLOW_INTS— Allows interrupts during APM use (such as serial-port activity)

  • CONFIG_APM_REAL_MODE_POWER_OFF— Enables powering down

Fedora includes several APM-related commands—such as apm that prints APM information and apmsleep, used to suspend and then awake notebook hardware at a specific time. Linux notebook users can use the apm command like this:

$ apm -v

APM BIOS 1.2 (kernel driver 1.16)

AC on-line, battery status high: 95%

Other power management incorporated in the kernel includes control of Peripheral Control Interface (PCI) devices and Display Power Management Signaling (DPMS) for enabled monitors, which can help energy costs by placing devices in a low-power state after a preset time. Screen saving, as most astute Linux system administrators and users know, is no longer necessary to protect displays from image "burn-in." And password protection enabled by the screensaver only provides a modicum of physical security.

Hardware health monitoring is supported by the lm_sensors software package, which acquired some notoriety when early versions allegedly caused IBM ThinkPad notebooks to suffer permanent damage. However, system administrators managing desktop PCs can benefit from using applications, such as the sensors command that takes advantage of the hardware monitoring features of the lm_sensors libraries.

You can customize the output of the sensors command by editing (as root) the /etc/sensors.conf file, but the default settings should work for your computer. To enable sensor reading, use the sensors-detect command to determine which kernel modules to load to enable sensor output:

# /usr/sbin/sensors-detect

This program will help you determine which I2C/SMBus modules you need to

load to use lm_sensors most effectively. You need to have i2c and

lm_sensors installed before running this program.

Also, you need to be `root', or at least have access to the /dev/i2c-*

files, for most things.

If you have patched your kernel and have some drivers built in, you can

safely answer NO if asked to load some modules. In this case, things may

seem a bit confusing, but they will still work.

It is generally safe and recommended to accept the default answers to all

questions, unless you know what you're doing.

 We can start with probing for (PCI) I2C or SMBus adapters.

 You do not need any special privileges for this.

 Do you want to probe now? (YES/no):

Type YES and press Enter to begin the probe (do not if you have an IBM ThinkPad notebook; see http://www2.lm-sensors.nu/~lm78/cvs/browse.cgi/lm_sensors2/README.thinkpad for more information). The command will then begin a series of probes of your PC's motherboard and report on found hardware. After you answer the prompts, the program will display one or more recommended command lines (and perhaps a new entry to /etc/modprobe.conf) to enable sensor reporting. For example,

modprobe i2c-isa

modprobe via686a

You can then use the sensors command's –f option to view various component temperatures in Fahrenheit, like this:

$ sensors –f

via686a-isa-6000

Adapter: ISA adapter

Algorithm: ISA algorithm

2.0V:   +1.36 V (min = +1.79 V, max = +2.18 V)

2.5V:   +2.49 V (min = +2.24 V, max = +2.74 V)

I/O:    +3.28 V (min = +2.95 V, max = +3.62 V)

+5V:    +5.02 V (min = +4.47 V, max = +5.49 V)

+12V:   +11.62 V (min = +10.79 V, max = +13.18 V)

Case Fan: 2700 RPM (min = 48214 RPM, div = 2)

CPU Fan: 3497 RPM (min = 67500 RPM, div = 2)

SYS Temp: +98.8°F (limit = +295°F, hysteresis = -95°F)

CPU Temp: +98.8°F (limit = +295°F, hysteresis = -95°F)

SBr Temp: +79.3°F (limit = -74°F, hysteresis = -95°F)

Monitoring your system's hardware can be critically important, especially if you overclock the Central Processing Unit (CPU) in order to gain performance.


Resetting the Date and Time

The Fedora installer will query you during installation for default time zone settings, and whether or not your computer's hardware clock is set to Greenwich Mean Time (GMT)—more properly known as UTC, or Coordinated Universal Time.

Linux provides a system date and time; your computer hardware provides a hardware clock-based time. In many cases, it is possible for the two times to drift apart. Linux system time is based on the number of seconds elapsed since Jan. 1, 1970. Your computer's hardware time depends on the type of clock chips installed on your PC's motherboard, and many motherboard chipsets are notoriously subject to drift.

Keeping accurate time is not only important on a single workstation, but also critically important in a network environment. Backups, scheduled downtimes, and other network-wide actions need to be accurately coordinated.

Fedora provides several date and time utilities you can use at the command line or during an X session, including these:

date— Used to display, set, or adjust the system date and time from the command line

hwclock— A root command to display, set, adjust, and synchronize hardware and system clocks

system-config-date— Red Hat's graphical date, time, and network time configuration tool

Using the date Command

Use the date command to display or set your Linux system time. This command requires you to use a specific sequence of numbers to represent the desired date and time. To see your Linux system's idea of the current date and time, use the date command like this:

# date

Wed Jan 10 14:17:01 EDT 2005

To adjust your system's time (say, to January 23, 2005 at 8 a.m.), use a command line with the month, day, hour, minute, and year, like so:

# date 092308002003

Tue Sep 23 08:00:00 EDT 2003

Using the hwclock Command

Use the hwclock command to display or set your Linux system time, display or set your PC's hardware clock, or to synchronize the system and hardware times. To see your hardware date and time, use hwclock with its --show option like so:

# hwclock --show

Wed 10 Sep 2003 02:17:53 PM EDT  -0.193809 seconds

Use hwclock with its --set and --date options to manually set the hardware clock like so:

# hwclock --set --date "09/23/03 08:00:00"

# hwclock --show

Tue 23 Sep 2003 08:00:08 AM EDT -0.151718 seconds

In these examples, the hardware clock has been set using hwclock, which is then used again to verify the new hardware date and time. You can also hwclock to set the Linux system date and time date using your hardware clock's values with the Linux system date and time.

For example, to set the system time from your PC's hardware clock, use the --hctosys option like so:

# hwclock --hctosys

To set your hardware clock using the system time, use the --systohc option like so:

# hwclock --systohc

Using the system-config-date Client

Fedora's graphical X tool named system-config-date can be used to set your system date and time. Start the client by clicking the desktop menu's System Settings Date & Time menu item, or from the command line of an X11 terminal window like this:

$ system-config-date &

After you press Enter, you will be asked to enter the root password. Type in the root password and click the OK button. You will then see a window, as shown in Figure 4.9.

Figure 4.9. Use Fedora's system-config-date client to set your system date and time.

Set the date and time by using the calendar and time fields. You can also have your workstation obtain updated date and time information via the network by entering a remote time server hostname in the Network Time Protocol field. This will require that the ntpd time daemon be properly configured and running.

NOTE

HTML documentation for using the ntpd daemon is in /usr/share/doc/ntp*/ntpd.htm (if ntpd is installed on your system).

Click on the Time Zone tab to change or verify your system's time zone. The current system time zone is designated by a file named localtime in the /etc directory, and is a copy of the pertinent time zone database file under the /usr/share/zoneinfo directory. For example,

$ ls -l /etc/localtime

-rw-r--r--    1 root     root         1267 Apr  1 16:39 /etc/localtime

 $ ls -l /usr/share/zoneinfo/America/New_York

-rw-r--r--    5 root     root         1267 Mar 13 18:00

/usr/share/zoneinfo/_America/New_York

This file will change if you make a time zone change using system-config-date.


Managing PCMCIA

Mobile Linux users take advantage of notebook PCMCIA slots to add 70-pin, credit-card-sized devices to support Ethernet LAN connectivity, wireless operations, Firewire devices, Compact Flash hard drives, external storage devices, serial ports, and modems. Many different types of PCMCIA cards and Compact Flash form-factor cards in a PCMCIA caddy are supported by the Linux kernel and David Hinds' Card Services software.

Power is provided to PCMCIA devices and adapters directly through the card slot, although some external hardware might require an additional power source. PCMCIA support is enabled and configured at boot time according to the /etc/sysconfig/pcmcia file and /etc/rc.d/init.d/pcmcia startup script. The /etc/sysconfig/pcmcia file might look something like

PCMCIA=yes

PCIC=yenta_socket

PCIC_OPTS=

CORE_OPTS=

Previous incarnations of Linux distros from Red Hat and PCMCIA used specific controller information in this file. With the newer Linux kernels; however, support is provided by kernel modules or direct Linux kernel support.

Using PCMCIA

The PCMCIA Card Services software provides diagnostic information by one or more high or low beeps upon card insertion. One high and one low beep indicate that a card is recognized, but failed to be configured. A single beep indicates that the card was only recognized. Two high beeps indicate that a card was recognized and configured.

For example, if you use a compact flash storage device and insert it into your notebook while using Fedora, you should hear two high beeps. You can then check to see what device has been assigned to the card by using the dmesg command:

$ dmesg

...

hde: SunDisk SDCFB-8, ATA DISK drive

ide2 at 0x100-0x107,0x10e on irq 3

ide-floppy driver 0.99.newide

hde: 15680 sectors (8 MB) w/1KiB Cache, CHS=245/2/32

 hde: hde1

...

Not all the output is shown here (and yours may look different), but this example shows that the card has been recognized and configured as the /dev/hde device (with a single partition, /dev/hde1). You can then use the device as any other storage medium (see Chapter 37, "Managing the File System," for more information on using hard drives with Linux).

Other devices can be similarly recognized and configured. For example, if you have a combination Ethernet and modem PCMCIA card and insert it into your notebook, you should hear two sets of high beeps (to indicate successful recognition and configuration of the network interface and modem). The Linux kernel will report the interface and device information:

$ dmesg

...

eth0: NE2000 (DL10019 rev 05): io 0x300, irq 3, hw_addr 00:E0:98:06:84:C5

ttyS04 at port 0x0af8 (irq = 3) is a 16450

..

Here, the network interface has been recognized as eth0 (see Chapter 17, "Network Connectivity," to see how to connect to a network). The modem is configured to use /dev/ttyS04.

Again, troubleshooting problems with PCMCIA cards can be difficult, especially with the explosion in popularity and type of 802.11b/g wireless networking cards. Such trouble shooting is likely to require downloading, building, and installing new drivers.

Fortunately, however, nearly all serial, modem, and Compact Flash storage cards are easily recognized and configured. Many Ethernet cards are also supported. To check on the current support status for many cards, read the file SUPPORTED.CARDS. You will find a copy under the /usr/share/doc/kernel-pcmcia-cs-3.X.XX/ directory (where X.XX is the version of the package) if you install the pcmcia-cs RPM package.

NOTE

If you have trouble configuring and using a PCMCIA card, browse to the Linux PCMCIA home page at http://pcmcia-cs.sourceforge.net/. Click the SUPPORTED.CARDS link to see if your card is supported. Click the known problems link to see if other users with the same card are having problems, or if the card is not fully supported. If a new version of the PCMCIA kernel drivers are available and changes have been made to your card's drivers (or if a new driver has been developed), download and install the newer software. See Chapter 38 for information on installing the new PCMCIA modules, or follow the directions included with the PCMCIA software.

Controlling PCMCIA Service

Although PCMCIA cards can be inserted or removed while using Red Hat, be careful when using these cards. For example, do not remove a network card while connected to a remote computer. Don't pull a compact flash card or other storage media card (such as an IBM microdrive) while the card's filesystem is mounted and in use—you could corrupt the media's filesystem and experience loss of data.

You can control a PCMCIA device from the command line, and insert and remove the card without physically removing and then inserting the card. Use the cardctl command to control PCMCIA service to one or more card slots on your notebook or desktop PC with a PCMCIA adapter. The cardctl command is used to get and print information about an inserted card, suspend or resume power to a card, reset a card, perform a software insertion or removal, or to configure a card according to a particular, predefined "scheme" (such as using a network in the office or at home). The format of the command is cardctl command slot_number (such as 0 or 1).

For example, if you have inserted a compact flash card, eject the card (after unmounting its filesystem) using the cardctl command and its eject option, along with the card's slot number like this:

# cardctl eject 0

This can save power when running a notebook. When the card is again needed, you can subsequently "insert" the card like so:

# cardctl insert 0


Configuring and Using CD, DVD, and CD-RW Drives

Linux provides support for using a variety of CD and DVD devices and media. This section shows how to determine what device has been assigned to your CD drive and how to get additional drive information if the drive supports recording on optical media.

AT Attachment Packet Interface, or ATAPI IDE-based CD drives, are recognized during installation and work through the ide-cd kernel module. A symbolic link named /dev/cdrom will be created and will point to your CD's device (perhaps /dev/hdb or /dev/hdc). You can use many different types of CD drives with Linux, and you can easily replace, add, or upgrade your system to use a new drive. Part of a successful configuration involves the proper installation of the hardware and being able to determine the drive's device when using Linux.

Checking Drive Assignment

Linux recognizes CD and DVD drives upon booting if they are attached to your computer's motherboard with proper cabling and if they are assigned as either a master or slave on an IDE channel. Look through your kernel boot message for the drive device assignment, such as

hdd: DVDROM 10X, ATAPI CD/DVD-ROM drive

If you have a DVD-capable drive, you generally should also have a symbolic link named /dev/dvd that points to your drive's device because many DVD clients, such as xine or vlc, will look for /dev/dvd by default. If you have a CD-RW drive, the Fedora installer will insert a kernel argument into your boot loader's configuration file that specifies use of the ide-scsi kernel. For example,

append="hdb=ide-scsi"

A similar entry in the grub boot loader's /etc/grub.conf file would look like this:

kernel boot/vmlinuz-6.5-1.358 ro root=/dev/hda2 hdb=ide-scsi

The first CD-RW drive will be assigned to the device /dev/scd0 (although it might still be initially recognized while booting as an IDE device), with subsequent drives assigned to /dev/scd1, and so on. In order to initialize your drive for use, the following modules should be loaded:

Module         Size Used by  Not tainted

sg           30244  0 (autoclean)

sr_mod         15192  0 (autoclean)

cdrom         27872  0 (autoclean) [sr_mod]

ide-scsi        8128  0

scsi_mod        96572  2 [sr_mod ide-scsi]

Look for kernel message output regarding the device such as this:

Attached scsi CD-ROM sr0 at scsi0, channel 0, id 0, lun 0

sr0: scsi3-mmc drive: 0x/32x writer cd/rw xa/form2 cdda tray

Uniform CD-ROM driver Revision: 3.12

Your ATAPI-based CD-RW drive will then work as a SCSI device under emulation, and the symbolic link /dev/cdrom should point to /dev/scd0. You can also use the cdrecord command (included with Red Hat's multimedia software packages) to acquire SCSI device information about your drive for later use during burning operation like this:

# cdrecord -scanbus

Cdrecord 1.10 (i686-pc-linux-gnu) Copyright (C) 1995-2001 Jörg Schilling

Linux sg driver version: 3.1.22

Using libscg version 'schily-0.5'

scsibus0:

    0,0,0   0) 'HL-DT-ST' 'RW/DVD GCC-4120B' '2.01' Removable CD-ROM

    0,1,0   1) *

    0,2,0   2) *

    0,3,0   3) *

    0,4,0   4) *

    0,5,0   5) *

    0,6,0   6) *

    0,7,0   7) *

The pertinent information—0,0,0 in the example (SCSI bus, device ID, and Logical Unit Number, or lun)—can then be used during a burn operation like this:

# cdrecord –v speed=8 dev=0,0,0 –data –eject file_name.img

In this example, a CD-ROM data image named file_name.img is created on a CD-R or CD-RW media at a speed of 8, and the new disk will be ejected after the write operation has completed. See "Burning CDs in Fedora Core Linux" in Chapter 10, "Multimedia Applications," for other ways to create CD-ROMs.

NOTE

Fedora also includes the dvdrecord, dvd+rw-format, and growisofs commands, which can be used with DVD-R and DVD-RW drives.

Initializing FireWire CD Drives

This section provides some basic information you can use if you attach a FireWire CD drive to your system. These drives use a high-speed serial interface, otherwise known as IEEE 1394, which supports data transfers more than 30 times faster than the first version of USB (at speeds up to 400Mbps), although USB 2.0 devices are a bit faster.

Linux has supported FireWire since the advent of the 2.4-series kernel, and now works with many different devices, such as video cameras, VCRs, hard drives, scanners, PCMCIA cards, and CD, DVD, or CD-RW drives. The Fedora Core installer should recognize most FireWire interface hardware; if so, you will be able to use the device with Linux. One Linux FireWire component, the video1394 kernel module, currently supports more than 120 different digital video cameras. General support exists for many different hard drives and DVD or CD-RW drives.

If you install an FireWire interface after Fedora has been installed, you can initialize support for your device, such as a CD-RW drive, by loading the ieee1394 and ohci1394 kernel modules like this:

# insmod ieee1394

# insmod ohci1394

Next, look for relevant device information from the Linux kernel using the dmesg command:

ohci1394: $Revision: 1.80 $ Ben Collins <bcollins@debian.org>

PCI: Found IRQ 10 for device 00:0b.0

PCI: Sharing IRQ 10 with 00:07.5

ohci1394_0: OHCI-1394 1.0 (PCI): IRQ=[10] MMIO=[ee000000-ee000800] \

 Max Packet=[2048]

ieee1394: Device added: node 2:1023, GUID 00d0010500007d8e

ieee1394: sbp2: Driver forced to serialize I/O (serialize_io = 1)

ieee1394: sbp2: Node 2:1023: Max speed [S400] - Max payload [2048]

scsi1 : IEEE-1394 SBP-2 protocol driver

 Vendor: TEAC   Model: CD-W28E      Rev: 1.1A

 Type:  CD-ROM               ANSI SCSI revision: 02

In this example, the FireWire drivers have recognized a CD-RW drive (which will be assigned to /dev/scd1 because another CD-RW is also present on the system). You might also find that the sbp2 kernel module has loaded:

Module         Size Used by  Not tainted

sbp2          14400  0

ohci1394        15872  0 (unused)

ieee1394        25768  0 [sbp2 ohci1394]

NOTE

Fedora's installer should recognize any FireWire hardware in your PC during installation. Depending on your computer's hardware, you might find an entry in /etc/modprobe.conf such as alias ieee1394-controller ohci1394.

Again, use the cdrecord command and its –scanbus option to obtain information needed to use the drive under SCSI emulation:

# cdrecord -scanbus

Cdrecord 1.10 (i686-pc-linux-gnu) Copyright (C) 1995-2001 Jörg Schilling

Linux sg driver version: 3.1.22

Using libscg version 'schily-0.5'

scsibus0:

    0,0,0   0) 'HL-DT-ST' 'RW/DVD GCC-4120B' '2.01' Removable CD-ROM

    0,1,0   1) *

    0,2,0   2) *

    0,3,0   3) *

    0,4,0   4) *

    0,5,0   5) *

    0,6,0   6) *

    0,7,0   7) *

scsibus1:

    1,0,0  100) 'TEAC  ' 'CD-W28E     ' '1.1A' Removable CD-ROM

    1,1,0  101) *

    1,2,0  102) *

    1,3,0  103) *

    1,4,0  104) *

    1,5,0  105) *

    1,6,0  106) *

    1,7,0  107) *

The pertinent information for the FireWire drive—1,0,0 in the example (a drive attached to SCSI bus 1, assigned device 0 and a lun of 0)—can then be used during a read operation like this:

# export CDDA_DEVICE=1,0,0

# cdda2wav -B

Type: ROM, Vendor 'TEAC  ' Model 'CD-W28E     ' Revision '1.1A' MMC+CDDA

724992 bytes buffer memory requested, 4 buffers, 75 sectors

#Cdda2wav version 1.10_linux_2.4.17-0.13smp_i686_i686 real time sched. \

soundcard support

AUDIOtrack pre-emphasis copy-permitted tracktype channels

   1- 8      no       no   audio  2

Table of Contents: total tracks:8, (total time 52:12.72)

 1.( 5:25.67), 2.( 9:06.65), 3.( 5:50.68), 4.( 5:35.57), 5.( 7:28.35)

 6.( 6:34.60), 7.( 6:07.15), 8.( 6:01.05),

Table of Contents: starting sectors

 1.(    0), 2.(  24442), 3.(  65457), 4.(  91775), 5.( 116957)

 6.( 150592), 7.( 180202), 8.( 207742), lead-out( 234822)

CDINDEX discid: SBRXDC1u_.D2S6U1MWq7ksIYOUE-

CDDB discid: 0x5e0c3a08

CD-Text: not detected

CD-Extra: not detected

samplefile size will be 552301388 bytes.

recording 3130.09600 seconds stereo with 16 bits @ 44100.0 Hz ->'audio'...

percent_done:

100% track 1 successfully recorded

100% track 2 successfully recorded

...

In this example, an environment variable named CDDA_DEVICE with the drive's SCSI information is created, and the cdda2wav command is used to extract the entire contents of an audio CD into .wav file format, with each track saved in a separate file. Other utilities might only need to know the name of the device, such as /dev/scd1, like this:

# cdparanoia -d /dev/scd1 -B

cdparanoia III release 9.8 (March 23, 2001)

(C) 2001 Monty <monty@xiph.org> and Xiphophorus

Report bugs to paranoia@xiph.org

http://www.xiph.org/paranoia/

    Couldn't disable kernel command translation layer

Ripping from sector    0 (track 1 [0:00.00])

     to sector 234821 (track 8 [6:01.04])

outputting to track01.cdda.wav

...

NOTE

Fedora also includes the cdrdao command, which can create "Disk-At-Once" (DAO) audio and data CD-ROMs. Other types of CD recording supported by Linux drivers and various CD drives include "Track-At-Once" and "Session-At-Once," which turn the drive's laser on and off during various stages of the recording process.

In this example, the CD-RW device name is used, and again, all tracks from an audio CD will be extracted and saved as .wav audio files. Other graphical clients, such as xine, grip, and xcdroast, are included with Fedora and can be used to create or copy audio and data CDs. See Chapter 10 for more details on burning CDs.

Related Fedora and Linux Commands

You will use these commands when performing post-installation configuration tasks:

apm— Views or uses power management settings and commands

cardctl— Controls PCMCIA slots and services

cdda2wav— Extracts audio files from audio CDs

cdparanoia— ExTRacts audio files from audio CDs

cdrecord— Gets SCSI device information and burns CD-ROMs

chkconfig— Controls services at each Linux runlevel

dmesg— Views information reported by the Linux kernel

insmod— Loads a kernel module into memory

internet-druid— Red Hat's graphical X client (also run as system-config-network) used to detect and configure a modem when configuring a dialup Internet connection

kppp— KDE's X PPP connection utility can detect and use a modem

lsmod— Views loaded kernel modules

mouseconfig— Configures a pointing device for Linux

ntsysv— Controls services started when booting Linux

system-config-date— Red Hat's graphical date and time client

system-config-display— Red Hat's graphical X configuration client

system-config-soundcard— Red Hat's graphical sound card configuration tool

system-config-keyboard— Red Hat's graphical keyboard map configuration tool

system-config-mouse— Red Hat's graphical pointer configuration tool

sensors— Gets the system's power, fan speed, and CPU temperatures

setserial— Configures a serial port from the command line

sndconfig— Configures a sound card for Fedora from the console


Reference

The Linux Keyboard and Console HOWTO—Andries Brouwer's tome on keyboard and console issues; includes many troubleshooting tips.

http://www.avocent.com/Cybex/PublicW2.nsf/gwMain?OpenFrameset—Product details for a KVM switch running Linux.

http://www.luv.asn.au/overheads/virtualconsoles.html—Using virtual consoles with Linux.

http://www.synaptics.com/products/touchpad.cfm—Information about TouchPad pointing devices.

http://www.compass.com/synaptics/—Site for a Linux TouchPad driver.

http://www.x.org/—The X.Org Foundation, home of X11R6 7.0.

http://www.alsa-project.org—Home page for the Advanced Linux Sound Architecture project, an alternative set of sound drivers for Linux.

http://www.opensound.com—Commercial sound drivers for Linux.

/usr/src/linux-2.6/Documentation/power/pci.txt—Patrick Mochel's document regarding PCI power-management routes for Linux kernel and PCI hardware support programmers.

http://www.tldp.org/pub/Linux/docs/HOWTO/Modem-HOWTO—One of the newest HOWTOs on using modems with Linux.

http://www.tldp.org/pub/Linux/docs/HOWTO/Serial-HOWTO—David S. Lawyer's Serial HOWTO, with additional information about Linux and serial port use.

http://www2.lm-sensors.nu/~lm78/cvs/lm_sensors2/doc/FAQ—Information regarding the lm-sensors software for Linux.

http://pcmcia-cs.sourceforge.net/—Source for the latest PCMCIA drivers for Linux.

http://www.camiresearch.com/Data_Com_Basics/RS232_standard.html—A description and tutorial on the EIA232 (formerly RS232) standard.

http://www.qbik.ch/usb/devices/.com—The place to check for compatibility of USB devices for Linux.

http://www.linmodems.org—This site provides links to several drivers for controllerless modem use under Linux.

http://www.linux1394.org/—Home page for the Linux IEEE 1394 project with new information, links to updated drivers, and lists of compatible chipsets and devices.

http://www.faqchest.com/—The FAQchest, a searchable archive of FAQ's HOWTO's and mailing lists; an alternative to http://marc.theaimsgroup.com/.

http://groups.google.com/—Search Usenet group through Google; another alternative to http://marc.theaimsgroup.com/.

http://www.linuxquestions.org/—The Linux Questions site, a useful set of community forums that can help you find answers to your more frustrating problems.

http://www.fokus.gmd.de/research/cc/glone/employees/joerg.schilling/private/_cdrecord.html—Home page for the cdrecord command and related utilities.

http://arstechnica.com/guide/building/bios/bios-1.html—An excellent discussion of BIOS options at ArsTechnica.

http://www.linuxnetmag.com/en/issue5/m5devs1.html—A brief article on how to make use of the information found in devices.txt.


Chapter 5. First Steps with Fedora

IN THIS CHAPTER

  • Working with the Linux File System

  • Logging In to and Working with Linux

  • Changing Your User Information

  • Reading Documentation

  • Using the Shell

  • Using the Text Editors

  • Working with Permissions

  • Working As root

  • Reference

Fedora Core Linux offers a wonderful graphical interface for the desktop (see Chapter 6, "The X Window System"), along with many capable graphical administration tools. However, there are times when you can't manage or use Linux effectively if you don't know how to use text-based programs at the command line. In some situations and with some software packages, the command line offers the only means of interacting with a running system or reconfiguring server software.

In this chapter, you learn the basics of how to use Linux and how to accomplish many routine tasks at the command line. These basic operations include how to read text files or other Linux documentation, list directories, or move, copy, and rename files. New Linux system administrators will get an introduction to using the command line to create new users, manage file permissions, and to properly reboot or shut down a Linux system.

Some of the basic command-line skills covered in this chapter include

  • Performing routine tasks— Logging in and out, using the text console, changing passwords, listing and navigating directories.

  • Basic file management— Creating, renaming, or deleting files and directories.

  • Basic user management— Creating or deleting users from the command line.

  • Basic system management— Shutting down or rebooting, reading manual pages or other documentation, and using text-based tools to edit system configuration files.

Read this chapter if you are migrating to Linux from another platform; the information here is valuable for individual users or system administrators who are new to Linux and learning to use the command line for the first time.

TIP

When you have learned how to use the command line with Linux, you will be comfortable using a Unix command line. This chapter, then, can help provide the foundation information you need to work with other Unix-like operating systems, such as FreeBSD.

NOTE

There are two types of users on a Linux system: normal users (see the section "Basic Linux User Skills") and the root operator, also known as the superuser. At big computing installations, one or more system administrators might have root access or superuser power on the system (perhaps for one-time only tasks). Normal users may rarely, if ever, interact with the root operator.

However, if you use Linux on your PC or notebook as a standalone workstation, you will be both a user and the root operator. Under Linux, root access is required to perform nearly all system and hardware configuration. This might be one of the primary reasons that some new users hold the view that using Linux requires a steep learning curve. Red Hat and other Linux developers have put a lot of effort into making system administration easier for new users by developing improved graphical administration utilities. Because of the way Linux is designed, however, you must become comfortable working with the command line and doing some root-level work, especially if using Linux on a standalone PC. The benefits of learning how to use the command line and work as the superuser far outweigh the disadvantages of allowing your operating system to make important system, file, and user decisions for you. You are in charge of your operating system, not the other way around!


Working with the Linux File System

Fedora uses a file system, or layout of hierarchical directories similar to that used by other Unix variants (such as Mac OS X). Nearly all Linux distributions use a similar directory structure, and Linux distribution vendors have generally agreed on the naming and location of critical Linux files and directories.

NOTE

The effort to build a consensus regarding the Linux directory structure began in 1993 with the Filesystem Hierarchy Standard (FHS), a draft proposal that addressed not only Linux issues, but also for other operating systems, such as BSD. Red Hat has stated that it is committed to stay compliant with the FHS, which specifies the location and names of files and directories. Fedora uses the current 2.3 standard. Key additions to this include the creation of a /media directory for removable storage devices (while keeping /mnt as a temporary mount point). udev has also been added to Fedora; although it's not a part of FHS 2.3, it enables /dev to become a dynamically managed folder allowing the hot-plugging of devices onto the system and the creation (on demand) of device nodes.

The universal layout of directories and file locations for Linux is extremely helpful for individual developers or companies creating distributions, packaging applications, and crafting system administration utilities. For example, knowing that the useradd command is always found under the /usr/sbin directory can simplify the creation of administrative shell scripts designed to be used by system administrators. This information can also help you if you use other Unix-like operating systems or other Linux distributions and need to troubleshoot software installation, or plan the addition of major software packages onto your Fedora system.

To gain the full benefits of this universal layout, you must know how Linux-based operating systems are organized, what the contents are of files and directories on your system, and where files and software should be installed. Understanding the Linux file system is part of learning how to administer and use Linux. As the root operator, you should know the name and proper location of all files (aside from user data) not only to ensure a smoothly running system, but also especially for security reasons.

Viewing the Linux File System

Look at the layout of Fedora Core Linux system by using the list directory contents command, ls, like this:

$ ls /

bin   dev  home    lib         media  mnt   proc  sbin     srv   tftpboot  usr

boot  etc  initrd  lost+found  misc   opt   root  selinux  sys   tmp       var

NOTE

This section provides an overview of the Fedora Core file system. You might find fewer or more directories than discussed here in your own system. When some software packages are installed, they create new directories. Updating software packages might also remove or change the name of some directories. See Chapter 7, "Managing Software and System Resources," for more information on installing, upgrading, or removing software from your Linux system.

To get a more detailed picture, use the tree command to show the root or base directory layout, along with associated subdirectories, like this (note that your system's /usr/src directory might be somewhat different, depending on the version of Fedora you have installed or if you have updated Fedora with a new kernel, and that not all subdirectories are listed):

$ tree -dx /

/

|-- bin

|-- boot

|-- dev

|-- etc

|   |-- X11

|   |-- cron.d

|   |-- ppp

|   |-- rc.d

|   |-- ssh

|   |-- sysconfig

|-- home

|   `-- bball

|-- lib

|   `-- modules

|-- lost+found

|-- media

|   |-- cdrom

|   |-- floppy

|-- misc

|-- mnt

|   |-- cdrom

|   `-- floppy

|-- opt

|-- proc

|-- root

|-- sbin

|-- tftpboot

|-- tmp

|-- usr

|   |-- X11R6

|   |   |-- bin

|   |   |-- include

|   |   |-- lib

|   |-- bin

|   |-- doc

|   |-- include

|   |-- lib

|   |-- local

|   |-- sbin

|   |-- share

|   |-- src

|   |   |-- redhat

|   |   `-- sys

|

`-- var

    |-- ftp

    |-- log

    `-- spool

This example (pruned from more than 30,000 directories) shows the higher-level directories and corresponds to the directories and descriptions in Table 5.1.

Table 5.1. Basic Linux Directories

Name

Description

/

The root directory

/bin

Essential commands

/boot

Boot loader files, Linux kernel

/dev

Device files

/etc

System configuration files

/home

User home directories

/initrd

Initial RAM disk boot support (used during boot time)

/lib

Shared libraries, kernel modules

/lost+found

Directory for recovered files (if found after a filesystem check)

/media

Mount point for removable media such as CD-ROMs and floppy disks

/mnt

Usual mount point for local, remote filesystems

/opt

Add-on software packages

/proc

Kernel information, process control

/root

Superuser (root home)

/sbin

System commands (mostly root only)

/selinux

Holds the data for SELinux, the security component of Fedora

/sys

Real-time information on devices used by the kernel

/tftpboot

Network boot support

/tmp

Temporary files

/usr

Secondary software file hierarchy

/var

Variable data (such as logs); spooled files

Some of the important directories in Table 5.1, such as those containing user and root commands or system configuration files, are discussed in the following sections. You will use and edit files under these directories when you use Fedora.

Use Essential Commands from the /bin and /sbin Directories

The /bin directory (about 5MB if you do a full install) contains essential commands used by the system when running and booting Linux. In general, only the root operator uses the commands in the /sbin directory. Many (though not all) of these commands are statically linked; such commands do not depend on software libraries residing under the /lib or /usr/lib directories. Nearly all the other applications on your system are dynamically linked—meaning that they require external software libraries (also known as shared libraries) in order to run.

TIP

Because the system contains dynamically linked applications, you might sometimes get "dependency errors" when installing or upgrading software packages; in those situations, a supporting library (or application) might not be present. See Chapter 7 for more information on working with dynamically linked applications and other methods of avoiding such problems.

Store the Booted Kernel and View Stored Devices in the /boot and /dev Directories

The /boot directory contains a compressed version of the Linux kernel (loaded at boot time), along with other files that describe the kernel or provide information for booting Linux. When you rebuild or install a new kernel, the kernel and related files are placed in this directory (see Chapter 38, "Kernel and Module Management," for more information on rebuilding or installing a kernel).

Linux device files are contained under the /dev directory. Note that under Linux, nearly everything on your system is a file. This means that (with the exception of network interfaces; see note that follows list) regular files; directories; hard drive partitions; serial, printer, or USB ports; and video and sound devices all are files!

The /dev directory contains more than 7,500 files representing devices that may or may not be in use on your system. Some of the most commonly used devices in this directory include

  • IDE (Integrated Drive Electronics) hard drives, such as /dev/hda and /dev/hdb.

  • CD-ROM drives; some of which are IDE, whereas others are CD-RW (CD read/write) drives emulated as SCSI (Small Computer Systems Interface) devices such as /dev/scd0.

  • Serial ports, such as /dev/ttyS0 for COM1, /dev/ttyS1 for COM2, and so on.

  • Pointing devices, including /dev/input/mice and others.

  • Printers, such as /dev/lp0.

NOTE

Network interfaces (such as eth0 or ppp0) are not represented by Linux device files, but are created in memory when activated. See Chapter 17, "Network Connectivity," for more information.

Use and Edit Files in the /etc Directory

More than 65MB of system configuration files and directories reside under the /etc directory if you install all the software included with this book. Some major software packages, such as Apache, OpenSSH, and xinetd, have directories of configuration files under /etc. Other important system-related configuration files in /etc are

  • fstab— The system filesystem table is a text file listing each hard drive, CD-ROM, floppy, or other storage device attached to your PC. The table indexes each device's partition information with a place in your Linux file system (directory layout) and lists other options for each device when used with Linux (see Chapter 37, "Managing the File System"). Nearly all entries in fstab can be manipulated by root using the mount command.

  • inittab— The system initialization table defines the default runlevel, also known as run-control level or system state. Changes to this file can determine whether your system boots to a graphical or text login, as well as whether dial-up remote access is enabled. (You learn about default runlevels in the section "System Services and Runlevels" located in Chapter 14, "Automating Tasks." See the section "Starting X" located in Chapter 6 to learn more about changing inittab to boot to a graphical interface. Chapter 18, "Internet Connectivity," in the section "Configuring a Dial-In PPP Server" discusses editing inittab to enable dial-up remote access).

  • modprobe.conf— This configuration file contains directions and options used when loading kernel modules to enable various types of hardware, such as sound, USB, networking, and so on (discussed in the section "Managing Modules" in Chapter 38). The contents of this file are used during boot time, and the file can be manually edited or automatically updated by Red Hat's kudzu hardware management server (if enabled, as you learn later in this section).

  • passwd— The list of users for the system, along with user account information. The contents of this file can be changed by various programs, such as useradd or chsh.

  • printcap— The system's printer capabilities database (discussed in the section "Overview of Fedora Linux Printing" in Chapter 11, "Printing with Fedora").

  • shells— A list of approved shells (command-line interfaces).

One of the most important directories under /etc for Fedora is sysconfig. This directory contains network activation scripts and hardware- and software-related information:

$ tree -afx /etc/sysconfig

/etc/sysconfig

|-- /etc/sysconfig/amd

|-- /etc/sysconfig/apm-scripts

|   `-- /etc/sysconfig/apm-scripts/apmscript

|-- /etc/sysconfig/apmd

...

|-- /etc/sysconfig/clock

|-- /etc/sysconfig/console

...

|-- /etc/sysconfig/dhcpd

|-- /etc/sysconfig/dhcrelay

...

|-- /etc/sysconfig/grub

|-- /etc/sysconfig/harddisks

|-- /etc/sysconfig/hidd

|-- /etc/sysconfig/httpd

|-- /etc/sysconfig/hwconf

...

|-- /etc/sysconfig/init

...

|-- /etc/sysconfig/keyboard

|-- /etc/sysconfig/kudzu

|-- /etc/sysconfig/lm_sensors

|-- /etc/sysconfig/mouse

|-- /etc/sysconfig/named

|-- /etc/sysconfig/netdump

...

|-- /etc/sysconfig/network

|-- /etc/sysconfig/network-scripts

|   |-- /etc/sysconfig/network-scripts/ifcfg-eth0

...

|   |-- /etc/sysconfig/network-scripts/ifup-wireless

|   |-- /etc/sysconfig/network-scripts/init.ipv6-global

|   |-- /etc/sysconfig/network-scripts/network-functions

|   `-- /etc/sysconfig/network-scripts/network-functions-ipv6

|-- /etc/sysconfig/networking

|   |-- /etc/sysconfig/networking/devices

|   |-- /etc/sysconfig/networking/devices/ifcfg-eth0

...

|   `-- /etc/sysconfig/networking/profiles

|       `-- /etc/sysconfig/networking/profiles/default

|-- /etc/sysconfig/ntpd

|-- /etc/sysconfig/pand

|-- /etc/sysconfig/pcmcia

...

|-- /etc/sysconfig/redhat-config-users

|-- /etc/sysconfig/redhat-logviewer

|-- /etc/sysconfig/rhn

|   |-- /etc/sysconfig/rhn/rhnsd

|   |-- /etc/sysconfig/rhn/up2date

|   `-- /etc/sysconfig/rhn/up2date-keyring.gpg

|-- /etc/sysconfig/samba

|-- /etc/sysconfig/sendmail

|-- /etc/sysconfig/spamassassin

|-- /etc/sysconfig/squid

|-- /etc/sysconfig/syslog

...

|-- /etc/sysconfig/ups

|-- /etc/sysconfig/vncservers

|-- /etc/sysconfig/xinetd

`-- /etc/sysconfig/yppasswdd

For brevity, not all directories and files are discussed here or listed in the example. /etc/sysconfig contains many different hardware and software settings critical to the operation of your Fedora system. Knowing the location and contents of these files can be helpful if you need to troubleshoot new hardware configurations.

The settings in various files under /etc/sysconfig (such as keyboard, mouse, sound, and so on) are usually created automatically by a related Red Hat or Fedora graphical or console-based configuration utility.

These contents might dynamically change if you use the kudzu hardware configuration service. The kudzu service also prompts you at boot time to remove, configure, or ignore a related setting if kudzu detects new or different hardware (such as a new USB keyboard, network card, or monitor). kudzu creates a file called hwconf that contains a hardware profile of your PC's current state. Note that if kudzu is not enabled or running, you can use device-specific configuration utilities such as system-config-keyboard, or you can manually edit configuration files.

Information about the type of pointing device attached to the PC, for example, is contained in the file /etc/sysconfig/mouse:

MOUSETYPE="ps/2"

XMOUSETYPE="PS/2"

FULLNAME="Generic 3 Button Mouse (PS/2)"

XEMU3=no

If a different mouse, say a three-button USB device, is attached to the computer, you can edit this information to reflect the hardware change:

MOUSETYPE="ps/2"

XMOUSETYPE="IMPS/2"

FULLNAME="Generic 3 Button Mouse (USB)"

XEMU3=no

CAUTION

If you're new to Linux, the system-config-mouse client is the best tool to use to configure a new mouse. You should only manually edit system hardware configuration files used by graphical management clients as a last resort.

Protect the Contents of User Directories—/home

The most important data on a Linux system reside in user's directories, found under the /home directory. Segregating the system and user data can be helpful in preventing data loss and making the process of backing up easier. For example, having user data reside on a separate filesystem or mounted from a remote computer on the network might help shield users from data loss in the event of a system hardware failure.

Use the Contents of the /proc Directory to Interact with the Kernel

The content of the /proc directory is created from memory and only exists while Linux is running. This directory contains special "files" that either extract information from or send information to the kernel. Many Linux utilities extract information from dynamically created directories and files under this directory, also known as a virtual filesystem. For example, the free command obtains its information from a file named meminfo:

$ free

             total       used       free     shared    buffers     cached

Mem:        223260     157800      65460          0      55400      58872

-/+ buffers/cache:      43528     179732

Swap:       491392        400     490992

This information constantly changes as the system is used. You can get the same information by using the cat command to see the contents of the meminfo file:

$ cat /proc/meminfo

        total:    used:    free:  shared: buffers:  cached:

Mem:  228618240 161673216 66945024        0 56750080 60694528

Swap: 503185408   409600 502775808

MemTotal:       223260 kB

MemFree:         65376 kB

MemShared:           0 kB

Buffers:         55420 kB

Cached:          58872 kB

SwapCached:        400 kB

Active:         100328 kB

Inact_dirty:     25044 kB

Inact_clean:     19012 kB

Inact_target:    28876 kB

HighTotal:           0 kB

HighFree:            0 kB

LowTotal:       223260 kB

LowFree:         65376 kB

SwapTotal:      491392 kB

SwapFree:       490992 kB

Committed_AS:    51424 kB

The /proc directory can also be used to dynamically alter the behavior of a running Linux kernel by "echoing" numerical values to specific files under the /proc/sys directory. For example, to "turn on" kernel protection against one type of Denial Of Service (DOS) attack known as SYN flooding, use the echo command to send the number 1 (one) to the following /proc path:

# echo 1 >/proc/sys/net/ipv4/tcp_syncookies

NOTE

The Linux kernel has a number of built-in protections, but good system administration security policies and a secure firewall protecting your gateway, router, or Internet-connected system are the best protection you can use. See the section "Securing Your Network" in Chapter 17 for an overview of firewalling and examples of how to implement Red Hat's network security tools included with Fedora.

Other ways to use the /proc directory include

  • Getting CPU information, such as the family, type, and speed from /proc/cpuinfo.

  • Viewing important networking information under /proc/net, such as active interfaces in tion under /proc/net/dev, routing information in /proc/net/route, and network statistics in /proc/net/netstat.

  • Retrieving filesystem information.

  • Reporting media mount point information via USB; for example, the Linux kernel will report what device to use to access files (such as /dev/sda) if a USB camera or hard drive is detected on the system. You can use the dmesg command to see this information or find information about these devices under the Device File System directory /proc/devfs (see the Linux Devfs FAQ in the file /usr/src/linux-2.6/Documentation/filesystems/devfs/README if the source code for the Linux kernel is installed). The file /usr/src/linux-2.6/Documentation/usb/proc_usb_info.txt contains general information about USB and the /proc directory, as well as what to expect in files under this directory. Note that devfs might be supported, but will generally be superseded in the upcoming 2.6 kernel by /proc/udev, as a way of managing hot-plug devices on your system.

  • Getting the kernel version in /proc/version, performance information such as uptime in /proc/uptime, or other statistics such as CPU load, swap file usage, and processes in /proc/stat.

Work with Shared Data in the /usr Directory

The /usr directory (nearly 5GB in size if you do a full install) contains software applications, libraries, and other types of shared data for use by anyone on the system. Many Linux system administrators give /usr its own partition. A number of subdirectories under /usr contain the X Window System (/usr/X11R6), manual pages (/usr/share/man), software package shared files (/usr/share/name_of_package, such as /usr/share/emacs), additional application or software package documentation (/usr/share/doc), and an entire subdirectory tree of locally built and installed software, /usr/local.

Temporary File Storage in the /tmp Directory

As its name implies, the /tmp directory is used for temporary file storage; as you use Linux, various programs create files in this directory. The /tmp directory is cleaned of stale files each day by the tmpwatch command. (A stale file is any file not used after 10 days.) Fedora is configured by default to use tmpwatch to check /tmp each day by settings in your system's scheduling table, /etc/crontab.

Access Variable Data Files in the /var Directory

The /var directory contains subdirectories used by various system services for spooling and logging. Many of these variable data files, such as print spooler queues, are temporary, whereas others, such as system and kernel logs, are renamed and rotated in use. Incoming electronic mail is usually directed to files under /var/spool/mail.

Linux also uses /var for other important system services. These include the top-most File Transfer Protocol (FTP) directory under /var/ftp (see Chapter 22, "Remote File Serving with FTP"), and the Apache web server's initial home page directory for the system, /var/www/html. (See Chapter 19, "Apache Web Server Management," for more information on using Apache).


Logging In to and Working with Linux

You can access and use a Linux system in a number of ways. One way is at the console with a monitor, keyboard, and mouse attached to the PC. Another way might be via a serial console, either by dial-up via a modem or a PC running a terminal emulator and connected to the Linux PC via a null modem cable. You can also connect to your system through a wired or wireless network using the telnet or ssh commands. The information in this section shows you how to access and use the Linux system using physical and remote text-based logins.

NOTE

This chapter focuses on text-based logins and use of Linux. Graphical logins and using a graphical desktop are described in the section "Starting X" in Chapter 6.

Text-based Console Login

If you sit down at your PC and log in to a Linux system that has not been booted to a graphical login, you see a prompt similar to this one:

Fedora Core release 3 (Heidelberg)

Kernel 2.6.10-1.760_FC3 on an i686

login:

Your prompt might vary, depending on the version of Fedora Core you are using. In any event, at this prompt, type in your username and press Enter. When you are prompted for your password, type it in and press Enter.

NOTE

Note that your password is not echoed back to you, which is a good idea.

Working with Virtual Consoles

After logging in, you will be using an interactive command prompt known as a shell in the Linux text-based or console mode.

While you're sitting at your command prompt, you can also use one or more virtual consoles or terminals. Virtual consoles allow you to log in to Linux multiple times. (Each login is called a session.) This can be useful if you are not using a graphical desktop, but want to use several interactive programs, such as a text editor and web browser, at the same time. To do so, after you log in, run a program and then jump to another login prompt, log in, and start another session. Linux supports 63 virtual consoles, but only the first 6 are configured for use. (You can use 7 if you don't run X11.) Here's how to use virtual Linux consoles:

1. | Log in. You'll be using the first virtual console, or vt1 by default.
2. | Press F2. You should then see another login prompt. Log in again, and you are then using vt2, the second Linux console.
3. | Press Alt+F1 to jump back to vt1.
4. | Press Alt+F2 to jump back to vt2.

You can jump back and forth between sessions by using the Alt key plus the F key number of the desired session, such as F3, F4, F5, or F6.

One caveat when using virtual consoles is that there is a default limit on the available number (usually six) if an active X Window session is occupying vt7. To jump to a virtual console from an X session, press Ctrl+Alt+F2; you'll be at vt2. You can then jump back to your X session from the text-console by pressing Alt+F7 (to go to vt7, in use by X). You should also be careful to save any work in progress before you exit each session and to log out of each session when finished. If you do not, you could leave an open login and shell prompt available at the keyboard to anyone who walks by!

NOTE

In addition to virtual console keystrokes, the Linux console might also recognize the three-fingered salute (or Vulcan neck pinch), Ctrl+Alt+Del. This behavior (and the number of virtual terminals) can be controlled by the system administrator by editing the system's initialization table, /etc/inittab. See the Keyboard and Console HOWTO at http://www.tldp.org/ for more details.

Using Simple Keyboard and Mouse Techniques in a Linux Console Session

Working with Linux in a console-based session usually involves entering commands from the keyboard. However, you can also use simple mouse controls as well. Linux keyboard combinations and mouse support help provide virtual console navigation, start special system actions (such as rebooting or shutting down), provide shortcuts to save typing, and can aid in reading files or viewing program output.

For example, you can scroll the contents of your screen from the console by pressing Shift+PageUp or Shift+PageDown, and can copy and paste text using your mouse buttons. This section shows you how to access default or custom menus at the text console, which can be helpful to get system information or to launch new programs.

If you use a mouse with Linux (and you most likely do), you can use your pointing device for copy and paste operations. This support is provided by gpm, the general purpose mouse server. The gpm server must be enabled or started while booting Linux (see Chapter 14 for more details in the section "Controlling Services at Boot Using Administrative Tools"). To copy a section of text, click and drag text with the left mouse button (button 1) held down. To paste text, click an insertion point, and then press the middle mouse button (button 2).

Button assignment, like all mouse controls during text console use, is managed by command-line options given to gpm when it is started. For example, if you look at the gpm startup script named gpm under the /etc/rc.d/init.d/ directory, you'll see that it uses the file named mouse under the /etc/sysconfig directory to hold options:

# Additional options for gpm (e.g. acceleration), device

OPTIONS=""

DEVICE="/dev/mouse"

You can add options, detailed in the gpm manual page to change how your mouse works, enable or disable features, or assign special commands to a specific mouse button click. For example, to change your button order from 123 (left, middle, and right) to 321, edit the /etc/sysconfig/mouse file as root and change the OPTIONS entry like so:

OPTIONS="-B 321"

After saving your changes, restart gpm like so:

# /etc/rc.d/init.d/gpm restart

Your mouse buttons will now be reversed!

To aid users with a two-button mouse, Linux supports three-button emulation; emulation lets users simultaneously press the right and left mouse buttons to simulate a press of the middle button. You can enable this feature during installation or by using the mouseconfig command. See the section "Configuring Pointing Devices in Linux" in Chapter 4, "Post-Installation Configuration," to see how to use mouseconfig.

The gpm server also provides the ability to reboot or shut down the system with the mouse. Depending on the combination of mouse buttons you press, you have several reboot or shutdown options. Begin by holding down either the left or right mouse button and triple-clicking the opposite button; depending on which mouse button you press next, one of these actions occurs:

  • Pressing the left button causes an immediate reboot using the init command.

  • Pressing the middle button reboots the system using the shutdown command.

  • Pressing the right button causes the system to shut down immediately with the shutdown command.

You can also create custom menus that will pop up at a text-based Linux console by editing the file /etc/gpm-root.conf (as root) and starting the gpm-root command. When you run gpm-root without making changes to its configuration file, by default a system status dialog (with the date, time, CPU load, free memory, and swap file usage) will appear if you hold down the Ctrl key and press the middle mouse button.

You can change your keyboard layouts by using the loadkeys command. To use a different font for the console, try the setfont command. Fedora Core Linux comes with nearly 150 different console fonts, which are found under the /lib/kbd/consolefonts directory. See the section "Configuring Keyboards with Linux" in Chapter 4 to see how to use these commands.

NOTE

A text-based, dial-up login, also known as a shell account, looks much the same as a text-based login at a PC running Linux. Details about setting up Linux to answer the phone and provide a login prompt via a modem are in Chapter 18. Using dial-up access has some limitations, such as the inability to use virtual consoles. From a shell account, however, you can start programs in the background (using the ampersand, &), run programs after logging out with the nohup command, or use the screen command to simulate virtual terminals (an approach that works much like using virtual consoles). For more information on different shells included with Linux, see Chapter 14.

Logging Out

Use the exit or logout commands to exit your session. Type the command and press Enter. You'll then be returned to the login prompt. If you use virtual consoles, remember to exit each console before leaving your PC. (Otherwise, someone could easily sit down and use your account.)

Logging In and Out from a Remote Computer

Although you can happily log in on your computer, an act known as a local log in, you can also log in to your computer via a network connection from a remote computer. Linux-based operating systems provide a number of remote access commands you can use to log in to other computers on your local area network (LAN), wide area network (WAN), or the Internet. Note that not only must you have an account on the remote computer, but also the remote computer must be configured to support remote logins—otherwise, you won't be able to log in.

NOTE

See Chapter 17 to see how to set up network interfaces with Linux to support remote network logins and Chapter 14 to see how to start remote access services (such as sshd).

The best and most secure way (barring future exploits) to log in to a remote Linux computer is to use the ssh or Secure Shell client. Your login and session are encrypted while you work on the remote computer. The ssh client features many different command-line options, but can be simply used with the name of the remote computer, like this:

[andrew@laptop ~]$ ssh desktop

The authenticity of host 'desktop (192.168.2.3)' can't be established.

RSA key fingerprint is 91:7d:74:4b:1c:a1:96:06:ba:2f:d4:cf:78:44:ff:d7.

Are you sure you want to continue connecting (yes/no)? yes

The first time you connect with a remote computer using ssh, Linux displays the remote computer's encrypted identity key and asks you to verify the connection. After you type yes and press Enter, you're warned that the remote computer's identity (key) has been entered in a file named known_hosts under the .ssh directory in your home directory. You're also prompted to enter your password:

Warning: Permanently added 'desktop,192.168.2.3' (RSA) \

to the list of known hosts.

andrew@'desktop's password:

/usr/X11R6/bin/xauth:  creating new authority file /home/winky/.Xauthority

[andrew@desktop andrew]$

After entering your password, you can then work on the remote computer. Again, everything you enter on the keyboard in communication with the remote computer is encrypted. Use the exit or logout commands to exit your session and return to the shell on your computer.

CAUTION

The next remote access command, telnet, is shown as an example because it is included with most Linux distributions, but you shouldn't use it: telnet TRansmits your username and password in clear text across the network, posing a huge security risk for your system. Also, note that this service must be explicitly turned on and allowed on the remote computer (by editing the file named telnet under the /etc/xinetd.d directory and then restarting xinetd; see the section "Starting and Stopping Services Manually" in Chapter 14 for more information on starting or restarting a system service).

The telnet command can be used, along with the name of a remote host or Internet Protocol (IP) address, to log in to a remote computer. For example, to log in to the host named desktop from the host named laptop,

[andrew@laptop andrew]$ telnet desktop

After you press Enter, you'll see some information presented by the remote computer, and you will then be prompted for your username on the remote system:

Trying 192.168.2.70...

Connected to desktop.andbhudson.co.uk (192.168.2.73).

Escape character is '^]'.

Linux 2.6.10-1.741_FC3 (desktop.andbhudson.co.uk) (15:43 on Friday, 4 February 2005)

login: andrew

After you type your username (andrew in this example), press Enter, and you'll be prompted for your password on the remote system:

Password:

Last login: Fri Feb 4 15:42:26 from 192.168.2.2

[andrew@desktop andrew]$

After you type your password and press Enter (your password is not echoed back), you'll be informed of the last time you logged in, and you can then work on the remote computer. Use the exit or logout commands to exit your session and return to the shell on your computer.

Although it is possible to use telnet to log in to a remote computer over a wired and wireless network, such use is not recommended, especially via the Internet. When you type your username and then press Enter and type your password, your username and password are transmitted without encryption over the network. Transmitting usernames and passwords over a network without encryption is a bad idea for obvious reasons. However, if you have a physically secure internal network not connected to the Internet, have firewall policies in place, and don't use wireless networking, there is nothing wrong with using telnet. In fact, the encryption overhead of using ssh can reduce network transmission rates in some cases.

NOTE

It is possible to use telnet securely over an encrypted Virtual Private Network (VPN), but that is beyond the scope of this chapter and book. Besides, why bother when you can use SSH?


Changing Your User Information

Linux users are assigned a name, known as a username, by the root operator. One method of assigning usernames is to use one's first initial and last name in lowercase; for example, Bernice Hudson would have a username of bhudson. Each user must also have a password, which is used with the username either at a graphical or text-based login.

NOTE

Older versions of Linux operating systems limited the length of usernames to 8 characters. The current version of Fedora limits usernames to 32 characters. Good passwords should be a minimum of 8 characters long and contain upper- and lowercase letters, along with numbers. Random passwords for users can be generated using the mkpasswd command (which is included with the expect software package). For example, to generate a 10-character password automatically with three numbers and three digits, use mkpasswd -l 10 -d 3 -C 3. Good passwords are not birthdays, anniversaries, your pet's name, the name of your significant other, or the model of your first car!

You cannot change your username, but you can change your user information, such as address, phone, and so on. You make these changes using the chfn or change finger information command. This command will modify the contents of your entry in the system password file /etc/passwd, which is used by the finger command to display information about a system's user. For example, type chfn at the command line and press Enter:

$ chfn

Changing finger information for bhudson.

Password:

Name []: Bernice Hudson

Office []: Suite 56 N. Centennial Blvd.

Office Phone []: 919 555-1212

Home Phone []: 919 555-1213

Finger information changed.

You're led through a series of prompts to enter new or updated information. Note that the chfn command will not let you use any commas when entering information. You can verify this information in a couple ways, for example, by looking at the contents of /etc/passwd:

$ grep bhdudson /etc/passwd

bhudson:x:501:501:Bernice Hudson,Suite 56 N. Centennial Blvd.,\

919 555-1212,919 555-1213:/home/bhudson:/bin/bash

You also can verify the updated user information by using the finger command:

$ finger bhudson

Login: bhudson                            Name: Bernice Hudson

Directory: /home/bhudson                  Shell: /bin/bash

Office: Suite 56 N. Centennial Blvd.    Office Phone: 919 555-1212

Home Phone: 919 555-1213

Never logged in.

No mail.

No Plan.


Reading Documentation

Although you learn the basics of using Fedora in this book, you need time and practice to master and troubleshoot more complex aspects of the Linux operating system and your distribution. As with any operating system, you can expect to encounter some problems or perplexing questions as you continue to work with Linux. The first place to turn for help with these issues is the documentation included with your system; if you cannot find the information you need there, check Fedora's website.

NOTE

Checking Fedora's website for security updates and bug fixes is a good idea. Browse to http://fedora.redhat.com/download/. Alternatively, you can always do a quick yum update to make sure your system has the most up-to-date software available.

Linux, like Unix, is a self-documenting system, with manual pages accessible through the man command. Linux offers many other helpful commands for accessing its documentation. You can use the apropos command—for example, with a keyword such as partition—to find commands related to partitioning, like this:

$ apropos partition

GNU Parted [parted]  (8)  - a partition manipulation program

fdisk                (8)  - Partition table manipulator for Linux

jfs_mkfs             (8)  - create a JFS formatted partition

jfs_mkfs [mkfs]      (8)  - create a JFS formatted partition

lvmdiskscan          (8)  - scan for all disks / multiple devices / partitions available

mpartition           (1)  - partition an MSDOS hard disk

partprobe            (8)  - inform the OS of partition table changes

pvcreate             (8)  - initialize a disk or partition for use by LVM

sfdisk               (8)  - Partition table manipulator for Linux

To find a command and its documentation, you can use the whereis command. For example, if you are looking for the fdisk command, you can do this:

$ whereis fdisk

fdisk: /sbin/fdisk /usr/share/man/man8/fdisk.8.gz

Using man Pages

To learn more about a command or program, use the man command, followed by the name of the command. Manual pages for Linux and X Window commands are within the /usr/share/man, /usr/local/share/man, and /usr/X11R6/man directories; so, for example, to read the rm command's man page, use the man command like this:

$ man rm

After you press Enter, the less command (a Linux command known as a pager) displays the manual page. The less command is a text browser you can use to scroll forward and backward (even sideways) through the document to learn more about the command. Type the letter h to get help, use the forward slash to enter a search string, or press q to quit.

NOTE

Although nearly all the hundreds of GNU commands included with Linux each have a manual page, detailed information about using a GNU command must be read using the info command. For example, to learn even more about bash (which has a rather extensive manual page), use the info command like this:

$ info bash

Press the n and p keys to navigate through the document, or scroll down to a menu item on the screen and press Enter to read about a specific feature. Press q to quit reading.

Finding and Reading Software Packages Documentation

Documentation for various software packages is included in the /usr/share/doc directory; that directory is stored in another directory that's labeled with the associated package's name. You can find other Linux documentation, known as HOWTOs and Frequently Asked Questions (FAQs), online by browsing to http://www.tldp.org. HOWTO documents contain specific information related to a particular subject, such as printing, setting up a network, programming a serial port, or using a CD-ROM drive with Linux. These documents can be read by using your web browser. Of course, one of the best online tools you can use is a good search engine, such as Google.

You can read document formats such as text with less or another pager or text reader. For example, to read a copy of the GNU General Public License (GPL), a file named GPL_V2 under the /usr/share/apps/LICENSES directory, use less like this:

$ less /usr/share/apps/LICENSES/GPL_V2

After you press Enter, you can scroll back and forth through the file. Press q to quit reading. If a document is in compressed form (ending in .gz), use the zless pager, which will decompress a document first:

$ zless /usr/share/man/es/man1/README.gz

Most users read document formats such as HTML using a web browser in a graphical desktop. Fedora includes at least two versatile text-based web browsers, however, accessed with the lynx and links commands. To browse an HTML file on your system without using X11, use either command, along with the path to the file. For example, to read an HTML version of the GNU GPL with links, use the command like this:

$ links /usr/share/doc/HTML/en/common/gpl-license.html

After you press Enter, use your Up and Down cursor keys to scroll back and forth through the file. Press q, Enter to quit reading. If you have configured a mouse, click the left button near the top of the screen, and links will display its menus.


Using the Shell

The shell is an interactive command prompt with many different features:

  • Input and output redirection

  • Background processing

  • Job control

  • History editing

  • Built-in help

  • Command-line completion

  • Command-line editing

The shell interprets keyboard commands and is generally used to launch other commands or programs using the shell's interpreter language known as shell scripts.

NOTE

Shell scripts are discussed in Chapter 14.

The shell you use is assigned by the last field in your entry in the system's /etc/passwd file. This example, for a user named andrew, shows that the login shell is bash:

andrew:x:502:502::/home/andrew:/bin/bash

The default shell for most Linux distributions, including Fedora, is the GNU bash or Bourne Again SHell, but other shells, such as tcsh, ksh, and zsh are available for use. You can use a different shell by typing its name at the command line. Alternatively, the root operator might assign a user to another shell when creating that user account (see "Working as Root," later in this chapter).

CAUTION

If you're interested in trying a different shell with Linux, you can change your login shell using the chsh command, but make sure that the shell is actually installed on your system. For example, to change your default shell to tcsh, first use the which command to verify that it is installed:

$ which tcsh

/bin/tcsh

This example shows that the tcsh shell is installed under the /bin directory. The tcsh shell should also be listed in your system's list of approved shells, /etc/shells. Check to make sure that it is listed:

$ grep tcsh /etc/shells

/bin/tcsh

You can also use the chsh command's -l option to list valid system shells in order to verify that using tcsh is allowed. Because tcsh is installed and listed in /etc/shells, you can then change your shell using the chsh command:

$ chsh

Changing shell for andrew.

Password:

New shell [/bin/bash]: /bin/ksh

chsh: "/bin/ksh" does not exist.

Note that the chsh command will report an error if you enter the name of a shell not installed on your system.

$ chsh -s /bin/tcsh

Changing shell for andrew.

Password:

Shell changed.

If you now take a look at your /etc/passwd entry, you will see /bin/tcsh as your default shell. The next time you log in, you'll use tcsh.

Using Environment Variables

A number of in-memory variables are assigned and loaded by default when the user logs in. These variables are known as shell environment variables, which can be used by various commands to get information about your environment, such as the type of system you are running, your home directory, and the shell in use. Environment variables are used by Linux operating systems to help tailor the computing environment of your system, and include helpful specifications and setup, such as default locations of executable files and software libraries. If you begin writing shell scripts, you might use environment variables in your scripts. Until then, you only need to be aware of what environment variables are and do.

The following list includes a number of environment variables, along with descriptions of how the shell uses them:

  • PWD— To provide the name of the current working directory, used by the pwd command (such as /home/andrew/foo)

  • USER— To declare the user's name, such as andrew

  • LANG— To set language defaults, such as English

  • SHELL— To declare the name and location of the current shell, such as /bin/bash

  • PATH— To set the default location of executable files, such as /bin, /usr/bin, and so on

  • LD_LIBRARY_PATH— To declare the location of important software libraries (because most, but not all, Linux commands use shared resources)

  • TERM— To set the type of terminal in use, such as vt100, which can be important when using screen-oriented programs, such as text editors

  • MACHINE— To declare system type, system architecture, and so on

NOTE

Each shell can have its own feature set and language syntax, as well as a unique set of default environment variables. See Chapter 14 for more information about using the different shells included with Fedora.

At the command line, you can use the env or printenv commands to display these environment variables, like so:

$ env

PWD=/home/andrew

HOSTNAME=laptop.andbhudson.co.uk

USER=andrew

MACHTYPE=i386-redhat-linux-gnu

MAIL=/var/spool/mail/andrew

BASH_ENV=/home/andrew/.bashrc

LANG=en_GB

DISPLAY=0:0

LOGNAME=andrew

SHLVL=1

PATH=/usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin: \

/usr/X11R6/bin:/home/bball/bin

SHELL=/bin/bash

HOSTTYPE=i386

OSTYPE=linux-gnu

HISTSIZE=1000

TERM=xterm

HOME=/home/andrew

This abbreviated list shows a few common variables. These variables are set by configuration or resource files contained in the /etc, /etc/skel, or user /home directory. You can find default settings for bash, for example, in /etc/profile, /etc/bashrc, the .bashrc, or .bash_profile files installed in your home directory. Read the man page for bash for details about using these configuration files.

One of the most important environment variables is $PATH, which defines the location of executable files. For example, if as a regular user, you try to use a command that is not located in your $PATH, such as the ifconfig command, you'll see something like this:

$ ifconfig

-bash: ifconfig: command not found

However, you might know that ifconfig is definitely installed on your system, and you can verify this using the whereis command like so:

$  whereis ifconfig

ifconfig: /sbin/ifconfig /usr/share/man/man8/ifconfig.8.gz

You can also run the command by typing its full pathname, or complete directory specification like this:

$ /sbin/ifconfig

As you can see in this example, the ifconfig command is indeed installed. What happened is that by default, the /sbin directory is not in your $PATH. One of the reasons for this is that commands under the /sbin directory are normally intended to only be run by root. You can add /sbin to your $PATH by editing the file .bash_profile in your home directory (if you use the bash shell by default, like most Linux users). Look for the following line:

PATH=$PATH:$HOME/bin

You can then edit this file, perhaps using the vi editor (discussed in this chapter), to add the /sbin directory like so:

PATH=$PATH:/sbin:$HOME/bin

Save the file. The next time you log in, the /sbin directory will be in your $PATH. One way to use this change right away is to read in the new settings in .bash_profile by using the bash shell's source command like so:

$ source .bash_profile

You'll now be able to run ifconfig without the need to explicitly type its full pathname.

Some Linux commands also use environment variables, for example, to acquire configuration information (such as a communications program looking for a variable such as BAUD_RATE, which might denote a default modem speed).

To experiment with the environment variables, you can modify the PS1 variable to manipulate the appearance of your shell prompt. If you are working with bash, you can use its built-in export command to change the shell prompt. For example, if your default shell prompt looks like

[andrew@laptop ~]$

You can change its appearance by using the PS1 variable like this:

$  PS1='$OSTYPE r00lz ->'

After you press Enter, you'll see

linux-gnu r00lz ->

NOTE

See the bash manual page for other variables you can use for prompt settings.

Navigating and Searching with the Shell

Use the cd command (built into the shell) to navigate through the Fedora file system. This command is generally used with a specific directory location, or pathname like this:

$ cd /usr/X11R6/lib/X11/doc

Under Fedora, the cd command can also be used with several shortcuts. For example, to quickly move up to the parent (higher-level) directory, use the cd command like this:

$ cd ..

To return to one's home directory from anywhere in the Linux file system, use the cd command like this:

$ cd

You can also use the $HOME shell environment variable to accomplish the same thing. Type this command and press Enter to return to your home directory:

$ cd $HOME

You can accomplish the same thing by using the tilde (~) like this:

$ cd ~

Linux also includes a number of GNU commands you can use to search the file system. These include

  • whereis command— Returns the location of the command and its man page.

  • whatis command— Returns a one-line synopsis from the command's man page.

  • locate file— Returns locations of all matching file(s); an extremely fast method of searching your system, as locate searches a database containing an index of all files on your system; however, this database (about 4MB in size and named slocate.db under the /var/lib/slocate directory) is built daily at 4:20 a.m. by default, and will not contain pathnames to files created during the workday or in the evening.

  • apropos subject— Returns a list of commands related to subject.

Managing Files with the Shell

Managing files in your home directory involves using one or more easily remembered commands. If you have any familiarity with the now ancient DOS, you'll recognize some of these commands (though their names are different from those you remember). Basic file management operations include paging (reading), moving, renaming, copying, searching, and deleting files and directories. These commands include

  • cat filename— Outputs contents of filename to display

  • less filename— Allows scrolling while reading contents of filename

  • mv file1 file2— Renames file1 to file2

  • mv file dir— Moves file to specified directory

  • cp file1 file2— Copies file1 and creates file2

  • rm file— Deletes file

  • rmdir dir— Deletes directory (if empty)

  • grep string file(s)— Searches through files(s) and displays lines containing matching string

Note that each of these commands can be used with pattern-matching strings known as wildcards or expressions. For example, to delete all files in the current directory beginning with the letters abc, you can use an expression beginning with the first three letters of the desired filenames. An asterisk (*) is then appended to match all these files. Use a command line with the rm command like this:

$ rm abc*

Linux shells recognize many types of filenaming wildcards, but this is different from the capabilities of Linux commands supporting the use of more complex expressions. You learn more about using wildcards in Chapter 14.

NOTE

Learn more about using expressions by reading the ex or grep manual pages.

Compressing and Decompressing Files Through the Shell

Another file management operation is compression and decompression of files, or the creation, listing, and expansion of file and directory archives. Linux distros usually include several compression utilities that you can use to create, compress, expand, or list the contents of compressed files and archives. These commands include

  • bunzip2— Expands a compressed file

  • bzip2— Compresses or expands files and directories

  • gunzip— Expands a compressed file

  • gzip— Compresses or expands files and directories

  • shar file— Creates a shell archive of files

  • tar— Creates, expands, or lists the contents of compressed or uncompressed file or directory archives known as tape archives or "tarballs"

  • unshar— Reassembles files from the shell archive

  • uudecode file.uu— Decodes an uuencoded text file to its binary form

  • uuencode file— Encodes a binary file to text file format for transmission via email

NOTE

The rpm command can also be used to manage archived data, but is generally used for software development and management. See Chapter 7 for more information on using RPM.

Most of these commands are easy to use. The tar command, however, has a somewhat complex (though capable) set of command-line options and syntax. Even so, you can quickly learn to use tar by remembering a few simple invocations on the command line. For example, to create a compressed archive of a directory, use tar's czf options like this:

$ tar czf dirname.tgz dirname

The result will be a compressed archive (a file ending in .tgz) of the specified directory (and all files and directories under it). Add the letter v to the preceding options to view the list of files being added during compression and archiving. To list the contents of the compressed archive, substitute the c option with the letter t, like this:

$ tar tzf archive

Of course, if many files are in the archive, a better invocation (in order to easily read or scroll through the output) is

$ tar tzf archive | less

To expand the contents of a compressed archive, use tar's xzf options, like so:

$ tar xzf archive

tar decompresses the specified archive and extracts the contents in the current directory.


Using the Text Editors

Linux distributions include a number of applications known as text editors that you can use to create text files or edit system configuration files. Text editors are similar to word processing programs, but generally have fewer features, only work with text files, and might or might not support spell checking or formatting. The text editors range in features and ease of use, but are found on nearly every Linux distribution. The number of editors installed on your system depends on what software packages you've installed on the system.

Some of the console-based text editors are

  • ed— A simple line editor without cursor support

  • emacs— The comprehensive GNU emacs editing environment, which is much more than an editor; see the section "Working with emacs" later

  • jed— A programmer's text editor with features such as colorized highlighting of text to help syntax checking and editing of programs

  • joe— Joe's Own Editor, a text editor, which can be used to emulate other editors

  • mcedit— A DOS-like text editor for Unix-like systems

  • nano— A simple text editor similar to the pico text editor included with the pine email program

  • sed— A stream editor usually used in shell scripts (discussed in Chapter 14)

  • vim— An improved, compatible version of the vi text editor (which we'll call vi in the rest of this chapter because it has a symbolic link named vi and a symbolically linked manual page)

Note that not all text editors described here are screen-oriented; editors such as ed and sed work on a line-by-line basis, or a stream of text, and do not support movement of a cursor on the screen. Some of the text editors for the X Window System, which provide a graphical interface, such as menu bars, buttons, scrollbars and so on, are

  • gedit— A GUI text editor for GNOME

  • kate— A simple KDE text editor

  • kedit— A simple KDE text editor

  • nedit— A programming text editor

  • kwrite— A simple KDE text editor

A good reason to learn how to use a text-based editor, such as vi, is that system maintenance and recovery operations generally never take place during X Window sessions (negating the use of a GUI editor). Many larger, more complex and capable editors will not work when Linux is booted to its single-user or maintenance mode. See Chapter 14 for more information about how Fedora boots. If anything does go wrong with your system, you probably won't be able to get into the X Window system, making knowledge and experience of using both the command line and text editors such as vi important. Make a point of opening some of the editors and playing around with them; you never know, you might just thank me someday!

Another reason to learn how to use a text-based editor under the Linux console mode is that you will be able to edit text files through dial-up or network shell sessions because many servers do not host graphical desktops.

Working with vi

The editor found on nearly every Unix and Linux system is, without a doubt, the vi editor, originally written by Bill Joy. This simple to use but incredibly capable editor features a somewhat cryptic command set, but you can put it to use with only a few commands. Although older, more experienced Unix and Linux users continue to use vi extensively during computing sessions, many newer users might prefer learning an easier to use text editor such as pico or GNU nano. Die-hard GNU fans and programmers definitely use emacs.

That said, learning how to use vi is a good idea. You might need to edit files on a Linux system with a minimal install, or a remote server without a more extensive offering of installed text editors. Chances are better than good that vi will be available.

You can start an editing session by using the vi command like this:

$ vi file.txt

The vi command works by using an insert, or editing mode, and a viewing (or command) mode.

When you first start editing, you'll be in the viewing mode. You can use your cursor or other navigation keys (as shown later) to scroll through the text. To start editing, tap the i key to insert text, or the a key to append text. When finished, use the Esc key to toggle out of the insert or append modes and into the viewing (or command) mode. To enter a command, type a colon (:), followed by the command, such as w to write the file, and press Enter.

Although vi supports many complex editing operations and numerous commands, you can accomplish work by using a few basic commands. These basic vi commands are

  • Cursor movement— h, j, k, l (left, down, up, and right)

  • Delete character— x

  • Delete line— dd

  • Mode toggle— ESC, Insert (or i)

  • Quit— :q

  • Quit without saving— :q!

  • Run a shell command— :sh (use 'exit' to return)

  • Save file— :w

  • Text search— /

NOTE

Use the vimtutor command to quickly learn how to use vi's keyboard commands. The tutorial takes less than 30 minutes, and it teaches new users how to start or stop the editor, navigate files, insert and delete text and perform search, replace, and insert operations.

Working with emacs

Richard M. Stallman's GNU emacs editor, like vi, is included with Linux and nearly every other Linux distribution. Unlike other Unix and Linux text editors, emacs is much more than a simple text editor—it is an editing environment and can be used to compile and build programs, act as an electronic diary, appointment book and calendar, compose and send electronic mail, read Usenet news, and even play games. The reason for this capability is the emacs contains a built-in language interpreter that uses the Elisp (emacs LISP) programming language.

The GNU version of this editor requires more than 30MB of hard drive space. However, there are versions with less resource requirements, and at least one other text editor included with Linux, named joe, can be used as a emacs clone (albeit with fewer features).

You can start an emacs editing session like this:

$ emacs file.txt

TIP

If you start emacs when using X11, the editor will launch in its own floating window. To force emacs to display inside a terminal window instead of its own window (which can be useful if the window is a login at a remote computer), use the -nw command-line option like this: emacs –nw file.txt.

The emacs editor uses an extensive set of keystroke and named commands, but you can work with it using a basic command subset. Many of these basic commands require you to hold down the Ctrl key, or to first press a meta key (generally mapped to the Alt key). The basic commands are listed in Table 5.2.

Table 5.2. Emacs Editing Commands

Action

Command

Abort

Ctrl+g

Cursor left

Ctrl+b

Cursor down

Ctrl+n

Cursor right

Ctrl+f

Cursor up

Ctrl+p

Delete character

Ctrl+d

Delete line

Ctrl+k

Go to start of line

Ctrl+a

Go to end of line

Ctrl+e

Help

Ctrl+h

Quit

Ctrl+x, Ctrl+c

Save As

Ctrl+x, Ctrl+w

Save file

Ctrl+x, Ctrl+s

Search backward

Ctrl+r

Search forward

Ctrl+s

Start tutorial

Ctrl+h, t

Undo

Ctrl+x, u

TIP

One of the best reasons to learn how to use emacs is that you can use nearly all the same keystrokes to edit commands on the bash shell command line. Another reason is that like vi, emacs is universally available on nearly every Unix and Linux system, including Apple's Mac OS X.


Working with Permissions

Under Linux (and Unix), everything in the file system, including directories and devices, is a file. And every file on your system has an accompanying set of permissions based on ownership. These permissions form the basis for security under Linux, and designate each file's read, write, and execute permission for you, members of your group, and all others on the system.

You can examine the default permissions for a file you create by using the umask command, or as a practical example, by using the touch command and then the ls command's long-format listing like this:

$ touch file

$ ls -l file

-rw-rw-r--    1 andrew    andrew           0 Jul 23 12:28 file

In this example, the touch command is used to quickly create a file. The ls command then reports on the file, displaying information (from left to right) in the first field of output (such as -rw-rw-r-- previously)

  • The first character of the field is the type of file created— Common indicators of the type of file are a leading letter in the output. A blank (in the preceding example, which is represented by a dash) designates a plain file, d designates a directory, c designates a character device (such as /dev/ttyS0), and b is used for a block device (such as /dev/hda).

  • Permissions— Read, write, and execute permissions for the owner, group, and all others on the system. (You learn more about these permissions later in this section.)

  • Number of links to the file— The number one (1) designates that there is only one file, whereas any other number indicates that there might be one or more hard-linked files. Links are created with the ln command. A hard-linked file is an exact copy of the file, but it might be located elsewhere on the system. Symbolic links of directories can also be created, but only the root operator can create a hard link of a directory.

  • The owner— The account that created or owns the file; you can change this designation by using the chown command.

  • The group— The group of users who are allowed to access the file; you can change this designation by using the chgrp command.

  • File size and creation/modification date— The last two elements indicate the size of the file in bytes and the date the file was created or last modified.

Assigning Permissions

Under Linux, permissions are grouped by owner, group, and others, with read, write, and execute permission assigned to each, like so:

Owner    Group    Others

rwx      rwx      rxw

Permissions can be indicated by mnemonic or octal characters. Mnemonic characters are

  • r indicates permission for an owner, member of the owner's group, or others to open and read the file.

  • w indicates permission for an owner, member of the owner's group, or others to open and write to the file.

  • x indicates permission for an owner, member of the owner's group, or others to execute the file (or read a directory)

In the previous example for the file named file, the owner, andrew, has read and write permission, as does any member of the group named andrew. All other users may only read the file. Also note that default permissions for files created by the root operator will be different! This is because of umask settings assigned by the shell.

Many users prefer to represent permissions using numeric codes, based on octal (base-8) values. Here's what these values mean:

  • 4 indicates read permission.

  • 2 indicates write permission.

  • 1 indicates execute permission.

In octal notation, the previous example file has a permission setting of 664 (read+write or 4+2, read+write or 4+2, read-only or 4). Although you can use either form of permissions notation, octal is easy to use quickly after you visualize and understand how permissions are numbered.

NOTE

In Linux, you can create groups to assign a number of users access to common directories and files, based on permissions. You might assign everyone in accounting to a group named accounting, for example, and allow that group access to accounts payable files while disallowing access by other departments. Defined groups are maintained by the root operator, but you can use the newgrp command to temporarily join other groups in order to access files (as long as the root operator has added you to the other groups). You can also allow or deny access to your files by other groups by modifying the group permissions of your files.

Directory Permissions

Directories are also files under Linux. For example, again use the ls command to show permissions like this:

$ mkdir foo

$ ls -ld foo

drwxrwxr-x    2 andrew    andrew        4096 Jan 23 12:37 foo

In this example, the mkdir command is used to create a directory. The ls command and its -ld option is used to show the permissions and other information about the directory (not its contents). Here you can see that the directory has permission values of 775 (read+write+execute or 4+2+1, read+write+execute or 4+2+1, and read+execute or 4+1).

This shows that the owner and group members can read and write to the directory and, because of execute permission, also list the directory's contents. All other users can only list the directory contents. Note that directories require execute permission in order for anyone to be able to view their contents.

You should also notice that the ls command's output shows a leading d in the permissions field. This letter specifies that this file is a directory; normal files will have a blank field in place. Other files, such as those specifying a block or character device, will have a different letter (see the section "Managing Files for Character Devices, Block Devices, and Special Devices" in Chapter 37 for more information about block devices).

For example, if you examine the device file for a Linux serial port, you will see

$ ls -l /dev/ttyS0

crw-rw----    1 root     uucp       4,  64 Jan 23 23:38 /dev/ttyS0

Here, /dev/ttyS0 is a character device (such as a serial communications port and designated by a c) owned by root and available to anyone in the uucp group. The device has permissions of 660 (read+write, read+write, no permission).

On the other hand, if you examine the device file for an IDE hard drive, you'll see

$ ls -l /dev/hda

brw-rw----    1 root     disk       3,   0 Jan 23 23:37 /dev/hda

In this example, b designates a block device (a device that transfers and caches data in blocks) with similar permissions. Other device entries you will run across on your Linux system include symbolic links, designated by s.

You can use the chmod command to alter a file's permissions. This command uses various forms of command syntax, including octal or a mnemonic form (such as u, g, o, or a and rwx, and so on) to specify a desired change. The chmod command can be used to add, remove, or modify file or directory permissions in order to protect, hide, or open up access to a file by other users (except for root, who can access any file or directory on a Linux system).

The mnemonic forms of chmod's options (when used with a plus character, +, to add, or a minus sign, -, to take away) designate the following:

u— Adds or removes user (owner) read, write, or execute permission

g— Adds or removes group read, write, or execute permission

o— Adds or removes read, write, or execute permission for others not in a file's group

a— Adds or removes read, write, or execute permission for all users

r— Adds or removes read permission

w— Adds or removes write permission

x— Adds or removes execution permission

For example, if you create a file, such as a readme.txt, the file will have default permissions (set by the umask setting in /etc/bashrc) of

-rw-rw-r--    1 andrew    andrew          12 Jan  2 16:48 readme.txt

As you can see, you and members of your group can read and write the file. Anyone else can only read the file (and only if it is outside of your home directory, which will have read, write, and execute permission set only for you, the owner). You can remove all write permission for anyone by using chmod, the minus sign, and aw like so:

$ chmod -aw readme.txt

$ ls -l readme.txt

-r--r--r--    1 andrew    andrew          12 Jan  2 16:48 readme.txt

Now, no one will be able to write to the file (except you, if the file is in your home or /tmp directory because of directory permissions). To restore read and write permission for only you as the owner, use the plus sign and the u and rw options like so:

$ chmod u+rw readme.txt

$ ls -l readme.txt

-rw-------    1 andrew    andrew          12 Jan  2 16:48 readme.txt

You can also use the octal form of the chmod command, for example, to modify a file's permissions so that only you, the owner, can read and write a file. Use the chmod command and a file permission of 600, like this:

$ chmod 600 readme.txt

If you take away execution permission for a directory, files might be hidden inside and may not be listed or accessed by anyone else (except the root operator, of course, who has access to any file on your system). By using various combinations of permission settings, you can quickly and easily set up a more secure environment, even as a normal user in your home directory.

Understanding Set User ID and Set Group ID Permissions

Another type of permission is "set user ID", known as suid, and "set group ID" (sgid) permissions. These settings, when used in a program, enable any user running that program to have program owner or group owner permissions for that program. These settings enable the program to be run effectively by anyone, without requiring that each user's permissions be altered to include specific permissions for that program.

One commonly used program with suid permissions is the passwd command:

$ ls -l /usr/bin/passwd

-r-s--x--x    1 root     root        13536 Jan 12  2000 /usr/bin/passwd

This setting allows normal users to execute the command (as root) in order to make changes to a root-only accessible file, /etc/passwd.

You also can assign similar permission using the chfn command. This command allows users to update or change finger information in /etc/passwd. You accomplish this permission modification by using a leading 4 (or the mnemonic s) in front of the three octal values.

NOTE

Other files that might have suid or guid permissions include at, rcp, rlogin, rsh, chage, chsh, ssh, crontab, sudo, sendmail, ping, mount, and several Unix-to-Unix Copy (UUCP) utilities. Many programs (such as games) might also have this type of permission in order to access a sound device.

Files or programs that have suid or guid permissions can sometimes present security holes because they bypass normal permissions. This problem is especially compounded if the permission extends to an executable binary (a command) with an inherent security flaw because it could lead to any system user or intruder gaining root access. In past exploits, this typically happened when a user fed a vulnerable command with unexpected input (such as a long pathname or option); the command would bomb out, and the user would be presented a root prompt. Although Linux developers are constantly on the lookout for poor programming practices, new exploits are found all the time, and can crop up unexpectedly, especially in newer software packages that haven't had the benefit of peer developer review.

Savvy Linux system administrators will keep the number of suid or guid files present on a system to a minimum. The find command can be used to display all such files on your system:

# find / -type f -perm +6000 -exec ls -l {} \;

NOTE

The find command is quite helpful and can be used for many purposes, such as before or during backup operations. See the section "Using Backup Software" in Chapter 16, "Backing Up, Restoring, and Recovery."

Note that the programs do not necessarily have to be removed from your system. If your users really do not need to use the program, you can remove execute permission of the program for anyone. You will have to decide, as the root operator, whether your users are allowed to, for example, mount and unmount CD-ROMs or other media on your system. Although Linux-based operating systems can be set up to accommodate ease of use and convenience, allowing programs such as mount to be suid might not be the best security policy. Other candidates for suid permission change could include the chsh, at, or chage commands.


Working As root

The root, or superuser account, is a special account and user on Unix and Linux systems. Superuser permissions are required in part because of the restrictive file permissions assigned to important system configuration files. You will need root permission in order to edit these files or to access or modify certain devices (such as hard drives). When logged in as root, you have total control over your system, which can be dangerous.

When you work in root, you have the ability to destroy a running system with a simple invocation of the rm command like this:

# rm -fr /

This command line will not only delete files and directories, but also could wipe out file systems on other partitions and even remote computers. This alone is reason enough to take precautions when using root access.

The only time you should run Linux as the superuser is when booting to runlevel 1, or system maintenance mode, to configure the filesystem, for example, or to repair or maintain the system. Logging in and using Linux as the root operator isn't a good idea because it defeats the entire concept of file permissions.

Knowing how to run commands as root without logging in as root can help avoid serious missteps when configuring your system. Linux comes with a command named su that allows you to run one or more commands as root and then quickly return you to normal user status. For example, if you would like to edit your system's filesystem table (a simple text file that describes local or remote storage devices, their type, and location), you can use the su command like this:

$ su -c "nano -w /etc/fstab"

Password:

After you press Enter, you will be prompted for a password that gives you access to root. This extra step can also help you "think before you leap" into the command. Enter the root password, and you will then be editing /etc/fstab using the nano editor with line wrapping disabled.

CAUTION

Before editing any important system or software service configuration file, make a backup copy. Then make sure to launch your text editor with line wrapping disabled. If you edit a configuration file without disabling line wrapping, you could insert spurious carriage returns and line feeds into its contents, causing the configured service to fail when restarting. By convention, nearly all configuration files are formatted for 80-character text width, but this is not always the case. By default, the vi and emacs editors don't use line wrap.

You can use sudo to assign specific users permission to perform specific tasks (similar to BSD Unix and its "wheel" group of users) . The sudo command works by first examining the file named sudoers under the /etc directory; you modify this file with the visudo command. See the section "Granting Root Privileges on Occasion—The sudo Command" in Chapter 13, "Managing Users," for details on how to configure and use sudo.

Creating Users

When a Linux system administrator creates a user, an entry in /etc/passwd for the user is created. The system also creates a directory, labeled with the user's username, in the /home directory. For example, if you create a user named bernice, the user's home directory is /home/bernice.

NOTE

In this chapter, you learn how to manage users from the command line. See Chapter 13 for more information on user administration with Fedora using graphical administration utilities, such as the system-config-users client.

Use the useradd command, along with a user's name to quickly create a user:

# useradd andrew

After creating the user, you must also create the user's initial password with the passwd command:

# passwd andrew

Changing password for user andrew.

New password:

Retype new password:

passwd: all authentication tokens updated successfully.

Enter the new password twice. If you do not create an initial password for a new user, the user won't be able to log in.

You can view useradd's default new user settings by using the command and its -D option like this:

# useradd -D

GROUP=100

HOME=/home

INACTIVE=-1

EXPIRE=

SHELL=/bin/bash

SKEL=/etc/skel

These options display the default group ID, home directory, account and password policy (active forever with no password expiration), the default shell, and the directory containing defaults for the shell.

The useradd command has many different command-line options. The command can be used to set policies and dates for the new user's password, assign a login shell, assign group membership, and other aspects of a user's account.

Deleting Users

Use the userdel command to delete users from your system. This command will remove a user's entry in the system's /etc/passwd file. You should also user the command's -r option to remove all the user's files and directories (such as the user's mail spool file under /var/spool/mail):

# userdel -r winky

If you do not use the -r option, you will have to manually delete the user's directory under /home, along with the user's /var/spool/mail queue.

Shutting Down the System

Use the shutdown command to shut down your system. The shutdown command has a number of different command-line options (such as shutting down at a predetermined time), but the fastest way to cleanly shut down Linux is to use the -h or halt option, followed by the word now or the numeral zero (0), like this:

# shutdown -h now

or

# shutdown -h 0

To incorporate a timed shutdown and a pertinent message to all active users, use shutdown's time and message options, like so:

# shutdown -h 18:30 "System is going down for maintenance this evening"

This example will shut down your system and provide a warning to all active users 15 minutes before the shutdown (or reboot). Shutting down a running server can be considered drastic, especially if there are active users or exchanges of important data occurring (such as a backup in progress). One good approach is to warn users ahead of time. This can be done by editing the system Message of the Day (MOTD) motd file, which displays a message to users after login. To create your custom MOTD, use a text editor and change the contents of /etc/motd. You can also make downtimes part of a regular schedule, perhaps to coincide with security audits, software updates, or hardware maintenance.

You should shut down Fedora only for a few very specific reasons:

  • You are not using the computer and want to conserve electrical power.

  • You need to perform system maintenance that requires any or all system services to be stopped.

  • You want to replace integral hardware.

TIP

Do not shut down your computer if you suspect that one or more intruders has infiltrated your system; instead, disconnect the machine from any or all networks and make a backup copy of your hard drives. You might want to also keep the machine running to examine the contents of memory and to examine system logs. See Chapter 17 and the section "Securing Your Network" on how to protect and monitor a network-connected system.

Rebooting the System

You should also use the shutdown command to reboot your system. The fastest way to cleanly reboot Linux is to use the -r option, and the word now or the numeral zero (0):

# shutdown -r now

or

# shutdown -r 0

Rebooting or shutting down can both have dire consequences if performed at the wrong time (such as during backups or critical file transfers, which arouse the ire of your system's users). However, Linux-based operating systems are designed to properly stop active system services in an orderly fashion. Other commands you can use to shut down and reboot Linux are the halt and reboot commands, but the shutdown command is more flexible.

Related Fedora and Linux Commands

The following programs and built-in shell commands are commonly used when working at the command line. These commands are organized by category to help you understand the command's purpose. If you need to find full information for using the command, you can find that information under the command's man page.

Managing users and groups— chage, chfn, chsh, edquota, gpasswd, groupadd, groupdel, groupmod, groups, mkpasswd, newgrp, newusers, passwd, umask, useradd, userdel, usermod

Managing files and filesystems— cat, cd, chattr, chmod, chown, compress, cp, dd, fdisk, find, gzip, ln, mkdir, mksfs, mount, mv, rm, rmdir, rpm, sort, swapon, swapoff, tar, touch, umount, uncompress, uniq, unzip, zip

Managing running programs— bg, fg, kill, killall, nice, ps, pstree, renice, top, watch

Getting information— apropos, cal, cat, cmp, date, diff, df, dir, dmesg, du, env, file, free, grep, head, info, last, less, locate, ls, lsattr, man, more, pinfo, ps, pwd, stat, strings, tac, tail, top, uname, uptime, vdir, vmstat, w, wc, whatis, whereis, which, who, whoami

Console text editors— ed, jed, joe, mcedit, nano, red, sed, vim

Console Internet and network commands— bing, elm, ftp, host, hostname, ifconfig, links, lynx, mail, mutt, ncftp, netconfig, netstat, pine, ping, pump, rdate, route, scp, sftp, ssh, tcpdump, traceroute, whois, wire-test


Reference

The migration to a new computer operating system doesn't have to be painful to management and users. Providing easy-to-understand directions, some background information, and pre-configuration of an installed system can help the transition.

This section lists some additional points of reference with background information on the standards and commands discussed in this chapter. Browse these links to learn more about some of the concepts discussed in this chapter and to expand your knowledge of your new Linux community.

http://www.winntmag.com/Articles/Index.cfm?ArticleID=7420—An article by a Windows NT user who, when experimenting with Linux, blithely confesses to rebooting the system after not knowing how to read a text file at the Linux console.

http://standards.ieee.org/regauth/posix/—IEEE's POSIX information page.

http://www.itworld.com/Comp/2362/lw-01-government/#sidebar—Discussion of Linux and POSIX compliance.

http://www.pathname.com/fhs/—Home page for the Linux FHS, Linux Filesystem Hierarchy Standard.

http://www.tldp.org—Browse the HOWTO section to find and read The Linux Keyboard and Console HOWTO—Andries Brouwer's somewhat dated but eminently useful guide to using the Linux keyboard and console.

http://www.gnu.org/software/emacs/emacs.html—Home page for the FSF's GNU emacs editing environment; you'll find additional documentation and links to the source code for the latest version here.

http://www.vim.org/—Home page for the vim (vi clone) editor included with Linux distros. Check here for updates, bug fixes, and news about this editor.

http://www.courtesan.com/sudo/—Home page for the sudo command. Check here for the latest updates, security features, and bug fixes.


Chapter 6. The X Window System

IN THIS CHAPTER

  • Basic X Concepts

  • Using X11R6

  • Starting X

  • Selecting and Using Window Managers

  • The GNOME and KDE Desktop Environments

  • Reference

The X Window System, also known as X11R6, X11, and simply X, provides the graphical networking interface for your Fedora desktop. X started as a consortium-based project at the Massachusetts Institute of Technology in the early 1980s, and over the years it has gone through several major revisions. X is managed in open-source form by an organization named X.org.

X uses a client/server model. Clients are simply X programs written to take advantage of the network communication and graphics drawing protocols available in supporting software libraries. The X server communicates with clients and manages many different aspects of a local or remote desktop session. The X server used with Fedora is X11R6 8.2, an open-source version of the X Window System provided by The X.Org Foundation.

Today there are X.Org distributions for many platforms besides Intel-based PCs. The open-source version of X from The X.Org Foundation included with Fedora is a merger of the previous releases of X11R6 and XFree86, the version of X Windows shipped with earlier versions of Fedora and Red Hat Linux.

This chapter shows you how to work with the version of X11 included with Fedora. After a brief overview of X and X.org, you will learn how to configure X to work with Linux on your computer, useful if you install a new video card or attach a new LCD panel. You will learn how to start X and select and use X window managers—the X clients that draw and manage window displays, decorations, and onscreen icons. You will also get an introduction to Fedora's graphical desktop environment.

The Red Hat and Fedora Desktop

Red Hat initially caused quite a stir among veteran Linux users because of the decision to introduce consistency in the menus, dialogs, and client look and feel of GNOME and the K Desktop Environment (KDE), starting with Red Hat Linux 8.0. This action, part of the natural evolution of Red Hat's product line, provides a basic framework for the Red Hat desktop as a base Linux product in future commercial product lines. The new desktop is evolving, and enables Red Hat, Inc. to more easily integrate advanced products, such as enterprise-level web, database, application, or development server software.

Bluecurve, the new Red Hat desktop theme, was also used with Red Hat Linux 9 and now Fedora. While considered heresy by some die-hard users on both sides of the GNOME and KDE camps, the theme consistency actually helps novice Red Hat and Fedora users easily migrate from other operating systems by enabling them to learn a single set of controls and preferences while working in the new graphical interface.

The truth is that Fedora offers you the choice of whether to use the Red Hat desktop or another theme. You are entirely free to use a different desktop and to configure GNOME or KDE to look entirely different from the default graphical desktop. Fedora also includes alternative and legacy window managers, such as the Motif Window Manager mwm, and the twm window manager (which are discussed later in this chapter).


Basic X Concepts

The underlying engine of X11 is the X protocol, which provides a system of managing displays on local and remote desktops. The protocol uses a client/server model that allows an abstraction of the drawing of client windows and other decorations locally and over a network. An X server draws client windows, dialog boxes, and buttons that are specific to the local hardware and in response to client requests. The client, however, does not have to be specific to the local hardware. This means that system administrators can set up a network with a large server and clients and enable users to view and use those clients on workstations with totally different CPUs and graphics displays.

NOTE

As an example of X's support for remote client use, much of the original text of this chapter was written using the OpenOffice.org office suite, but the keyboard and display used for writing were part of a Sony VAIO laptop running Fedora; OpenOffice.org was launched from a Dell notebook running Fedora Core 3. Subsequent revisions were made on a workstation running Fedora Core 4, using the open-source OpenOffice.org office suite via a remote 802.11g connection from an IBM ThinkPad running Red Hat Enterprise Linux 4 WS.

X11's form of distributed processing means that Fedora, along with X11R6, can be used as a stable, cost-efficient desktop PC platform for using clients launched from a more powerful server, minicomputer, or mainframe. The X model provides a way to continue to use legacy PCs when more powerful systems are put in place, and it can help centralize the job of system management.

X is popular with Unix and Linux users, system administrators, and network engineers for a number of reasons. X is extremely portable and works with nearly every hardware-based graphics system on the market. This allows X to be deployed and used with high-end workstations and diminutive embedded devices. X also provides portable and multi-platform programming standards that truly allow write-once, cross-platform development.

Another attractive feature of X is its networking capabilities, which easily allow management of thousands of workstations, deployment of thin-client desktops, remote launching of applications, and standardization of installations—all working over a variety of media, such as Ethernet and wireless network connections. Although early releases of X supported only a handful of display architectures, subsequent versions have enabled the use of compressed fonts, shaped (that is, non-rectangular) windows, and a graphical login manager, known as a display manager (see the section "Using a Display Manager," later in this chapter). X also provides a mechanism for customizing how X clients appear: It allows you to edit text files that contain window or button appearance settings. These settings, known as resources, are available for nearly every X11 client.

Many small office/home office (SOHO) environments and computer hobbyists run Linux and X locally on non-networked PCs. But small business, academic, corporate, and enterprise-class environments can also reap the benefits of adopting and using X and Fedora for network computing. By using X, administrative staff, users, and in-house developers can enjoy custom or standardized desktops, and applications can be stored in and launched from a single location. This can make the job of system and software maintenance a lot easier.


Using X11R6

X11R6 8.2 is the X server that is used with Fedora. The base X.Org distribution consists of 30 RPM packages (almost 120MB), which contain the server, along with support and development libraries, fonts, various clients, and documentation. An additional 1,000 or more X clients, fonts, and documentation are also included with Fedora.

NOTE

A full installation of X and related X11R6 files can consume more—usually much more—than 170MB of hard drive space. This is because additional clients, configuration files, and graphics (such as icons) are under the /usr/bin and /usr/share directory trees. You can pare excessive disk requirements by judiciously choosing which X-related packages (such as games) to not install on workstations. However, with the increased capacity of most desktop PC hard drives today, the size requirements are rarely a problem, except in configuring thin-client desktops or embedded systems.

The /usr/X11R6 directory and its subdirectories contain the majority of XFree86's software. Some important subdirectories are

  • /usr/X11R6/bin— This is the location of the X server and various X clients. (Note that not all X clients require active X sessions.)

  • /usr/X11R6/include— This is the path to the files necessary for developing X clients and graphics such as icons.

  • /usr/X11R6/lib— This directory contains required software libraries to support the X server and clients.

  • /usr/X11R6/lib/X11— This directory contains fonts, default client resources, system resources, documentation, and other files that are used during X sessions and for various X clients. You will also find a symbolic link to this directory, named X11, under the /usr/lib directory.

  • /usr/X11R6/lib/modules— This path to drivers and the X server modules used by the X server enables use of various graphics cards.

  • /usr/X11R6/man— This directory contains directories of manual pages for X11 programming and clients.

The main components required for an active local X session will be installed on your system if you choose to use a graphical desktop. These components are the X server, miscellaneous fonts, a terminal client (that is, a program that provides access to a shell prompt), and a client known as a window manager. Window managers, which are discussed later in this chapter (see the section "Selecting and Using X Window Managers"), administer onscreen displays, including overlapping and tiling windows, command buttons, title bars, and other onscreen decorations and features.

Elements of the xorg.conf File

The single most important file required to launch X on a desktop is the xorg.conf configuration file. This text file can be created during installation or modified post-installation by using the system-config-display client (see "Configuring X," later in this chapter). xorg.conf is located under the /etc/X11 directory and contains file locations, hardware descriptions, and specifications needed by the xorg server in order to work with the computer's graphics card and display monitor.

You will be better equipped to troubleshoot configuration problems and add or remove features of the X session if you understand the contents of the xorg.conf file. The components, or sections, of xorg.conf specify the X sessionor server layout, along with paths for files used by the server, server options, optional support modules to load, descriptions of the mouse and keyboard, graphics device, monitor, screen layout, and video modes to use. Of the 12 sections of an xorg.conf file, these are the essential components:

  • ServerLayout— Defines the display, defines one or more screen layouts, and names input devices.

  • Files— Defines the location of colors, fonts, or port number of the font server.

  • Module— Tells the X server what graphics display support code modules to load.

  • InputDevice— Defines the input devices, such as the keyboard and mouse; multiple devices can be used.

  • Monitor— Defines the capabilities of any attached display; multiple monitors can be used.

  • Device— Defines one or more graphics cards and specifies what optional (if any) features to enable or disable.

  • Screen— Defines one or more resolutions, color depths, perhaps a default color depth, and other settings.

The following sections provide short descriptions of these elements; the xorg.conf manual page contains full documentation of all the options and other keywords you can use to customize your desktop settings.

The ServerLayout Section

As noted previously, the ServerLayout section of the xorg.conf file defines the display and screen layouts, and it names the input devices. A typical ServerLayout section from an automatically configured xorg.conf file might look like this:

Section "ServerLayout"

        Identifier     "single head configuration"

        Screen      0  "Screen0" 0 0

        InputDevice    "Mouse0" "CorePointer"

        InputDevice    "Keyboard0" "CoreKeyboard"

        InputDevice    "DevInputMice" "AlwaysCore"

EndSection

In this example, a single display is used (the numbers designate position of a screen), and two default input devices, Mouse0 and Keyboard0, are used for the session.

The Files Section

The Files section of the xorg.conf file might look like this:

Section "Files"

    RgbPath     "/usr/X11R6/lib/X11/rgb"

    FontPath   "unix/:7100"

EndSection

This section lists available session colors (by name, in the text file rgb.txt) and the port number to the X font server. The font server, xfs, is started at boot time and does not require an active X session. If a font server is not used, the FontPath enTRy could instead list each font directory under the /usr/X11R6/lib/X11/fonts directory, as in this example:

FontPath "/usr/X11R6/lib/X11/fonts/100dpi"

FontPath "/usr/X11R6/lib/X11/fonts/misc"

FontPath "/usr/X11R6/lib/X11/fonts/75dpi"

FontPath "/usr/X11R6/lib/X11/fonts/type1"

FontPath "/usr/X11R6/lib/X11/fonts/Speedo"

...

These directories contain the default compressed fonts that are available for use during the X session. The font server is configured by using the file named config under the /etc/X11/fs directory. This file contains a listing, or catalog, of fonts for use by the font server. By adding an alternate-server entry in this file and restarting the font server, you can specify remote font servers for use during X sessions. This can help centralize font support and reduce local storage requirements (even though only 25MB is required for the almost 5,000 fonts installed with Red Hat Linux and X).

The Module Section

The Module section of the xorg.conf file specifies loadable modules or drivers to load for the X session. This section might look like this:

Section "Module"

        Load  "dbe"

        Load  "extmod"

        Load  "fbdevhw"

        Load "glx"

        Load "record"

        Load  "freetype"

        Load  "type1"

        Load  "dri"

EndSection

These modules can range from special video card support to font rasterizers. The modules are located in subdirectories under the /usr/X11R6/lib/modules directory.

The InputDevice Section

The InputDevice section configures a specific device, such as a keyboard or mouse, as in this example:

Section "InputDevice"

        Identifier  "Keyboard0"

        Driver      "kbd"

        Option  "XkbModel"      "pc105"

        Option  "XkbLayout"     "us"

EndSection

Section "InputDevice"

        Identifier  "Mouse0"

        Driver      "mouse"

        Option      "Protocol" "IMPS/2"

        Option      "Device" "/dev/input/mice"

        Option      "ZAxisMapping" "4 5"

        Option      "Emulate3Buttons" "yes"

EndSection

You can configure multiple devices, and there might be multiple InputDevice sections. The preceding example specifies a basic keyboard and a two button PS/2 mouse (actually, a Dell touchpad pointer). An InputDevice section that specifies use of a USB device could be used at the same time (to enable mousing with PS/2 and USB pointers) and might look like this:

Section "InputDevice"

        Identifier  "Mouse0"

        Driver      "mouse"

        Option      "Device" "/dev/input/mice"

        Option      "Protocol" "IMPS/2"

        Option      "Emulate3Buttons" "off"

        Option      "ZAxisMapping" "4 5"

EndSection

NOTE

If you change your computer's pointing device, you should then run Fedora's system-config-mouse client, which automatically updates your system's xorg.conf file.

CAUTION

From Fedora Core 3 onward, the location for the mouse device changed from /dev/mouse to /dev/input/mice. Unfortunately, when system-config-display writes the xorg.conf file, it sometimes gets a little confused and still maps the mouse to /dev/mouse rather than /dev/input/mice. This is where a little knowledge of vi comes in!

The Monitor Section

The Monitor section configures the designated display device as declared in the ServerLayout section, as shown in this example:

Section "Monitor"

        Identifier   "Monitor0"

        VendorName   "Monitor Vendor"

        ModelName    "Monitor Model"

        DisplaySize  300     220

        HorizSync   31.5-48.5

        VertRefresh 50-70

        Option "dpms"

EndSection

Note that the X server automatically determines the best video timings according to the horizontal and vertical sync and refresh values in this section. If required, old-style mode-line entries (used by distributions and servers prior to XFree86 4.0) might still be used. If the monitor is automatically detected when you configure X (see the section "Configuring X," later in this chapter), its definition and capabilities are inserted in your xorg.conf file from the MonitorsDB database. This database contains more than 600 monitors and is located in the /usr/share/hwdata directory.

The Device Section

The Device section provides details about the video graphics chipset used by the computer, as in this example:

Section "Device"

        Identifier  "Videocard0"

        Driver      "radeon"

        VendorName  "Videocard vendor"

        BoardName   "ATI Radeon Mobility M6"

EndSection

This example identifies an installed video card as using an ATI Mobility M6 graphics chipset. The Driver entry tells the Xorg server to load the radeon_drv.o module from the /usr/X11R6/lib/modules/drivers directory. Different chipsets have different options. For example, here's the entry for a NeoMagic video chipset:

Section "Device"

        Identifier   "NeoMagic (laptop/notebook)"

        Driver       "neomagic"

        VendorName   "NeoMagic (laptop/notebook)"

        BoardName     "NeoMagic (laptop/notebook)"

    Option     "externDisp"

    Option     "internDisp"

EndSection

In this example, the Device section specifies the driver for the graphics card (neomagic_drv.o) and enables two chipset options (externDisp and internDisp) to allow display on the laptop's LCD screen and an attached monitor.

The Xorg server supports hundreds of different video chipsets. If you configure X11 but subsequently change the installed video card, you need to edit the existing Device section or generate a new xorg.conf file, using one of the X configuration tools discussed in this chapter, to reflect the new card's capabilities. You can find details about options for some chipsets in a companion manual page or in a README file under the /usr/X11R6/lib/ _X11/doc directory. You should look at these sources for hints about optimizations and troubleshooting.

The Screen Section

The Screen section ties together the information from the previous sections (using the Screen0, Device, and Monitor Identifier entries). It can also specify one or more color depths and resolutions for the session. Here's an example:

Section "Screen"

        Identifier "Screen0"

        Device     "Videocard0"

        Monitor    "Monitor0"

        DefaultDepth     24

        SubSection "Display"

                Viewport   0 0

                Depth     16

                Modes    "1024x768" "800x600" "640x480"

        EndSubSection

EndSection

In this example a color depth of thousands of colors and a resolution of 1024x768 is the default, with optional resolutions of 800x600 and 640x480. Multiple Display subsection entries with different color depths and resolutions (with settings such as Depth 24 for millions of colors) can be used if supported by the graphics card and monitor combination. You can also use a DefaultDepth enTRy (which is 24, or thousands of colors, in the example), along with a specific color depth to standardize display depths in installations.

You can also specify a desktop resolution larger than that supported by the hardware in your monitor or notebook display. This setting is known as a virtual resolution in the Display subsection. This allows, for example, an 800x600 display to pan (that is, slide around inside) a virtual window of 1024x768.

NOTE

If your monitor and graphics card support multiple resolutions and the settings are properly configured, you can use the key combination of Ctrl+Alt+Keypad+ or Ctrl+Alt+Keypad- to change resolutions on-the-fly during your X session.

Configuring X

Although the Fedora installer can be used to configure X during installation, problems can arise if the PC's video card is not recognized. If you are unable to configure X during installation (see Chapter 3, "Installing Fedora"), do not specify booting to a graphical configuration and skip the X configuration portion of the installation. Note that some installs, such as for servers, don't require that X be configured for use in order to support active X sessions but might require installation of X and related software to support remote users and clients.

You can use the following configuration tools, among others, to create a working xorg.conf file:

  • system-config-display— This is Fedora's graphical configuration tool, which launches an X session to create an xorg.conf file.

  • Xorg— The X server itself can create a skeletal working configuration.

The following sections discuss how to use each of these software tools to create a working xorg.conf file.

Configuring X with the system-config-display Client

You can use the system-config-display client to create or update an xorg.conf file. You can start by clicking the Display menu item from the desktop panel's System Settings menu if you are already running X, but you can also begin, as root, by starting the client from the command line during a console session, like this:

# system-config-display

The screen clears, and system-config-display attempts to start an X session. If you start this client during an X session, its main window appears, as shown in Figure 6.1.

Figure 6.1. The system-config-display client provides a graphical configuration interface for creating or updating a system's xorg.conf file. Here you see the Display Settings main screen, offering resolution and color-depth settings.

The Display Settings main screen is a dialog showing the current monitor and video card settings (if configured). You can change the resolution (horizontal and vertical pixels) and color depth (number of supported colors) by clicking one or the other of the drop-down menus. Click the OK or Cancel button to save or cancel any change.

If you click the Hardware tab, other configuration options become available as shown in Figure 6.2.

Figure 6.2. system-config-display's Hardware settings are used to configure a monitor and video card (and multihead video card) for X11R6.

Click the Configure button in the Monitor Type area of the Hardware tab dialog to change your Monitor settings, as shown in Figure 6.3. You can use this dialog to configure a different monitor or to change current monitor settings.

Figure 6.3. You can scroll to select a new monitor to use for your X sessions.

First, scroll through the list of monitor brands (from the MonitorDB database), and then click the small triangle to the left of the name of the manufacturer or type. You will then see a list of model names. Click to select one, and when you are finished, click the OK button to use the new settings or click the Cancel button to abort changes.

To configure a video card, you can click the Video Card area's Configure button in the Hardware tab dialog. The Video Card dialog appears, as shown in Figure 6.4.

Figure 6.4. Use the Hardware tab's Video Card Configure button to choose a new video card for your X sessions.

You can scroll through the list of video cards. You can click one to select it and when you are finished, click the OK button to finalize your selection.

If your video card supports the use of two or more monitors, you can use the Dual head tab toconfigure multiple monitor support. Xorg supports multiple displays using a feature named Xinerama. This feature enables multiple monitors to appear as a single display, and each display can be located in any quadrant of a screen's layout.

In order to use Xinerama for your desktop sessions, you must start the Xorg server with its +xinerama option. Your xorg.conf file must also have proper settings, and each display must be capable of supporting identical color depth (usually 16bpp or thousands of colors). Details about using Xinerama with Xorg can be found in the Xorg man page and in the Xinerama HOWTO at http://www.tldp.org/HOWTO/Xinerama-HOWTO/.

When you have finished your changes to your X server settings, click the OK button. You will then see a dialog advising that you will need to log out and then log back (or exit your X session and restart X) in order to use the new settings.

The new settings will be stored in a new xorg.conf file under the /etc/X11 directory. If you find that the new settings do not work, you can simply copy the backup xorg.conf file named xorg.conf.backup to xorg-conf in the same directory to revert to your original settings.

Using Xorg to Configure X

You can create the xorg.conf file manually by typing one from scratch using a text editor, but you can also create one automatically by using the Xorg server or configuration utilities (as discussed in the previous sections). As the root operator, you can use the following on the server to create a test configuration file:

# X -configure

After you press Enter, a file named xorg.conf .new is created in root's home directory, the /root directory. You can then use this file for a test session, like this:

# X –config /root/xorg.conf.new


Starting X

You can start X sessions in a variety of ways. The Fedora installer will set up the system initialization table /etc/inittab to have Linux boot directly to an X session using a display manager (that is, an X client that provides a graphical login). After you log in, you will use a local session (running on your computer) or, if the system is properly configured, an X session running on a remote computer on the network. Logging in via a display manager requires you to enter a username and password. You can also start X sessions from the command line. The following sections describe these two methods.

Using a Display Manager

An X display manager presents a graphical login that requires a username and password to be entered before access is granted to the X desktop. It also allows you to choose a different desktop for your X session. Whether or not an X display manager is presented after you boot Linux is controlled by a runlevel—a system state entry in /etc/inittab. The following runlevels are defined in the file:

# 0 - halt (Do NOT set initdefault to this)

# 1 - Single user mode

# 2 - Multiuser, without NFS (The same as 3, if you do not have networking)

# 3 - Full multiuser mode

# 4 - unused

# 5 - X11

# 6 - reboot (Do NOT set initdefault to this)

Runlevel 5 isused for multiuser mode with a graphical X login via a display manager; booting to runlevel 3 provides a console, or text-based, login. The initdefault setting in the /etc/inittab file determines the default runlevel:

id:5:initdefault:

In this example, Linux boots and then ends up running X.

The default display manager might also be specified in /etc/inittab, like this:

x:5:respawn:/usr/bin/xdm –nodaemon

However, Fedora uses a shell script named prefdm, found under the /etc/X11 directory, to set the display manager:

x:5:respawn:/etc/X11/prefdm –nodaemon

According to this script, the display manager is based on the file named desktop under the /etc/sysconfig directory. The words GNOME, KDE, and XDM following a DESKTOP= entry determine what display manager is used for login. The following sections describe how to configure the three most commonly used display managers: gdm, kdm, and xdm).

Configuring gdm

The gdm display manager is part of the GNOME library and client distribution included with Fedora and provides a graphical login when a system boots directly to X. Its login (which is actually displayed by the gdmlogin client) hosts pop-up menus of window managers, languages, and system options for shutting down (halting) or rebooting the workstation. Although you can edit (as root) gdm.conf under the /etc/X11/gdm directory to configure gdm, a much better way to configure GNOME's display manager is to use the gdmsetup client.

You can use the gdmsetup client, shown in Figure 6.5, to configure many aspects and features of the login display. You launch this client from the GNOME desktop panel's System Settings Login Screen menu item, or from the command line, like this:

# gdmsetup &

Figure 6.5. You use gdmsetup to configure the gdmlogin screen when using gdm as a display manager.

[View full size image]

After you press Enter, you see the GDM Setup window, as shown in Figure 6.5.

You can specify settings for security, remote network logins, the X server, and session and session chooser setup by clicking on the tabs in the GDM Setup dialog.

Configuring kdm

The kdm client, which is part of the KDE X desktop suite, offers a graphical login similar to gdm. You configure kdm by running the KDE Control Center client kcontrol, as the root operator, by clicking the Control Center menu item from the KDE kicker or desktop panel menu. You can also start KDE Control Center by using the kcontrol client at the command line like so:

$ kcontrol &

In the Index tab of the left pane of the KDE Control Center window, you click the System Administration menu item to open its contents, and then you click the Login Manager menu item. The right pane of the Control Center window displays the tabs and configuration options for the kdm Login Manager, as shown in Figure 6.6.

Figure 6.6. You configure kdm by choosing tabs and settings in the Control Center dialog box.

[View full size image]

In order to make any changes to the KDE display manager while logged in as a regular user, you must first click the Administrator Mode button, and then enter the root operator password. You can click on a tab in the Control Center dialog to set configuration options. Options in these tabs allow you to control the login display, prompts, user icons, session management, and configuration of system options (for shutting down or rebooting). After you have made your configuration choices in each tab, click the Apply button to apply the changes immediately; otherwise, the changes are applied when the X server restarts.

Using the xdm Display Manager

The xdm display manager is part of the Xorg distribution and offers a bare-bones login for using X. Although it is possible to configure xdm by editing various files under the /etc/X11/xdm directory, GNOME and KDE offer a greater variety of options in display manager settings. The default xdm login screen's display is handled by the xsetroot client, which is included with Xorg, and Owen Taylor's xsri client, as specified in the file Xsetup_0 in the xdm directory under /etc/X11. The xsri client may be used to set the background color of the login display's desktop and to place an image in the initial display.

Starting X from the Console by Using startx

If you have Fedora set to boot to runlevel 3, a text-based console login, you can start an X session from the command line. You use the startx command (which is actually a shell script) to do so. You launch the X server and an X session by using startx, like this:

$ startx

startx first looks in your home directory for a file named .xinitrc. This file can contain settings that will launch an alternative desktop and X clients for your X session. The default system .xinitrc is found in the /etc/X11/xinit directory, but a local file can be used instead to customize an X session and launch default clients. For example, you can download and install the mlvwm window manager, which is available from http://www2u.biglobe.ne.jp/~y-miyata/mlvwm.html in the /usr/local/bin directory. You can then use the mlvwm desktop for your X session along the xterm terminal client by creating an .xinitrc file that contains the following:

xterm &

exec /usr/X11R6/bin/mlvwm

Using a custom .xinitrc is not necessary if you're using Fedora's desktop, which runs X and either a GNOME-aware window manager or KDE as a desktop environment.

You can also use the startx command with one or more command-line options. These options are passed to the X server before it launches an X session. For example, you can use startx to specify a color depth for an X session by using the -depth option, followed by a number such as 8, 16, 24, or 32 for 256, thousands, or millions of colors (as defined in the X configuration file and if supported). Using different color depths can be useful during development, for testing how X clients look on different displays, or to conserve use of video memory, such as when trying to get the highest resolution (increased color depth can sometimes affect the maximum resolution of older video cards).

For example, to start a session with thousands of colors, you use the startx command like this:

$ startx -- -depth 16

Another option that can be passed is a specific dots-per-inch (dpi) resolution that is to be used for the X session. For example, to use 100 dpi, you use the -dpi option followed by 100, like this:

$ startx -- -dpi 100

You can also use startx to launch multiple X sessions. This feature is due to Linux support for virtual consoles, or multiple text-based displays. To start the first X session, you use the startx command followed by a display number, or an X server instance (the first is 0, using screen 0) and a number that represents a virtual console. The default console used for X is number 7, so you can start the session like this:

$ startx -- :0 vt7

After X starts and the window manager appears, you press Ctrl+Alt+F2 and then log in again at the prompt. Next, you start another X session like this, specifying a different display number and virtual console:

$ startx -- :1 vt8

Another X session starts. To jump to the first X session, you press Ctrl+Alt+F7. You use Ctrl+Alt+F8 to return to the second session. If you exit the current session and go to another text-based login or shell, you use Alt+F7 or Alt+F8 to jump to the desired session.

Using startx is a flexible way to launch X sessions, but multiple sessions can be confusing, especially to new users, and are a horrific resource drain on a system that does not have enough CPU horsepower and memory. A better approach is to use multiple workspaces, also known as virtual desktops, as discussed in the following section.


Selecting and Using Window Managers

A window manager is launched immediately after the X server starts. The window manager handles the drawing and display of graphical session windows and their onscreen controls and features. Without a window manager, X client windows cannot be moved about the screen, resized, minimized or maximized, and so on.

Many different window managers are available for Linux, providing a number of choices for how the desktop appears and functions. This wealth of desktop choices appeals to many people who use Linux and X.

A window manager provides an X display and customized desktop by handling window decoration, movement, placement, and resizing operations. A window manager can also handle icons, and it can support icon-docking and other window operations such as tiling and overlays. Another important window manager task is focus policy—how and when a window becomes active. A window can become active when the pointer is over it, for example, or it might require a mouse click for activation.

A window manger might also provide menuing on the root desktop or after a button is clicked in a client's window title bar. Some window managers support the use of special keyboard keys to move the pointer and emulate mouse button clicks. Another feature is the capability to provide multiple workspaces, or a virtual desktop, which is not the same as the virtual screen; whereas a virtual screen is a desktop that is larger than the display, a virtual desktop offers two, four, or eight additional complete workspaces.

Some window managers support advanced features, such as drag and drop of icons that represent files or system devices. This allows the user to easily copy, print, delete, link, or move files—even over a network or the Internet.

NOTE

Many different window managers are available for Linux. You do not have to use Fedora's default selection of window managers. This is part of the freedom of using Linux and a testament to the flexibility of the X architecture. You can download, install, and run nearly any other window manager for X without problems. One of the best places to find links and information to other window managers is Matt Chapman's Window Managers for X page, at http://xwinman.org/. Many of these window managers can be downloaded and installed by using RPM, apt, or yum, or built and installed from source. For those of you who do not realize, Fedora Core 4 ships with the Gnome 2.10 window manager as standard.

The following sections describe how to select a default desktop, switch to a different desktop, and configure different window managers for X.

Using Fedora's switchdesk

You can use Fedora's switchdesk client to change the default window manager or desktop environment such as GNOME or KDE. A desktop environment includes a window manager and a suite of related clients, such as productivity or utility applications. Most desktop environments also include the ability to save a session state (such as running applications, the applications' window size and positions, and so on), using a feature known as session management.

You can also use the switchdesk utility when running X or at a text-based console, along with a keyword (such as GNOME or KDE), to set the default X desktop before launching X. For example, to specify that you want to use the KDE desktop environment as the default, you use switchdesk like this:

$ switchdesk KDE

Red Hat Linux switchdesk 4.0

Copyright (C) 1999-2004 Red Hat, Inc

Redistributable under the terms of the GNU General Public License

Desktop now set up to run KDE.

For system defaults, remove /home/andrew/.Xclients

This example shows that the default X session will now use KDE. Settings are saving in the file named .Xclients in the home directory. You can launch switchdesk during an X session by clicking the Desktop Switching Tool menu item from the System Settings More System Setting menu or from the command line of an X11 terminal like this:

$ switchdesk &

After you press Enter, you get a graphical dialog offering a choice of window managers for X sessions (depending on the window managers that are installed on the system), as shown in Figure 6.7.

Figure 6.7. You use switchdesk to set the default window manager for X sessions.

Choosing a window manager is a matter of preference, necessity, or policy. You might prefer to use one of the older window managers—such as the Tab Window Manager (twm) or the Motif Window Manager (mwm)—on legacy PCs because they have fewer system resource requirements (that is, they require less hard drive space, CPU horsepower, and system memory). Newer desktop environments require 64MB or even more memory for good performance. The following sections describe some of the most popular window managers and their uses.

The Tab Window Manager (twm)

The Tab Window Manager (twm), which is included with Xorg and also sometimes known as Tom's Window Manager, is a legacy client that provides modest but essential features in a small (less than 1MB) memory footprint. It supports window decorations, menus, icons, and other features, but it does not support virtual desktops, session management, and other features, such as drag and drop.

The twm window manager is used as a fallback, or failsafe, window manager for Fedora as it requires much less video and system memory. It is included with the Xorg software distribution and will be used as your window manager after you log in or start X in the event the system or your default window manager settings are lost or unusable. The twm resource file, system.twmrc, is located under the /etc/X11/twm directory. You can configure this file to provide a default desktop with a custom application menu if you save your settings to a file named .twmrc in your home directory. The format of this configuration file is documented in the twm man page.

A sample twm desktop is shown in Figure 6.8, displaying the xosview, xclock, xcalc, and xterm clients. The default desktop color can be changed using the xsetroot client. You access the desktop menu in twm by left-clicking in a blank area of the main window, known as the root display.

Figure 6.8. twm is included with Xorg and offers basic window and icon management.

[View full size image]

The Motif Window Manager (mwm)

mwm, the Motif Window Manager, is included with Fedora to provide a legacy X desktop. It is a clone window manager that closely mimics the original mwm window manager that was part of the OSF/Motif distribution from The Open Software Foundation. The mwm window manager is part of a Motif 1.2–compatible set of programming libraries and development files named LessTif.

mwm can even use the same configuration files as the OSF/Motif version. mwm's default resource file is located in /etc/X11/ system.mwmrc. You can edit this file to provide custom settings when it is located in your home directory and is named .mwmrc.

A sample mwm desktop is shown in Figure 6.9. Note that the Motif Window Manager offers more sophisticated window decorations (controls such as borders and title bar items) than the twm window manager.

Figure 6.9. The Motif Window Manager provides a simple desktop for Fedora.

[View full size image]


The GNOME and KDE Desktop Environments

A desktop environment for X provides one or more window managers and a suite of clients that conform to a standard graphical interface based on a common set of software libraries. When they are used to develop associated clients, these libraries provide graphical consistency for the client windows, menus, buttons, and other onscreen components, along with some common keyboard controls and client dialogs. The following sections briefly discuss the two desktop environments that are included with Fedora Core: GNOME and KDE.

GNOME: The GNU Network Object Model Environment

The GNOME project, which was started in 1997, is the brainchild of programmer whiz Miguel de Icaza. GNOME provides a complete set of software libraries and clients. GNOME depends on a window manager that is GNOME aware. This means that in order to provide a graphical desktop with GNOME elements, the window manager needs to be written to recognize and use GNOME. Some compliant window managers that are GNOME-aware include Havoc Pennington's metacity (the default GNOME window manager), Enlightenment, Window Maker, IceWM, and sawfish.

Fedora uses GNOME's user-friendly suite of clients to provide a consistent and user-friendly desktop. GNOME is a staple feature of Red Hat's commercial Linux distributions and Fedora because Red Hat actively supports its development. GNOME clients are found under the /usr/bin directory, and GNOME configuration files are stored under the /etc/gnome and /usr/share/gnome directories, with user settings stored in the home directory under .gnome.

Ximian GNOME for Red Hat

In 1999, Miguel de Icaza and Nat Friedman, the original GNOME developers, created a company and a product now known as Ximian. Ximian is a polished GNOME environment that offers not only an updated suite of GNOME clients, but also groupware software that provides integrated mail, calendar, addressing, and instant messaging services.

In August 2003, Ximian was acquired by Novell, Inc. The Ximian GNOME distribution, now named Ximian Desktop 2, is not included with Red Hat's Linux distros or Fedora, but you may be able to install it via CD-ROM or, if you have broadband access, in about an hour or less over the Internet. Versions are available for many different Linux distributions (even those on non-Intel platforms).

To get started, you can go to Novell's Ximian Desktop website at http://www.novell.com/products/desktop/download.html. You first use wget to quickly download a graphical installer, which is then used to select a download site, selected files, and the base Ximian distribution. The download and installation are done as an automatic process, and Ximian replaces your default GNOME software with its own GNOME distribution. After installation, you can quickly install updates and bug fixes by using an update icon on the Ximian desktop.

A representative GNOME desktop, running the gconftool-2 client used for setting themes, is shown in Figure 6.10.

Figure 6.10. Fedora's GNOME desktop uses the metacity window manager and offers a selection of GNOME (and KDE) themes.

You can configure your desktop in various ways and by using different menu items under the Preferences menu. For a comprehensive icon view of preference items, click the Control Center menu item from the desktop panel's Preferences menu. A graphical shell named Nautilus then launches. Nautilus was originally developed by Eazel (which ceased operations shortly before summer 2001). The Nautilus shell is used for the Fedora desktop as a file browser and desktop utility.

The Nautilus main window, shown in Figure 6.11, shows Preference icons. You can then click any icon (such as Background or Screensaver) and its dialog to change your desktop's appearance, focus behavior, window behavior, placement, sound, and workspace settings.

Figure 6.11. You can customize your Fedora desktop by using Preference settings that are available in the Nautilus graphical shell.

[View full size image]

KDE: The K Desktop Environment

KDE, which is included with Fedora, has been available for Linux, Xorg, and XFree86 since 1996. KDE is a graphical desktop environment that offers a huge suite of clients, including a free office suite named KOffice. KDE clients are located under the /usr/bin directory, and nearly all clients have a name that begins with k.

The directory .kde in your home directory contains custom settings and session information. You can use KDE's Control Center, as shown in Figure 6.12, to customize desktop settings. You can launch this client by clicking the Control Center menu item from KDE's desktop menu (hosted by the panel along the bottom of your desktop, known as the kicker) or from the command line, like so:

$ kcontrol &

Figure 6.12. You can use the KDE Control Center to manage nearly every aspect of KDE desktop sessions.

[View full size image]

Related Fedora and Linux Commands

You can use these commands to create and configure the X Window System in Fedora:

Xorg— The X server that is provided with the X Window System distribution from The X.Org Foundation

mouseconfig— RFedora's text-based GUI pointing-device–configuration program

kcontrol— The KDE Control Center client

system-config-display— Fedora's graphical X11R6 configuration tool

system-config-mouse— Fedora's graphical mouse configuration tool

gdmsetup— The GNOME display manager configuration client

startx— A shell script that is used to start one or more X sessions from the shell command line

xsri— A display manager root desktop decoration client


Reference

http://www.x.org—Curators of the X Window System.

http://www.x.org/Downloads_mirror.html—Want to download the source to the latest revision of X? Start at this list of mirror sites.

http://www.xfree86.org—Home of The XFree86 Project, Inc., which has provided a graphical interface for Linux for nearly 10 years.

http://www.kde.org—The place to get started when learning about KDE and the latest developments.

http://www.gnome.org—The launch point for more information about GNOME, links to new clients, and GNOME development projects.

http://people.redhat.com/~hp/metacity/—Havoc Pennington's metacity download page, where you can get the latest full-source version of this window manager.

http://sawmill.sourceforge.net—The home page for the sawmill window manager.

http://www.windowmaker.org—The source for the latest version of Window Maker.

http://www.icewm.org—IceWM's home page.

http://www.lesstif.org—The home page of the LessTif project, which aims to provide GNU GPL versions of OSF/Motif-compatible software libraries.

http://scwm.sourceforge.net—The home page of a lightweight, yet virtual desktop-enabled, window manager.

http://www.fvwm.org—The home page for FVWM2, where you can download the latest version.

http://www.novell.com/products/desktop/—The place to get started with Ximian GNOME.


Chapter 7. Managing Software and System Resources

IN THIS CHAPTER

  • Using RPM for Software Management

  • Using Red Hat Network and Alternatives for Software Management

  • Compiling Software from Source

  • Reference

This chapter introduces concepts, procedures, and software you can use to manage installed system resources on a Fedora Core system. Managing the system resources—including software, storage, and memory—of your computer is important for a number of reasons. Good resource management promotes and supports efficient, productive sessions, a stable system, and satisfied users. Managing these resources involves installing, removing, upgrading, or rebuilding software packages—each a vital task that can contribute to your system's security.

As a Fedora Core system administrator, you should also know how to maximize your system's resources by managing memory and storage for the most efficient system use. Properly managing your system resources ensures that you will not run out of room for new software, and you can expand the system to fit changing needs and new projects. In other words, system resource management is essential to providing the best possible computing experience for your users.

Fedora Core provides a variety of tools for system resource management. The following sections introduce the RPM Package Manager (RPM), along with command-line and graphical software-management tools. You will also learn about monitoring and managing memory and disk storage on your system.


Using RPM for Software Management

RPM was derived (in part) from early Linux package management software—named RPP, PMS, and PM—that were written in Perl. RPM was first used with Red Hat Linux 2.0 in late 1995, and then rewritten in C for the Red Hat Linux 3.0.3 (Picasso) release in 1996. Since then, the rpm command has been the prime feature of Red Hat's unique software management system, which is based on the concept of pristine sources, or the capability to use a single, initial archive of a program's source code to build packages for different systems and to track versions. With the release of Red Hat 8.0 (Psyche) in 2002, Red Hat offered a slightly updated graphical management interface for its venerable RPM application.

In addition to improving the package management of early software management scripts, RPM version 4.1 introduced software features designed to ease the task of building software for different platforms from a single set of source-code files. Changes can be tracked and kept outside a developer's initial source code and multiple packages can be built from scratch and installed at the same time—simultaneously, RPM also verifies installation dependencies. Additional features, such as a checksum and GNU Privacy Guard (GPG) signatures, enable binary software packages to be safely distributed without the fear of virus infection or the inclusion of Trojan code.

The rpm command uses the RPM system to install, remove (erase), upgrade, verify, and build software archives known as .rpm files. These archives, or packages, contain package identification (a signature), checksums (mathematically derived validation values), and an archive of the software, either in source or binary form. A .rpm package also contains quite a bit of additional information, such as a name, version, and basic description, and can include pre-and post-installation scripts used for software installation, erasure, or upgrading.

The RPM database installed on your computer keeps track of which versions of which packages are installed. RPM uses your system's /var/lib/rpm directory to store files (actually databases) containing information about the software installed on your system. You can use the ls command to view these files (you might see file sizes different from those shown here, depending on the amount of software you have installed):

$ ls -l /var/lib/rpm

total 53820

-rw-r--r--    1 rpm      rpm       5423104 Oct 14 19:53 Basenames

-rw-r--r--    1 rpm      rpm         12288 Oct 14 12:32 Conflictname

-rw-r--r--    1 root     root        16384 Oct 14 17:31 __db.001

-rw-r--r--    1 root     root      1318912 Oct 14 17:31 __db.002

-rw-r--r--    1 root     root       458752 Oct 14 17:31 __db.003

-rw-r--r--    1 rpm      rpm       1179648 Oct 14 19:53 Dirnames

-rw-r--r--    1 rpm      rpm       5521408 Oct 14 19:53 Filemd5s

-rw-r--r--    1 rpm      rpm         24576 Oct 14 19:53 Group

-rw-r--r--    1 rpm      rpm         20480 Oct 14 19:53 Installtid

-rw-r--r--    1 rpm      rpm         45056 Oct 14 19:53 Name

-rw-r--r--    1 rpm      rpm      41070592 Oct 14 19:53 Packages

-rw-r--r--    1 rpm      rpm        348160 Oct 14 19:53 Providename

-rw-r--r--    1 rpm      rpm         98304 Oct 14 19:53 Provideversion

-rw-r--r--    1 rpm      rpm         12288 Oct 14 19:53 Pubkeys

-rw-r--r--    1 rpm      rpm        237568 Oct 14 19:53 Requirename

-rw-r--r--    1 rpm      rpm        176128 Oct 14 19:53 Requireversion

-rw-r--r--    1 rpm      rpm         94208 Oct 14 19:53 Sha1header

-rw-r--r--    1 rpm      rpm         49152 Oct 14 19:53 Sigmd57

-rw-r--r--    1 rpm      rpm         12288 Oct 14 19:53 Triggername

The primary database of installed software is contained in the file named Packages. As you can see from the preceding example, this database can grow to 33MB (and perhaps larger) if you perform a full installation of Fedora Core (more than 4GB of software). After you install Fedora Core Linux, rpm and related commands will use this directory during software management operations.

Command-Line and Graphical RPM Clients

As a Fedora Core Linux system administrator, you will use the rpm command or the Fedora Core graphical clients to perform one of five basic tasks. These operations, which must be conducted by the root operator, include the following:

  • Installing new software

  • Erasing or removing outdated or unneeded packages

  • Upgrading an installed software package

  • Querying to get information about a software package

  • Verifying the installation or integrity of a package installation

The rpm command has more than 60 command-line options, but its administrative functions can be grouped according to the previous five types of action. Graphical RPM clients provide easy-to-use interfaces to these operations. As a system administrator, you will have a choice between using a graphical interface and using rpm's various command-line options. The general format of an rpm command is

# rpm option packagename

The basic options look like this:

  • -i— Installs the selected package or packages.

  • -e— Erases (removes) the selected package or packages.

  • -U— Removes the currently installed package, and then installs software with the contents of the selected package or packages, leaving the existing configuration files.

  • -q— Queries the system or selected package or packages.

  • -V— Verifies installed or selected package or packages.

Two Handy Options

By appending vh to any option, you get

v | Some status feedback.
h | Hash marks as the work proceeds.

Many additional options can also be added to or used in conjunction with these options. These are summarized in the following table:

Option | Used To
rpm-i | Install a package
 | Useful options to -i:
 | --excludedocs: Does not install documentation to save space.
 | --replacepkgs: Replaces the package with a new copy of itself.
 | --force: The "big hammer"—Ignores all warnings and installs anyway.
 | --noscripts: Does not execute any pre-or post-install scripts.
 | --nodeps: Ignores any dependencies.
 | --root path: Sets an alternative root to path.
rpm -e | Erases (deletes) a package.
 | Useful option to -e:
 | --nodeps: Ignores any dependencies.
rpm -U | Upgrades a package, removing the older one but keeping modified files, such as configurations.
 | Useful options to -U:
 | --oldpackage: Permits downgrading to an older version.
 | Other options are the same as with rpm -i.
rpm -q | Queries about package information
 | Useful options to -q:
 | -p file: Displays all information about the package file.
 | -f file: What package owns the file file?
 | --whatprovides x: Determines what packages provide x.
 | --whatrequires x: Determines what packages require x.
 | -i: Summarizes the package information.
 | -l: Lists the files in package.
 | --scripts: Displays the contents of any install, uninstall, or verifies scripts.
 | --provides: Displays the capabilities package provides.
 | --requires: Displays the capabilities package requires.
rpm -V | Verifies packages against the RPM database
 | Useful options to -V:
 | -a: Verifies all installed packages.

rpm K | Uses GPG to verify a downloaded package.
 | Useful options to K:
 | --nosignature: If you lack public GPG encryption keys, do not have GPG installed, or are legally prohibited from using GPG, this still verifies the package using size and MD5 checksums

Details on obtaining the Fedora Core public GPG encryption key and using it are at http://www.rpm.org/max-rpm/s1-rpm-checksig-using-rpm-k.html.

RPM Is for Programmers, Too!

Remember that RPM was created not only to provide an easy to use administrative tool, but also as a developer's tool for use in multi-platform source-code package management. Programmers using rpm for development and distribution will use its rpmbuild command, along with a myriad of additional command-line flags. RPM can be used to build binaries, execute programs, test installations, verify and sign packages, build source packages, track versions, and target builds for specific architectures. Details can be found at the RPM home page (listed in the "Reference" section at the end of this chapter).

Using rpm on the Command Line

Because the new graphical RPM client can only install and uninstall RPM packages (for now—more functionality is promised), you will still end up administering RPM packages from the command line. You can perform all the five basic rpm operations using the rpm command from the command line. This section gives you an introduction to performing those operations. It also provides examples of how to install, verify, query, remove, and upgrade a software package.

The most common rpm operation is software installation. Using rpm is an easy way to keep track of installed software, and it can be used to quickly remove undesired packages. Use the -i option, along with the full or partial name (using regular expressions) of a software package, to install software with rpm. For example, to install the unace archiving package, use the rpm command like this:

# rpm -ivh http://mirrors.zoreil.com/plf.zarb.org/mandrake/10.0/

i586/unace-2.2-2plf.i586.rpm

Retrieving http://mirrors.zoreil.com/plf.zarb.org/mandrake/10.0/

i586/unace-2.2-2plf.i586.rpm

warning: /var/tmp/rpm-xfer.48amVs: V3 DSA signature: NOKEY, key ID 8df56d05

Preparing...                ########################################### [100%]

   1:unace

########################################### [100%]

This example uses the v and h options, which provide a more verbose output and display of hash marks to show the progress of the installation. The example also demonstrates the capability of rpm to use HTTP or FTP servers to fetch files for installation. It also shows that rpm can use GPG keys to validate a file. (The key was not installed in our example.)

You can also use rpm to query its database after installing packages to verify an installation. Use the -V option, along with the name of a software package, to verify installation of your system. For example, to verify the unace archiving package, use the rpm command like this:

# rpm -V unace

NOTE

If everything is correct with your software installation, your system will display no response to rpm -V after you run the command; only problems are displayed.

As you can see from the following program output, you can get additional information about a package by adding additional verification options (such as two more v's) to the -V option. To get more information about an installed package, use one or more forms of the rpm query options. For example, to display concise information about an installed package, use the -q option, along with the i option and the installed package name, like this (note that your version will be different from that shown here):

# rpm -qi unace

Name        : unace                        Relocations: (not relocateable)

Version     : 2.2                               Vendor: Penguin Liberation Front

Release     : 2plf                          Build Date: Sat 01  Mar 2003 12:13:48 PM EST

Install date: Tue 02 Sep 2003 03:46:28 PM EDT      Build Host: baader.subversion.alt

Group       : Archiving/Compression         Source RPM: unace-2.2-2plf.src.rpm

Size        : 401368                           License: freeware

Packager    : Guillaume Rousse <guillomovitch@zarb.org>

URL         : http://www.winace.com

Summary     : Decompressor for .ace format archives

Description :

Unace is a utility to extract, view, and test the contents of an ACE archive.

This form of the rpm query provides quite a bit of information about the software package. (You can also query packages before installation by providing a pathname for them.)

If this package is not up-to-date, you can easily and quickly upgrade the package by downloading a newer version and then using rpm's -U or upgrade option like this:

# rpm -Uvh unace-2.2-2plf.i586.rpm

Preparing...                ########################################### [100%]

   1:unace                   ########################################### [100%]

Note that it wasn't necessary to remove the currently installed software package—the U option removes the old version of the software (saving the old configuration files), and then automatically installs the new software.

You can also upgrade your system software by using the rpm command's -F or "freshen" option, which will fetch a designated package from a remote FTP or HTTP server. For example, to upgrade the fetchmail-conf package, use rpm like this:

# rpm -Fv ftp://ftp.tux.org/linux/redhat/updates/9/en/os/i386/\

initscripts-7.14-1.i386.rpm

Retrieving ftp://ftp.tux.org/linux/redhat/updates/9/en/os/i386/\

initscripts-7.14-1.i386.rpm

Preparing packages for installation...

initscripts-7.14-1

Use the -e option, along with the name of a software package, to remove or erase software from your system with rpm. For example, to remove the unace archiving package, use the rpm command like this:

# rpm -e unace

Note that if the operation succeeds, no messages will be displayed on your system. You can quickly search for the names of installed packages by piping the output of rpm -qa through the grep and sort commands (see Chapter 5, "First Steps with Fedora," for additional information on grep and sort); here's how to do that search:

# rpm -qa | grep mail | sort

fetchmail-6.2.0-7

mailcap-2.1.14-1.1

mailx-8.1.1-31.1

mozilla-mail-1.4.1-8

procmail-3.22-11

sendmail-8.12.10-1.1

sendmail-cf-8.12.10-1.1

This example returns a sorted list of all packages with names containing the word mail.

NOTE

Another essential feature of the rpm command is its --rebuilddb option. If your system's RPM database becomes corrupted, this is your first (and perhaps only) option for restoring software management services. We hope that you never have to use this option; help ensure that by always backing up your data!

Package Organization with RPM

Software packages on your Fedora Core Linux system are organized into various groups, as you see later in this chapter. Using a group organization helps Fedora Core keep software organized by category and provides for hierarchical listings of software when using graphical RPM clients. You never have to manipulate these groups, but understanding the concept of package organization can help you gain familiarity with the way Fedora Core Linux works.

Extracting a Single File from an RPM File

Occasionally, it is useful to extract a single file from an RPM package. You can do so using the command-line version of mc, the Midnight Commander. In Figure 7.1, the Midnight Commander is displaying the contents of the Yum .rpm file. The Midnight Commander is a UNIX clone of the famous DOS Norton Commander, a file management utility. Using mc, just highlight the RPM file and press Enter; the contents of the RPM file will be displayed. In the listing, you can browse the file structure of the RPM file and use mc to copy files from it.

Figure 7.1. A classic two-panel directory view and drop-down menus betray Midnight Commander's DOS inspiration, but it's a full-featured Linux file manager.

[View full size image]

You might want to know what a .rpm script will do before you install the application. You can use the F3 key in mc to view the script files. If you want to look at the scripts without using mc, use this command:

# rpm -q --scripts filename > scripts.txt

This command pipes the scripts into a file, where you can examine it with a text editor. You could also pipe it to the less pagination command to view the scripts on your display:

# rpm -q --scripts filename | less

Graphical Package Management

The Fedora graphical package management tool identified in the menu as Add/Remove Software is actually an application named system-config-packages. This application replaces kpackage, gnorpm, and xrpm—all of which are no longer provided. Add/Remove Software allows you to select packages arranged in categories and install or remove them. With the addition of Yum to Fedora Core, you may now add your own packages to the Fedora Core graphical tools' database, improving its usefulness over earlier versions.

Launch the Fedora GUI package manager by clicking the Start button on your desktop, and then choose System Settings, Add/Remove Applications. The package management tool launches with the Add and Remove Software screen, shown in Figure 7.2.

Figure 7.2. The initial screen of the package management tool will look familiar if you installed Fedora Core; it's the package selection screen used by the installation program.

[View full size image]

The packages listed in the screen are organized into the Desktops, Applications, Servers, Development, and Systems groups. To choose individual package groups for installation or removal click details next to the subgroup. The numbers to the right of the package group name indicate the number of packages installed on your system and the total number of packages available in the group. In Figure 7.2, you can see that 37 of 44 possible GNOME packages have been installed.

Under the details for each subgroup, simply select the packages you want to remove. Note that you can only access the Extra Packages; to remove the base packages, you need to uncheck the box next to the name of the subgroup.

Figure 7.3. The Standard Packages listing (collapsed in this view) details the base packages installed when the main category is selected. Extra Packages are those that you have the option of installing.

    Previous Section < Day Day Up > Next Section


Using Red Hat Network and Alternatives for Software Management

For the Red Hat 8 and 9 releases, the only command-line application for the management of system software provided by Red Hat was RPM; the only GUI tool for management was the Red Hat Packages graphical client (system-config-packages) now identified as Add/Remove Software. For the average person, RPM is hopelessly complicated; it includes extra complexity to allow it to be used as a general .rpm file-building and development tool, features not normally used by many people. The graphical software management client has been improved for Fedora Core to enable the use of local and remote Yum (that stands for YellowDog Updater modified, first used in the YellowDog [PPC] Linux distribution) repositories.

Not previously covered in this book is the Red Hat Network (https://rhn.redhat.com—see Figure 7.4). RHN has not been covered because it is not free to the users of this book (or to users of the freely-available FTP download version) and it is limited to managing only the software that is provided by Red Hat. Other alternatives are now available.

Figure 7.4. The Red Hat Network provides automated update subscription services. It only works with software provided by Red Hat and is designed for commercial users.

[View full size image]

The RHN service is a client-server mechanism through which a user subscribes to a channel on the server (a repository of software for a specific release of Fedora Core). The local client (identified by a round icon at the right of the desktop panel) can manually or automatically connect to the Red Hat Network server, obtain a list of updates, errata, and security fixes and install them; one subscription is required for each client.

NOTE

If this client-server model appeals to you and you want to use it for your network, you can sign up for subscriptions or consider one of two Open Source Up2Date server alternatives: Current at http://current.tigris.org/, or NRH-up2date at http://www.nrh-up2date.org/index.html. These two projects are attempting to provide RHN-like services under your control so that you can use non-Red Hat and non-Fedora packages with the service. Bear in mind, though, that Fedora is in the process of deprecating up2date as a method of package management in favor of Yum.

Although there are several alternatives for rpm/system-config-packages, two of the most useful are apt and Yum. These package management applications go a long way toward solving dependency problems and easing the use of RPM to manage software. Both can install software from either local or remote repositories. Interestingly, the Yum application is now provided in Fedora, and system-config-packages has been modified to be used as a graphical front end for it.

The benefit to installing and using either of these two applications is that they allow you easy access to and installation of programs that Red Hat nor Fedora Core cannot or will not provide (such as multimedia and non-GPL licensed applications). Since the apt and Yum mirrors for Fedora all have current Fedora updates, it is not necessary for you to use up2date or RHN to keep your computer software current. The following sections discuss the apt and Yum applications in more detail.

apt

Originally developed for Debian Linux and modified to use with rpm packages by Connectiva Linux, apt and its GUI interface Synaptic are easy to install and use. There are two primary providers of apt packages and repositories; either provider is a good choice. However, because of version conflicts between packages, the two projects' files should not be used together. FreshRPMs at http://www.freshrpms.net/is one provider; the Fedora Project at http://fedora.mplug.org/is the other. The Fedora Project has now been integrated into the briefly lived Red Hat Linux Project and renamed Fedora Core. We will use FreshRPMs as an example because they provide packages not available from Fedora.

Here is how you install and configure apt:

  • Read the introduction to apt in the /apt/ section of the http://freshrpms.net site.

  • Install the FreshRPMS GPG key (you need to have lynx installed, or simply download and gpg --import the downloaded text file):

# lynx -source http://freshrpms.net/packages/RPM-GPG-KEY.txt | gpg --import

  • Install the correct version of apt from FreshRpms.

# rpm -ivh http://ftp.freshrpms.net/pub/freshrpms/fedora/linux/2/apt/

apt-0.5.15cnc6-1.1.fc4.fr.i386.rpm

  • Review the man page of apt. The most important commands are apt-get update and apt-get install packagename:

# man apt

  • The list of apt repositories is preconfigured in /etc/apt/sources/list, but the index of packages that is available needs to be updated with

# apt-get update

  • Once the update of the packages list is completed, we suggest that you install Synaptic, the GUI package manager shown in Figure 7.5.

# apt-get install synaptic

    Figure 7.5. Synaptic is a graphical interface to the apt package management application making it incredibly easy to use.

    [View full size image]

  • Launch synaptic from the command line, browse the available packages, and install what you like.

# synaptic &

The Synaptic graphical interface is nicely laid out (see Figure 7.5). It allows you to view a list of all available packages and any dependencies required for them. It also provides a graphical interface to add new repositories.

Yum

Some developers believe that although apt is a good tool, using it for .rpm packages is a hack. apt also is believed to be bloated with unnecessary code used for the Debian .deb packages. A new tool, Yum, was developed using the Python language because the Fedora Core installer, Anaconda, was written in Python and much of the code could be shared. This decision is what has made Yum the choice for integration into the Fedora Core distribution. It works much the same as apt, but lacked a GUI tool. The Fedora developers have integrated support for Yum into the graphical Red Hat/Fedora package management tool. You can obtain Yum from the Fedora site as well as from FreshRPMs.net; the home page of Yum is at http://linux.duke.edu/projects/yum/.

Here's how you install and configure Yum:

  • Read the HOWTO and Users FAQ at the Fedora site: http://fedora.mplug.org/.

  • Install the Fedora GPG key:

# lynx -source http://fedora.mplug.org/FEDORA-GPG-KEY | gpg --import

  • Install the correct version of Yum:

# rpm -ivh http://ftp.freshrpms.net/pub/freshrpms/fedora/linux/2/yum/

yum-2.0.7-3.1.fc.fr.noarch.rpm

  • Review the man page for Yum to familiarize yourself with all available options:

# man yum

Once Yum is installed, the following commands are useful (remember that the Fedora graphical client is available if you configure it to use Yum repositories):

yum list— A list of all packages available from the repository.

yum list installed— A list of all packages installed on your computer.

yum list updates— A list of all updates available for your computer.

yum install packagename— Installs packagename.

yum update— Run without a packagename, Yum will update all installed packages.

yum remove packagename— Removes a package and dependencies.

yum upgrade— Run without a package name, Yum will upgrade all packages and remove any obsoleted packages; yum update will not remove obsoleted packages.

You'll find either apt or Yum to be useful additions to Fedora Core. We suggest that you use the one from FreshRPMs.net if you want to install some of the multimedia applications described in Chapter 10, "Multimedia Applications." To learn more about yum, check out Chapter 36, "Advanced Yum."


Compiling Software from Source

Not all the software you might want to use is available in rpm packages or in the exact form that you desire. Many complicated programs have options that can only be selected at compile time and many smaller, special-purpose applications only exist as source code. Fedora Core provides all the tools necessary for you to compile source code into binary applications. First, we'll cover building from source rpm files, and then manipulating source rpm files and finally, building from source tarballs.

NOTE

For other software package formats, you can use the File Roller application (found in the Accessories menu) to easily display, browse, read, and extract contents of compressed files, including legacy archives such as tarballs or compressed tar archives (recognized by their .gz or .tgz extensions). Other compressed files, such as those created with the compress command (ending in .Z) or bzip2 files (ending in .bz2), are also supported by File Roller. The File Roller client will also convert compressed archives between gzip and bzip2 formats.

Building RPMS from src.rpm Files

A rule of thumb is that you never build rpms as the root user even though the directories are already set up at /usr/src/redhat as follows:

# tree /usr/src/redhat

/usr/src/redhat

|-- BUILD

|-- RPMS

|   |-- athlon

|   |-- i386

|   |-- i486

|   |-- i586

|   |-- i686

|   `-- noarch

|-- SOURCES

|-- SPECS

`-- SRPMS

Using the mkdir command, re-create this directory tree structure in your home directory; you can name the new directory redhat (or anything you like). You might even want to create a new user just to build rpms and source code. (You can compile without being root; you just can't install the software systemwide as a regular user.)

The configuration information for building rpms is kept in three places:

/usr/lib/rpm/*/macros— The systemwide defaults.

/etc/rpm/macros.*— Where systemwide changes are kept.

~/.rpmmacros— Where user-specific changes are kept.

Because we need to tell rpm that we will not be using the systemwide default build location for our user, we can

$ echo "%_topdir $HOME/redhat" > $HOME/.rpmmacros

TIP

Here, we use > instead of >> to blank the file in case there is already content in it. The >> construct appends information to a file.

To select a temporary directory

$ echo "%_tmppath $HOME/tmp" >> $HOME/.rpmmacros

To set any compiler optimization flags (here, we are using an Athlon processor as an example), we will use

$ echo "-o3 -march=athlon" >> $HOME/.rpmmacros

To rebuild a src.rpm file as a regular user, you would use

$ rpmbuild --recompile packagename.src.rpm

After a successful build, you will find the binary file(s) in ~/redhat/RPMS/athlon.

You can install them as root with

# rpm -Uvh --replacepkgs --replacefiles packagename.rpm

If the build fails, the error message will point you to a solution (usually a dependency has not been satisfied). You will find that a lot of the packages named with -devel will be needed before you compile from source code. Install the package for the missing dependency and retry the compile.

Working with Source RPM Files

You might want to modify a source package for your own uses such as adding documentation, changing default settings, or patching the source code itself. Fedora Core provides the source code to its distribution in the form of source RPM files. You can access the source code on disks 4 and 5 of the downloadable CD images or obtain them from the Fedora Core FTP site.

TIP

An important part of the RPM file is called the .spec file, a specification file. It tells RPM how to behave with the particular source files during compilation, installation, and erasure.

As an example, we'll use information that was found at http://elektron.its.tudelft.nl/~rbos36/mdkfreetype2.html (the page has now been removed by the author) to modify the freetype2 library provided with Fedora Core in order to enable the bytecode interpreter. The code for the interpreter has been disabled by default because of redistribution licensing concerns that don't affect individual use. Enabling the interpreter will result in improved rendering of the TrueType fonts. We used the file from Red Hat 7.3 as our example, but the source file from FC4 should work as well.

Begin work by first installing the source RPM package with rpm -i. (Note that here we are building as root to follow the example from the web page; you should typically build packages as a regular user.) In our example, obtain the freetype-2.1.9-2.src.rpm and install it with rpm -i. The source code files are placed in /usr/src/redhat/SOURCES.

Copy the source file (it's a compressed tar file) to /tmp, and then cd (change directories) there to unpack and modify it:

# cp freetype-2.1.9.tar.bz2 /tmp

# cd /tmp

Because it's a .bz2 (BZip2 compressed) tar file, un-tar it with

# tar xjvf freetype-2.1.9.tar.bz2

and cd to the new directory:

# cd freetype-2.1.9

Using the text editor of your choice, edit the file include/freetype/config/ftoption.h and find the line

#undef TT_CONFIG_OPTION_BYTECODE_INTERPRETER

Change it to

#define TT_CONFIG_OPTION_BYTECODE_INTERPRETER

Save it and exit the text editor.

Next, re-create the compressed archive:

# cd /tmp

# tar cfj freetype-2.1.9.tar.bz2 ./freetype-2.1.9/

Put it back in your source directory:

# mv freetype-2.1.9.tar.bz2 /usr/src/SOURCES

Now edit the .spec file in /usr/src/redhat/SPECS to change the line beginning with Release to increment the number found there. (We are changing the version number by doing this, so it will not conflict with the version of the application we will be replacing.) Make any changes to the %description line to describe your changes if you desire, and save the file.

Build the binary RPM with

# rpmbuild -bb freetype.spec

During the build process, RPM will detect a patch and ask you about the patch; press y for "yes" to continue.

The new RPMs (actually four of them) are found in /usr/src/redhat/RPMS/i386. We only need the one named freetype-2.1.9; you can install it with rpm -Uvh. (This is why we changed the version number; if we had not, RPM would not upgrade to the "same" version. Had we not changed the version number, we could have forced the installation with the --replacepackages --replacefiles option.)

The font server needs to be restarted to use the new library, so we use the service command as shown in Chapter 14, "Automating Tasks."

# service xfs restart

Enjoy your new look—provided by better rendering of the fonts.

Compile from Source Tarballs

Compiling applications from source is not that difficult. Most source code is available as compressed source tarballs—that is, tar files that have been compressed using gzip or bzip. The compressed files will typically uncompress into a directory containing several files. It's always a good idea to compile source code as a regular user to limit any damage that broken or malicious code might inflict, so create a directory named source in your home directory.

From wherever you downloaded the source tarball, uncompress it into the ~/source directory using the -C option to tar:

$ tar zxvf packagename.tgz -C  ~/source

$ tar zxvf packagename.tar.gz -C  ~/source

$ tar jxvf packagename.bz -C  ~/source

$ tar jxvf packagename.tar.bz2 -C  ~/source

If you're not certain what file compression method was used, employ the file command to figure it out:

$ file packagename

Now, change directories to ~/source/packagename and look for a file named README, INSTALL, or a similar name. Print the file out if necessary because it will contain specific instructions on how to compile and install the software. Typically, the procedure to compile source code is

$ ./configure

which runs a script to check if all dependencies are met and the build environment is correct. Then,

$ make

to compile the software. And finally, as root:

# make install

If the compile fails, check the error messages for the reason and run

$ make clean

before you start again. You can also run

$ make uninstall

to remove the software if you do not like it.

An alternative to running make install is a program named CheckInstall, which will produce an rpm file for your installation. This method allows the RPM database to be aware of and keep track of all the files you are installing. See the following sidebar on CheckInstall for more information.

A Handy Software Installation Tool—CheckInstall

When you compile applications from source and install them, they won't show up in the RPM database and therefore can't be managed by RPM.

You can provide RPM management for these applications by using a program named CheckInstall. At its simplest, checkinstall is a drop-in substitute for the make install step in building from source code.

For example, when compiling from source code, you would traditionally use

# ./configure

# make

# make install

Using CheckInstall, the steps would look like this:

# ./configure

# make

# checkinstall

CheckInstall will create a binary .rpm package and install the application from it. This makes the new application part of the RPM database. The new .rpm file is left for you in /usr/src/redhat/RPMS/i386. The new application can later be uninstalled with rpm -e.

Some applications arrive in the form of a shell script wrapper. Using the shell script as the argument to CheckInstall will provide a .rpm file of the installed files and add them to your RPM database. Not all applications will install with CheckInstall. Read its accompanying documentation carefully.

CheckInstall can be downloaded from http://asic-linux.com.mx/~izto/checkinstall/index.php.

Relevant Fedora Core and Linux Commands

You'll use these commands while managing your Fedora Core Linux system resources and software packages:

system-config-packages— The Fedora Core GUI Package Manager.

rpm— The RPM Package Manager.

rpmbuild— Builds RPM source and binary packages.


Reference

http://www.rpm.org—Home page for the Fedora Core Package Manager. This site provides essential links to the latest version of RPM software for Linux and X desktop environments, such as GNOME.

http://www.rpm.org/max-rpm/—Link to the start of an update to Ed Bailey's classic tome and RPM reference book, Maximum RPM.

http://linux.tnc.edu.tw/techdoc/maximum-rpm/rpmbook/node15.html—History of the Red Hat Package Manager.

http://www.smoogespace.com/documents/behind_the_names.html—A history of Red Hat Linux releases, and a good place to learn about the connection between the names of the releases.

http://www.gnupg.org/—Home page for GNU Privacy Guard, an unencumbered free replacement for Pretty Good Privacy.

http://www.debian.org/doc/manuals/project-history/ch-detailed.en.html—History of the Debian Linux package system.

http://www.nrh-up2date.org/index.html—A replacement for Red Hat's Up2Date application.


Chapter 8. On the Internet: Surfing the Web, Writing Email, and Reading the News

IN THIS CHAPTER

  • Choosing a Web Browser

  • Choosing an Email Client

  • An Overview of Network News

  • Choosing a Newsreader

  • Collaborating with TWiki

  • Internet Relay Chat

  • Instant Messaging with GAIM

  • Videoconferencing with GnomeMeeting

  • Reference

The Internet has revolutionized our modern civilization within a very short time. Not long ago it was unheard of to be communicating through the Internet; nowadays you are deemed backwards if you do not have an email account or an instant messenger. This chapter introduces you to some of the more popular software that you can use to access the Internet, send and receive email, read network news, collaborate with others using an online collaboration tool, and talk in real time using instant messenging and even videoconferencing. You will find out how to set up each piece of software to access the resources you need.


Choosing a Web Browser

The Internet has forever changed how we access and share information. The ways in which we view the Internet have also changed and are continually improving to give better and richer experiences. In this section, we look at some of the popular open-source web browsers available for Fedora.

A Brief Introduction to the Internet

The Internet itself was first brought to life by the U.S. Department of Defense in 1969. It was called ARPANet after the Department of Defense's Advanced Research Projects Agency. Designed to build a network that would withstand major catastrophe (this was the peak of the Cold War), it soon grew to encompass more and more networks to build the Internet. Then, in 1991 Tim Berners-Lee of CERN developed the idea of the World Wide Web, including Hypertext Transfer Protocol (HTTP) and Hypertext Markup Language (HTML). This gave us what we now know to be the Internet.

Mozilla Firefox

One of the most popular web browsers, and in fact the default web browser in Fedora, is Mozilla Firefox (see Figure 8.1). Built on a solid code base that is derived from the Mozilla Suite, Firefox offers a new lease on life to surfing the Internet. Over 25 million people have downloaded Firefox since its release in late 2004, and it has grabbed significant market share from Internet Explorer.

Figure 8.1. Mozilla Firefox—rediscover the Web. Firefox allows you to add on numerous upgrades, further enhancing your experience.

[View full size image]

In Fedora you will find Firefox under the Applications, Internet menu at the top of your screen. An even simpler way to start Firefox, though, is to click the small world icon next to the Actions menu. Either way, you will open Firefox.

Beyond the basic program are a wealth of plug-ins and extensions that can increase the capabilities of Firefox beyond simple web browsing. Plug-ins such as Shockwave Flash and Java are available, whereas extensions provide useful and sometimes humorous additions to the browsing experience. For example, ForecastFox is an extension that gives you your local weather conditions, and Bandwidth Tester is a tool that calculates your current bandwidth.

The Mozilla Suite

The Mozilla Suite is a tightly integrated web browsing and messaging application suite that was spun off from Netscape (see Figure 8.2). Since Netscape became dormant a few years ago, the Mozilla Foundation was set up by AOL and other companies to continue the now open-source development of the once-popular browser. The fruits of this labor can be seen in the Mozilla Suite. By default, Mozilla is not installed in Fedora; instead you have to specify it in the installation or install it later using Yum or apt.

Figure 8.2. The Mozilla suite, the forefather of Firefox and a descendant of Netscape.

[View full size image]

Bear in mind that if you install Mozilla, you also get the other parts of the suite: the mail and newsgroup reader, the address book, and the IRC client. If you do not require all of this, you might be better off with Firefox.

Epiphany

Epiphany is the browser supplied with the vanilla Gnome desktop (see Figure 8.3). Very basic and built on the same Gecko rendering engine as Firefox and Mozilla before it, Epiphany has advanced in a number of areas to the current version.

Figure 8.3. Epiphany, the standard Gnome web browser.

[View full size image]

Konqueror

KDE users have the option to use Konqueror, which is the default browser for KDE (see Figure 8.4). As well as handling file system navigation, Konqueror can also be used to surf the Web. It, too, is based on the Gecko rendering engine as found in Firefox, Mozilla, and Epiphany.

Figure 8.4. Konqueror, the standard KDE web and file system browser.

[View full size image]


Choosing an Email Client

Back in the days of Unix, there were various text-based email clients such as elm and pine (Pine Is Not Elm). Although they looked basic, they allowed the average user to interact with his email, both composing and reading correspondence. With the advent of mainstream computing and the realization that people needed friendly GUI interfaces to be productive, came a plethora of email clients, with some of them being cross-platform and compatible between Linux, Windows, and Mac OS X, not to mention Unix.

A Brief Introduction to Email Terms

The email world is filled with acronyms and technical terms. The first of these covered here describes the components of the email system. Some applications combine features from among these three groups.

The Mail User Agent (MUA), mail client, or mail reader allows the user to read and compose her email. This is the application most users are familiar with; it presents a text or graphical interface to the user. Examples would be Evolution, Balsa, mutt, Mozilla Mail, or KMail. All are provided by Fedora Core.

The mail transfer agent (MTA) works behind the scenes to send and receive email between computers. Examples would be Sendmail, Postfix, Fetchmail, Exim, or Qmail. All but the last two are provided by Fedora Core. The Mail Delivery Agent (MDA) is similar to an MTA, but does not handle deliveries between systems and does not provide an interface to the user like an MUA. Examples would be Procmail or Spamassassin; both provide filtering services to the MTA, and the latter is provided by Fedora Core.

The protocols used for email are a hotbed of acronyms; these are covered next.

RFC— The Request For Comments is as close to an Internet rulebook as one can get. See the "Reference" section at the end of this chapter for links to specific RFCs. By changing the number in the link, you can look at any particular RFC. If you have Fetchmail installed, author Eric S. Raymond has included a list of RFCs (with descriptions) that are relevant to email in the file /usr/share/doc/fetchmail/NOTES.

POP— Defined by RFC-1939, the Post Office Protocol is a mail server for delivering mail to clients. (It isn't used for sending mail to servers; that's SMTP, later.) POP3 is very useful when you have one mail client on one computer, such as a typical home user. POP3 is designed for local access to mail; it downloads all mail from a central server to the local client, and then deletes the files on the server. Most ISPs offer POP3 mail access.

IMAP— It is the Internet Mail Access Protocol, which allows a user to access his email stored on a remote server rather than a local disk. This means that email can be accessed from anywhere if the user is employing a mail client with IMAP support. IMAP is a good solution to providing mail for a LAN. The version supplied with Fedora Core is the University of Washington IMAP server, found at http://www.washington.edu/imap/.

SMTP— Defined by RFC-821, it is the Simple Mail Transport Protocol used for sending mail from one network to another. It is a sever-to-server protocol, so some other method must be used to deliver messages to a client application to be read by a user. Extensions to the protocol add authentication and error messages to the basic protocol.

MIME— Defined by RFC-1341, 1521, 1522, 1523, 1820, and many others, Multipurpose Internet Mail Extensions address the formatting of email messages to include non-ASCII text, encoded binary images, and multimedia content.

Certainly, this is not an exhaustive list, nor is it intended to be. You might find the Jargoogle search page useful to decipher other unfamiliar terms you encounter. It is found at http://www.tuxedo.org/~esr/jargon/jargoogle.html.

NOTE

The amazing deluge of spam and Internet scams using forged headers has spurred interest in a "better mousetrap." One such project is AMTP at http://amtp.bw.org/, an enhancement for SMTP. This specification calls for mail servers needing a signed security certificate and using TLS (Transport Layer Security, RFC2246). An AMTP mail server will not relay mail from an "untrusted source"—in other words, a mail server lacking the proper authentication. Although not eradicating SPAM, AMTP does provide a mechanism to identify the source.

Evolution

Evolution, a Ximian/Novell product, is the standard email client that comes with Fedora (see Figure 8.5). If you have used Microsoft Outlook, the interface Evolution has will come as no great shock. It really is a drop-in replacement for Outlook and encompasses many of Outlook's features and benefits, including email, calendaring, contact management, and task management. Here we examine how to get Evolution configured for email access.

Figure 8.5. Ximian Evolution, the default and extremely powerful email client for Fedora.

[View full size image]

You need to have the following information to hand to successfully configure Evolution:

  • Your email address

  • Your incoming email server name and type (that is, pop.email.com, POP, and IMAP)

  • Your username and password for the incoming server

  • Your outgoing email server name (that is, smtp.email.com)

After you have all the information, you can start Evolution. The first screen you are presented with is the Account Setup Assistance (see Figure 8.6).

Figure 8.6. You can launch and configure Evolution with just a few simple commands. The Identity screen, the first of several screens, asks you to enter your information. Click Forward to proceed.

The next screen permits you to configure Evolution to use your MTA. You can choose POP, IMAP, the local spools found in /var/mail in either mbox or maildir format, a local MTA, or None if you simply want to use the other features of Evolution. As shown in Figure 8.7, you can also set your password.

Figure 8.7. The Receiving Mail screen requires information from your ISP or system administrator.

You must also choose between SMTP or Sendmail for sending your mail; enter your email address, and choose a time zone (very important for your calendar). Finally, you will see the opening Evolution window in Figure 8.8.

Figure 8.8. The standard Evolution display. On the left you can see buttons to choose Mail, Contacts, Calendars, and Tasks windows.

[View full size image]

Each icon in the left pane of mainEvolution window opens a different window when selected. Each view has options that can be configured to suit your needs; just click each window's Tools menu item, for example, to open the Tools screen, shown in Figure 8.9.

Figure 8.9. The calendar application Tools screen is where the information can be shared with others. Here, the times and dates can be configured.

[View full size image]

Mozilla Thunderbird

Mozilla Thunderbird is the sister program to Firefox. Whereas Firefox is designed to browse the Web, Thunderbird's specialty is communication. It can handle email, network news (see later in this chapter), and RSS feeds.

Thunderbird is not installed by default with Fedora, so you will have to use either yum or apt to install it.

Balsa

Balsa is an email client designed to work with GNOME. Configuring Balsa is similar to configuring Evolution, although most of the configuration is done from the Preferences menu item, and the basic functionality is similar. Figure 8.10 shows a screenshot of the Balsa interface.

Figure 8.10. The Balsa email client. It should not take long for users of Outlook Express or Mozilla Mail to get comfortable with the interface.

[View full size image]

KMail

If you are using the KDE Desktop Environment rather than the Fedora Core default GNOME desktop, you will also have KMail installed. As with Balsa, it won't take users of Outlook Express or Mozilla Mail very long to get used to the KMail interface. Some useful features found in KMail are the choice of mbox or maildir formats, improved filter creation, the ability to sort mail into threads, and the ability to apply filters at the MTA. Figure 8.11 shows the KMail email program. KMail offers IMAP access; extensive filtering; mbox and maildir formats; and the ability to easily integrate MTAs such as Procmail, Spamassassin, or custom processing scripts.

Figure 8.11. The KMail email client, part of the KDE Desktop Environment.

[View full size image]

Mozilla Mail

Mozilla is more than a browser: It is an Internet Relay Chat client and a mail and newsgroup reader. The Mail and News setup wizard and preferences can be found under the Edit menu item. When you select Mail & Newsgroup Account Setup and then click New Account, the wizard dialog appears, as shown in Figure 8.12.

Figure 8.12. This is where your email and newsgroup configurations are set. Mozilla provides many choices to accommodate your individual needs.

[View full size image]

Configuration via the wizard is easy: Mozilla prompts you for the necessary information. The Mail interface (shown in Figure 8.13) is familiar to many users. If you use Mozilla for web browsing, using it for email is a natural extension. Mozilla Mail is also a good choice for those who do not need all the features offered in the Evolution mail client.

Figure 8.13. The interface to Mozilla Mail is familiar to many; is similar to MS Outlook Express, KMail, and Balsa; and is easy to use.

[View full size image]

The mail Application

A Unix utility named mail is included with all Unix and Linux distributions. Because it has a very Spartan interface, it is not commonly used interactively. However, mail is still an extremely useful program to use in shell scripting because it can take all the information it needs to send mail from the command line. No user interaction is required. mail is also useful for sending quick notes because it starts up quickly and doesn't require going through menus to send a message.

Using mail

To begin sending a message in mail, simply type mail at the shell prompt, followed by the email address that you want to send mail to:

$ mail paul@hudzilla.org

mail will then prompt you for the subject of the message. Enter the subject and press Enter. The cursor will then move down to the next blank line. You can now start entering the body of your message. When you have finished, press Ctrl+D on a blank line to exit the mail program and send the message. (You might be prompted for Cc:. If you do not want to send carbon copies to anyone, simply press Enter here.) The message will be handed off to the MTA, and your shell prompt will return. To abandon a message you are currently writing, press Ctrl+C.

If you want to retrieve your email using the mail program, simply type mail at the shell prompt. The system will respond with something similar to the following:

Mail  Type ? for help.

"/var/mail/andrew": 1 message 1 unread

>U  1 paul@hudzilla.org   Sun Mar 20 07:15  18/551   "Birthday"

>N  2 spam@ebay.com      Sun Mar 20 08:25  18/542

"A large and obnoxious spam message"

>N  3 paul@hudzilla.org   Sun Mar 20 09:21  17/524   "Fedora 4 Update"

>N  4 nick@veitch.org      Sun Mar 20 09:24  17/528   "Issues"

&

The & prompt is mail's way of prompting you for input.

The first column in the list of messages is a flag that indicates the status of the message. For example, U means that the message is unread. N means that the message is new. The rest of the columns are self-explanatory.

To read one of these messages, simply type the message number and press Enter.

For example,

& 4

Message 4

From nick@veitch.org  Sun Mar 20 09:24:35 2003

Date: Tue, 23 Sep 2003 09:24:34 -0500

From: andrew@andbhudson.co.uk

To: nick@veitch.org

Subject: Issues

Hey Nick,

The new issue looks great! Where did you get the idea for the cover from?

Seeya

&

If you want to respond to this message, you can type respond and press Enter. You can also simply type r and press Enter. By default, the command will be applied to the currently active message, which is indicated in the message list by a > (and will be the last message that you read). If you want to have the command applied to a different message, you can simply specify the message number after the command. For example, typing r 2 will respond to message number 2.

A complete list of commands is available within mail by typing ? at the prompt. Note that you can abbreviate all commands to the shortest abbreviation that is not ambiguous.

Shell Scripting with mail

As mentioned previously, mail's most useful application is its use in shell scripting. The complete instruction to create and send a message can be done from the command line. For example, suppose that we have a shell script that generates a report and stores it as a text file. Now we want to email that text file to a user at the end of the script. With mail, we could use a command such as the following:

$ mail andrew@andbhudson.co.uk -s "Report from shell script" < report.txt

The -s specifies a subject line on the command line, and then we use simple shell redirection to use the file report.txt as the body for the message (see Chapter 14, "Automating Tasks"). It is simple, clean, and requires no user interaction to send the message.

For other options available on the mail command line, see the man page for mail.

NOTE

The venerable pine email client is no longer provided by Fedora, not because it is not a good application; it just uses a license that is incompatible with distribution by Fedora and Red Hat.

Mutt

Mutt is a relatively new command-line mail client that is rapidly becoming popular with users. The client is called mutt because it is known as "the mongrel of email clients" in that it attempts to combine the best features of several other clients such as elm and pine. Mutt is an extremely feature-rich email client, although it is not as easy to use as pine. It is however, more secure than pine. Figure 8.14 shows the mutt interface.

Figure 8.14. Mutt combines the best features of elm and pine (aside from ugly default screen colors). Fedora defaults the editor to vi, but you can choose any other editor.

[View full size image]

To check the version and see the compile time options, use mutt -v like this:

$ mutt -v

Mutt 1.4.2.1i (2004-02-12)

Copyright (C) 1996-2002 Michael R. Elkins and others.

Mutt comes with ABSOLUTELY NO WARRANTY; for details type `mutt -vv'.

Mutt is free software, and you are welcome to redistribute it

under certain conditions; type `mutt -vv' for details.

System: Linux 2.6.11.1177_FC4 (i686) [using ncurses 5.4]

Compile options:

-DOMAIN

-DEBUG

-HOMESPOOL  -USE_SETGID  -USE_DOTLOCK  -DL_STANDALONE

+USE_FCNTL  -USE_FLOCK

+USE_POP  +USE_IMAP  +USE_GSS  +USE_SSL  +USE_SASL

+HAVE_REGCOMP  -USE_GNU_REGEX

+HAVE_COLOR  +HAVE_START_COLOR  +HAVE_TYPEAHEAD  +HAVE_BKGDSET

+HAVE_CURS_SET  +HAVE_META  +HAVE_RESIZETERM

+HAVE_PGP  -BUFFY_SIZE -EXACT_ADDRESS  -SUN_ATTACHMENT

+ENABLE_NLS  -LOCALES_HACK  +HAVE_WC_FUNCS  +HAVE_LANGINFO_CODESET

¬+HAVE_LANGINFO_YESEXPR

+HAVE_ICONV  -ICONV_NONTRANS  +HAVE_GETSID  +HAVE_GETADDRINFO

ISPELL="/usr/bin/ispell"

SENDMAIL="/usr/sbin/sendmail"

MAILPATH="/var/mail"

PKGDATADIR="/usr/share/mutt"

SYSCONFDIR="/etc"

EXECSHELL="/bin/sh"

-MIXMASTER

To contact the developers, please mail to <mutt-dev@mutt.org>.

To report a bug, please use the flea(1) utility.

If you want to change the options (such as any paths) you will need to recompile mutt from the source code.

The latest versions of mutt, as well as news and information about it, are available at http://www.mutt.org. Mutt is proud to be a bug-free program, but its authors believe it might have a few "fleas"—thankfully, these are few.

The systemwide configuration file is kept at /etc/Muttrc, and each user can have his own ~/.muttrc files. Mutt configuration is often an evolving process, as each user attempts to configure this feature-rich mail client.

Before you can use mutt, you need to configure a .muttrc file for each user's home directory. A sample file is found in /usr/share/doc/mutt-*/sample.muttrc, just copy it (or the systemwide file) to .muttrc in the appropriate home directory. There, edit it to reflect how you have your mail system configured and set your preferences; you will find mutt highly customizable, awkward to configure, and simple to use.

Sending and receiving messages using mutt is very easy; the colorful display provides a subset of common commands, and F1 brings up the online help documents.

Other Mail Clients

The mail clients included by Fedora Core are only a few of those available. Sylpheed-claws (not included) is very popular because it offers spell check while typing and is well-suited for use in large network environments in which network overhead and RAM usage are important considerations. You can find other mail clients and applications suitable for use with Fedora Core Linux by searching http://freshmeat.net/.


An Overview of Network News

The concept of newsgroups revolutionized the way information was exchanged between people across a network. The Usenet network news system created a method for people to electronically communicate with large groups of people with similar interests.

The following sections describe the Usenet network newsgroup format and how newsgroup information is transmitted between hosts. As you will see, many of the concepts of Usenet news are embodied in other forms of collaborative communication.

Newsgroups

Usenet newsgroups act as a form of public bulletin board system. Any user can subscribe to individual newsgroups and send (or post) messages (called articles) to the newsgroup so that all the other subscribers of the newsgroup can read them. Some newsgroups include an administrator, who must approve each message before it is posted. These are called moderated newsgroups. Other newsgroups are open, allowing any subscribed member to post a message. When an article is posted to the newsgroup, it is transferred to all the other hosts in the news network.

Usenet newsgroups are divided into a hierarchy to make it easier to find individual newsgroups. The hierarchy levels are based on topics, such as computers, science, re-creation, and social issues. Each newsgroup is named as a subset of the higher-level topic. For example, the newsgroup comp relates to all computer topics. The newsgroup comp.laptops relates to laptop computer issues. Often the hierarchy goes several layers deep. For example, the newsgroup comp.databases.oracle.server relates to Oracle server database issues.

NOTE

The format of newsgroup articles follows the strict guidelines defined in the Internet standards document Request for Comments (RFC) 1036. Each article must contain two distinct parts: header lines and a message body.

The header lines identify information about when and from whom the article was posted. The body of the message should contain only standard ASCII text characters. No binary characters or files should be posted within news articles. To get around this restriction, binary files are converted to text data by using either the standard Unix uuencode program or the newer Multipurpose Internet Mail Extensions (MIME) protocol. The resulting text file is then posted to the newsgroup. Newsgroup readers can then decode the posted text file back into its original binary form.

A collection of articles posted in response to a common topic is called a thread. A thread can contain many articles as users post messages in response to other posted messages. Some newsreader programs allow the user to track articles based on the threads they belong to. This helps simplify the organization of articles in the newsgroup.

TIP

The free news server news.gmane.org makes the Red Hat and Fedora mail lists available via newsgroups. The beta list is available as gmane.linux.redhat.rhl.beta. It is a handy way to read threaded discussions and easier than using the Fedora Core mail list archives.

The protocol used to transfer newsgroup articles from one host to another is Network News Transfer Protocol (NNTP), defined in RFC 977. (You can search RFCs at ftp://metalab.unc.edu/pub/docs/rfc/;look at the file rfc-index.txt.) NNTP was designed as a simple client/server protocol that enables two hosts to exchange newsgroup articles in an efficient manner.


Selecting a Newsreader

Whether your Fedora server is or is not set up as a news server, you can use a newsreader program to read newsgroup articles. The newsreader programs just require a connection to a news server. It does not matter whether the news server is on the same machine or is a remote news server on the other side of the world.

Several programs are available for Unix systems to connect to news servers to read and post articles in newsgroups. The following sections describe the newsreaders that are available with the Fedora Core Linux distribution.

The slrn News Client

The slrn program is a text-based newsreader program included with the Fedora Core distribution. It uses the ncurses package to paint text-based windows on the terminal screen. slrn can be used to both read and post articles to newsgroups on a configured news server. If you want to use the same newsreader on different platforms, slrn runs on Linux, Mac, OS2, BeOS, Windows, and VMX. It now provides true offline reading capabilities.

The slrn program is included in the slrn RPM package; you install it by using the yum or rpm command. After you have installed slrn, you need to create a local configuration file. Begin by setting an environmental variable:

$ export NNTSERVER=news.andbhudson.co.uk

Of course, you will use your own news servers' domain name.

Then create you local configuration file with

$ slrn -f .jnewsrc -- create

and launch slrn. The configuration file, located at /etc/slrn.rc, is a well-commented file that is easy to modify and customize.

When slrn starts, it displays a list of the groups that are available on the news server. You select the group you want to read articles from, and then select the individual articles. Figure 8.15 shows a slrn screen example.

Figure 8.15. A slrn article display example showing a posted message about a FAQ for Internet mail.

[View full size image]

The Pan News Client

Pan is a graphical newsreader client that works with GNOME and is the default newsreader for Fedora. If you have the GNOME libraries installed (and they usually are installed by default), you can also use Pan with the K Desktop Environment (KDE). Pan has the capability to download and display all the newsgroups and display posted news articles. You can launch it by using the GNOME or KDE desktop panel or from the command line of an X terminal window with the command pan &. Pan supports combining multipart messages and the yenc encoding/decoding protocol. Figure 8.16 shows a sample Pan display. Unlike the slrn program, Pan does not require a systemwide default or user-defined NNTPSERVER environment variable to define the news server address, but you do need to configure Pan.

Figure 8.16. The Pan graphical newsreader is one of the nicest available for Linux, shown here displaying an image attached to a news article.

[View full size image]

The first time you run Pan, a configuration wizard appears and prompts you for your name, the SMTP server name, the NNTP server name, and the name you want to use to identify the connection (in the example shown in Figure 8.17, we use Cavtel). After the wizard is finished, you will be prompted to download a list of the newsgroups the server provides; this may take a while. If you need to change the news server or add an additional server, you can access the Preferences item under the Edit menu to bring up the list of servers. Then, you highlight the appropriate one and click Edit to change it or just click the New button to add a new news server.

Figure 8.17. The Pan news server configuration window.

The KNode News Client

The KNode program is part of the kdenetwork RPM package—the KDE network package included in Fedora Core. KNode is usually installed by default if you select the KDE windows manager option in the Fedora Core installation.

The KNode program is an excellent graphical program (similar to MS Outlook Express) that allows you to connect to news servers (either a local or remote server) and select newsgroups where you can read and post articles. Before you can begin, though, you must configure the address of your news server in KNode. You do this from the Settings menu item on the main KNode window; select the Configure KNode item, and the KNode configuration window appears. Under the Accounts item, select the News item. A list of configured news servers appears in the window. To add a new news server, click the New button. Figure 8.18 shows the KNode New Account window, where you can enter the new news server information.

Figure 8.18. The KNode newsreader; setup is quick and easy. It's a great newsreader for text-only newsgroups.

[View full size image]

The Mozilla News Client

The Mozilla web browser supports graphical Usenet news reading as well as web browsing. Having numerous news reading clients installed on a Fedora Core system offers users a wealth of choice and opportunities for developing favorites. In some cases, however, it can complicate the administrator's task of tracking and fixing client security liabilities. Using Mozilla can help simplify this task by offering an all-in-one client that provides web browsing, email, file transfer, and news reading capabilities. For these reasons, you might choose to use Mozilla as a browser, email client, and news client. Mozilla is the default browser for Fedora Core.

To begin news reading with Mozilla, you launch Mozilla and select Window, Mail and Newsgroups; the window shown in Figure 8.19 appears. The menu Edit, Mail & Newsgroups Account Settings is where you configure Mozilla for your news and mail server settings. Many people prefer to use Mozilla for all their web browsing, mail, news, and IRC.

Figure 8.19. Mozilla is a handy, all-around integrated Internet client.

[View full size image]

To add accounts, under Edit, Mail & Newsgroups Account Settings, click the Add Account button and select either a mail or news account to add. The Account Settings dialog is shown in Figure 8.20.

Figure 8.20. Here is where your configuration information is accessed. Note that we had to deliberately deselect the Compose Messages in HTML Format option, fixing a poorly chosen default.

[View full size image]

When you finish entering this information, click OK, and you arrive at the newsreader window. Click the news server name in the left pane and then select Subscribe to Newsgroups in the right pane to begin downloading a list of newsgroups from your news server. At any time, you can update the list of newsgroups by clicking the Refresh button in that window.

The Thunderbird News Client

Along with Firefox, the Thunderbird mail and news client is a direct descendant of the Mozilla suite. Designed to be lightweight and with a clean interface, Thunderbird does many of the things that the Mozilla News client can do but is a separate application from Firefox.

To add a new account to Thunderbird, click Tools, Account Settings and select Add Account. Select the news account and follow the prompts giving Thunderbird all the information it needs.

When you have finished providing Thunderbird with all the relevant information, click OK, and you arrive at Thunderbird's default view. Along the left pane you will see the new news server account. Click it and then select Manage Newsgroup Subscriptions.


Collaborating with TWiki

Although Usenet is a useful interactive and collaboration tool, in some cases a web-based tool is better suited to your needs. TWiki (http://TWiki.org/) is a web-based interactive collaboration tool that can also be used as a bulletin board, knowledge base, bug tracker, and software archive.

TIP

You can examine the TWiki Success Stories on the company's home page for any encouragement you need to explore TWiki. You can also explore this Linux-related public TWiki site (http://TWiki.org/cgi-bin/view/Wikilearn/WebHome/).

TWiki is not available from Fedora, and you must download it from the TWiki website after completing a brief registration. You then receive email instructions explaining how to download a .zip file from the site. (You use unzip to extract the files.) The program is licensed under the GPL.

You might want to first read the installation instructions located at http://TWiki.org/cgi-bin/view/TWiki/TWikiDocumentation. The documentation has been improved over the past year and now includes directions for installing TWiki as the non-root user. Many details are provided on file ownership and file permissions. There is also an automatic installer—the O'Wiki Installer—referenced at http://TWiki.org/cgi-bin/view/Codev/TWikiUnixInstaller. This might be a good approach to use if you are skilled at Apache configuration, but the install script does not set the appropriate file ownership and permissions for Fedora as mentioned later.

Here is a short list of advice for moving smoothly through the installation process on a Fedora system (this list assumes that you are performing an installation as the root user and are reading the TWiki installation instructions from the TWiki website):

  • You need to create the directory /home/httpd/twiki; unzip TWiki into this directory.

  • The installation instructions mention the file /etc/httpd/httpd.conf. For Fedora, this file is found at /etc/httpd/conf/httpd.conf. You simply copy and paste the entries shown in the example supplied by the downloaded instructions.

  • The path to Perl for Fedora is /usr/bin/perl.

  • Fedora Core runs CGI scripts as the user apache, not the user nobody, as assumed in the default TWiki installation. You can browse to http://localhost/twiki/bin/testenv and read the warnings that are displayed onscreen. This is a special script run on your local machine to help you diagnose any problems with your installation. The messages should be specific to your installation, and any warning should be accompanied by a suggestion about how to fix the problem.

The TWiki installation directions suggest setting permissions and changing ownership. For Fedora, the permissions are set correctly, but the ownerships are wrong. To change the ownerships, implement the following steps (after each step, you should reload the http://localhost/twiki/bin/testenv page to check your progress):

1.
Change the group ownership of everything to apache, but change the group ownership of /httpd/twiki/templates back to root:

# chgrp -r apache /home/httpd

# chgrp -r root /home/httpd/twiki/templates

2.
Remember to edit /home/httpd/twiki/lib/TWiki.cfg to reflect your own domain name instead of http://your.domain.com.

3.
Change the ownership of the RCS repository files to the user apache:

# cd /home/httpd/twiki/data

# perl -pi -e 's/nobody:/apache:/' */*,v

After you complete the installation, you should have a "virgin" TWiki installation that you can view at http://localhost/twiki/bin/view. As with any application, you need to further configure this file so that it suits your needs. The TWiki documentation explains the many configuration options and processes available to you. This documentation is included in the TWiki installation you just completed.


Internet Relay Chat

As documented in RC 2812 and RFC 2813, the IRC protocol is used for text conferencing. Like mail and news, IRC uses a client/server model. Although it is rare for an individual to establish an IRC server, it can be done. Most people use public IRC servers and access them with IRC clients.

Fedora Core provides a number of graphical IRC clients, including X-Chat, licq-kde, and Mozilla-chat, but there is no default chat client for Fedora Core. Fedora Core Linux also provides the console clients epic and licq for those who eschew X. If you don't already have a favorite, you should try them all.

CAUTION

You should never use an IRC client while you are the root user. It is better to create a special user just for IRC because of potential security problems. To use X-Chat in this manner, you open a terminal window, use su to change to your IRC user, and start the xchat client.

X-Chat is a popular IRC client, and it is the client that is used in this chapter's example. The HTML documents for X-Chat are available in /usr/share/docs/xchat. It is a good idea to read them before you begin because they include an introduction to and cover some of the basics of IRC. To launch the X-Chat client, select the IRC Client item from the Internet menu found under the Extras menu, or you can launch it from the command line, like this:

$ xchat &

The X-Chat application allows you to assign yourself up to three nicknames. You can also specify your real name and your username. Because many people choose not to use their real names in IRC chat, you are free to enter any names you desire in any of the spaces provided. You can select multiple nicknames; you might be banned from an IRC channel under one name, and you could then rejoin using another. If this seems slightly juvenile to you, you are beginning to get an idea of the type of behavior on many IRC channels.

When you open the main X-Chat screen, a list of IRC servers appears, as shown in Figure 8.21. After you choose a server by double-clicking it, you can view a list of channels available on that server by choosing Window, List Window. The X-Chat Channel List window appears. In that window, you can choose to join channels featuring topics that interest you. To join a channel, you double-click it.

Figure 8.21. The main X-Chat screen presents a list of available public servers from which to select.

The Wild Side of IRC

Do not be surprised at the number of lewd topics and the use of crude language on public IRC servers. For a humorous look at the topic of IRC cursing, see http://www.irc.org/fun_docs/nocuss.html. This site also offers some tips for maintaining IRC etiquette, which is essential if you do not want to be the object of any of that profanity! Here are some of the most important IRC etiquette rules:

  • Do not use colored text, all-capitalized text, blinking text, or "bells" (beeps caused by sending ^G to a terminal).

  • Show respect for others.

  • Ignore people who act inappropriately.

After you have selected a channel, you can join in the conversation, which appears as onscreen text. The messages scroll down the screen as new messages appear.

TIP

You can establish your own IRC server even though Fedora does not provide one. Setting up a server is not a task for anyone who is not well versed in Linux or IRC.

A popular server is IRCd, which you can obtain from ftp://ftp.irc.org/irc/server/. Before you download IRCd, you should look at the README file to determine what files you need to download and read the information at http://www.irchelp.org/irchelp/ircd/.


Internet Messaging with GAIM

IM has been popularized by America Online (AOL) as a way for AOL users to chat directly with each other rather than speak in chat rooms. As long as the IM clients for everyone involved in the conversation are running, they alert you to any incoming messages. The clients also announce to the server that you are active and listening for messages, so your friends can be made aware via buddy lists that you are available to chat with them.

You can use IM in place of IRC for interoffice collaboration. Fedora provides the GAIM IM client, for your use. To use them, you need to be communicating with a group of "buddies" who are active IM users as well.

GAIM is a GNOME (GTK-based) IM client that supports a wide range of protocols such as TOC, AIN/ICQ, Yahoo!, IRC, Jabber, Napster, Zephyr, and Gadu-Gadu. GAIM is a feature-rich message client, and it has support for plug-ins that extend the functionality of the application.

NOTE

GAIM supports Jabber, an open XML-based IM protocol that can be used to set up a corporate IM server. Jabber is not supplied with Fedora, but you can obtain additional information about it from the Jabber home page, at http://www.jabber.com/. You can obtain the Jabber server, Jabberd, from http://jabberd.jabberstudio.org/. If you want to use GAIM locally for collaboration, Jabber would be an excellent choice for a private local server.


Videoconferencing with GnomeMeeting

GnomeMeeting is an Internet videoconferencing application that provides two-way voice and pictures over the Internet by using the H.323 protocol for IP telephony (also known as Voice over IP [VoIP]). It is an application similar to Microsoft NetMeeting and is provided with Fedora Core as the default videoconferencing client.

Before you can take full advantage of the phone and videoconferencing capabilities of GnomeMeeting, you must configure a full-duplex–capable sound card and video device (see Chapter 10, "Multimedia Applications") as well as a camera.

GnomeMeeting is found in the Internet menu as Videoconferencing; you click on the icon to launch it. When you start the GnomeMeeting application for the first time, a configuration wizard (called a "druid") runs and you are greeted by the first of four configuration screens. You simply enter your name, email address, and location and select your connection type. The settings for your audio and video devices are automatically detected; you can view them by selecting the Preferences item from the Edit menu.

Figure 8.22 shows GnomeMeeting in action, looking at a list of users listed with the server who are currently online.

Figure 8.22. GnomeMeeting is surprisingly simple to use. A video source is not necessary; a static picture can be used as well.

[View full size image]

When you have GnomeMeeting running, you must register (from within GnomeMeeting) with the server at http://ils.seconix.com/ to enable conferencing; GnomeMeeting does this automatically for you if you have told it to do so during the initial configuration. GnomeMeeting is capable of communicating with Microsoft NetMeeting; you should ask NetMeeting users to register at http://ils.seconix.com/ so that you can see them because NetMeeting can see only other NetMeeting users.

You can find an informative FAQ at the GnomeMeeting home page at http://www.gnomemeeting.org/ that you should read in full before using GnomeMeeting. Also, an excellent article about VoIP is at http://freshmeat.net/articles/view/430/.

NOTE

If you frequently use VoIP applications such as GnomeMeeting, you will tire of repetitively typing in long IP addresses to make connections. To avoid this hassle, you can use a "gatekeeper"—similar in purpose to a DNS server—to translate names into IP addresses. OpenH323 Gatekeeper is one such popular gatekeeper application. It is not provided with Fedora, but you can obtain it from http://www.gnugk.org/.

Relevant Fedora Commands

You will use the following commands to manage electronic mail in Fedora Core Linux:

balsa— A GNOME mail user agent for X.

biff— A console-based mail notification utility.

evolution— A comprehensive and capable Ximian GNOME mail PIM for X.

thunderbird— A lightweight but powerful email application from Mozilla.

kmail— A graphical mail user client for KDE and X

korn— A biff applet for KDE and X.

mail— A console-based mail user agent.

mutt— A console-based mail user agent.


Reference

http://www.ximian.com—The home of Ximian Evolution, the standard email client for Fedora.

http://www.mozilla.org—The home page for Mozilla Firefox, Thunderbird, and the Mozilla Suite.

http://www.spreadfirefox.com/—The Firefox advocacy home page is useful for converting those Internet Explorer types.


Chapter 9. Productivity Applications

IN THIS CHAPTER

  • Office Suites for Fedora

  • PDA Connectivity

  • Scanner Applications for Fedora

  • Web Design Tools

  • Fax Client Software

  • Other Office and Productivity Tools Included with Fedora

  • Productivity Applications Written for Microsoft Windows

  • Reference

Today's modern businesses are beginning to learn what experienced Linux users have known for years: There are great cost benefits when using Linux and free productivity software. Stepping off the software licensing and upgrade treadmill immediately contributes to the bottom line. This chapter provides some details about popular office productivity software included with and available for Fedora. Despite the nay-saying of a few tech industry pundits, Fedora can be used to support desktop operations in business settings. You can create efficient personal computing environments by carefully choosing and installing select productivity software packages. A wealth of usable, reliable, and free software is available for Fedora.

Productivity clients include free office suites and tools that can be used for creating documents and for scheduling, organizing, and calculating.

In this chapter, we examine the default office productivity applications that Fedora provides. You will see how easy it could be to migrate your employees to Linux desktops because similar applications are available that can make use of existing Microsoft-formatted data files. You will learn about alternative applications provided by Fedora, as well as some applications that you can install yourself. This chapter describes how to install, configure, and launch the applications; information on using the applications is provided only to make you aware of special issues associated with the use of a given application.

NOTE

The full version of Fedora now comes on five CDs or a single DVD as opposed to the original three. As with most projects, the more active development that has taken place, the bigger the overall project. The Fedora Project team has already started putting Fedora on a diet—removing packages that are not considered to be essential to Fedora. This has included some of the productivity applications, so if you try to find one in the Add/Remove Programs and it is not there, try installing it with yum (see Chapter 36, "Advanced Yum").


Appendix A. Fedora and Linux Internet Resources

IN THIS APPENDIX

  • Websites and Search Engines

  • Usenet Newsgroups

  • Mailing Lists

  • Internet Relay Chat

Linux enjoys a wealth of Internet support in the form of websites with technical information, specific program documentation, targeted whitepapers, bug fixes, user experiences, third-party commercial technical support, and even free versions of specialized, fine-tuned clone distributions.

This appendix lists many of the supporting websites, FTP repositories, Usenet newsgroups, and electronic mailing lists that you can use to get more information and help with your copy of Fedora.

If You Need Help 24/7

If you are a small business, corporate, or enterprise-level Red Hat Linux user, don't forget that you can always turn to the source, Red Hat, or third-party companies, such as Levanta (http://www.levanta.com/) for commercial technical support on a 24/7 onsite basis, by phone, by electronic mail, or even on a per-incident basis. Red Hat offers a spectrum of support options for its software products. You can read more about support options when you purchase Red Hat software at http://www.redhat.com/software/rhel/purchase/. Remember that Fedora is not an officially supported product from Red Hat. If you want help, try http://fedoraproject.org.

The appendix is divided into the following sections:

  • Websites with Linux information arranged by category

  • Usenet newsgroups pertaining to Linux

  • Mailing lists providing Linux user and developer discussions

  • Internet Relay Chat groups for Linux information

This appendix also lists websites that might be of general interest when using Fedora or specific components such as Xorg. Every effort has been made to ensure the accuracy of the URLs, but keep in mind that the Internet is always in flux!

Keep Up-to-Date with up2date or yum

Keeping informed about bug fixes, security updates, and other errata is critical to the success and health of a Fedora system. To keep abreast of the most important developments when using Fedora, be sure to register with the Fedora Announcements mailing list. This will tell you which updates have been issued and what has been fixed as a result. Go to http://www.redhat.com/mailman/listinfo/fedora-announce-list to register for this mailing list. You should also use the yum command (as root) to keep up with bug fixes, new software packages, or security updates.


Websites and Search Engines

Literally thousands of websites exist with information about Linux and Fedora. The key to getting the answers you need right away involves using the best search engines and techniques. Knowing how to search can mean the difference between frustration and success when troubleshooting problems. This section provides some Internet search tips and lists Red Hat, Fedora, and Linux-related sites sorted by various topics. The lists are not comprehensive, but have been checked and were available at the time of this writing.

Web Search Tips

Troubleshooting problems with Linux by searching the Web can be an efficient and productive way to get answers to vexing problems. One of the most basic rules for conducting productive searches is to use specific search terms to find specific answers. For example, if you simply search for "Fedora Linux," you will end up with too many links and too much information. But if you search for "Fedora Core sound," you are more likely to find the information you need. If you've received an error message, use it; otherwise, use the Linux kernel diagnostic message as your search criterion.

Other effective techniques include

  • Using symbols in the search string, such as the plus sign (+) to force matches of web pages containing both strings (if such features are supported by the search engine used by web search site)

  • Searching within returned results

  • Sorting results (usually by date to get the latest information)

  • Searching for related information

  • Stemming searches; for example, specifying returns for not only "link" but also "linking" and "linked"

Invest some time and experiment with your favorite search engine's features—the result will be more productive searches. In addition to sharpening your search skills, also take the time to choose the best search engine for your needs.

Google Is Your Friend

Some of the fastest and most comprehensive search engines on the Web are powered by Linux, so it makes sense to use the best available resources. Out of the myriad number of websites with search engines, http://google.com stands out from the crowd, with 10 million or more users per month. The site uses advanced hardware and software to bring speed and efficiency to your searches. If you are looking for specific Linux answers, take advantage of Google's Linux page at http://google.com/linux.

Why is Google (named after a math number) so powerful? You can find get a quick idea from the Google folks at http://www.google.com/technology/index.html. Part of its success is because of great algorithms, good programming, and simple interface design, but most users really seem to appreciate Google's uncanny capability to provide links to what you are looking for in the first page of a search return. Google's early success was also assured because the site ran its search engine on clusters of thousands of PCs running a version of Red Hat Linux!

Google has the largest database size of any search engine on the Web, with more than eight billion web pages searched and indexed. The database size is important because empty search results are useless to online users, and the capability to return hits on esoteric subjects can make the difference between success and failure or satisfaction and frustration. Some of Google's features include a GoogleScout link to return similar pages on the results page, the capability to see the exact version of a web page as returned to a search engine (known as a "cached" feature), advanced searches, and more recently, a link to an active Usenet news feed!

To get a better idea of what Google can offer you, browse to http://www.google.com/options/. You will find links to more than two dozen different services and tools covering specialized searches, databases, information links, translators, and other helpful browsing tools.

Fedora Package Listings

You can quickly and easily view a list of the installed RPM packages installed on your Fedora system, along with a short description of each package, by using the rpm command:

$ rpm –qai | less

Fedora users can also use the yum command to view package names and information about not only installed packages, but any available updated packages, like this:

$ yum info | less

If you use Fedora and only want to see info about your installed packages, use the yum command's installed list option like so:

$ yum info installed | less

However, the Fedora Project conveniently provides a list and description of each package in each Fedora release at http://fedora.redhat.com/projects/package-list/. A list of packages included with the last free Linux distribution from Red Hat, Red Hat Linux 9, can be found at http://www.fedora.us/pkglists/fedora-9-stable.html l.

Certification

Linux certification courses are part of the rapidly growing information technology training industry. Hundreds of different vendors now offer courses about and testing of Linux skill sets. However, because Linux is open-source software, there are no formal rules or mandates concerning what knowledge or level of expertise is required for certification. If you are interested in certification using Red Hat Linux and would like to pursue a career or obtain employment with a company using Red Hat Linux, you really should seek training from the one best and most qualified company: Red Hat.

That said, the following websites might be of interest if you'd like to pursue a certification track for Red Hat or other Linux distributions:

  • http://www.lpi.org— The Linux Professional Institute, with Linux vendor- and distribution-neutral programs

  • http://www.redhat.com/training/— Entry page to Red Hats Global Learning Services and information about the Red Hat Certified Engineer program

Commercial Support

Commercial support for Linux and Red Hat Linux is an essential ingredient to the success of Linux in the corporate and business community. Although hundreds, if not thousands, of consultants well versed in Linux and Unix are available on call for a fee, here is a short list of the best-known Linux support providers:

  • http://www.redhat.com/apps/support/— Red Hat's main support page with links to its various support programs.

  • http://www.levanta.com— Home page for Levanta—formerly known as Linuxcare—providing local and remote technical support for many types of installations and customers.

  • http://www.ibm.com/linux/— Linux services offered by IBM include e-business solutions, Open Source consulting, database migration, clustering, servers, and support. In addition to service-oriented support companies, nearly every commercial distributor of Linux has some form of easily purchased commercial support. There are various ways in which to take advantage of support services (such as remote management, onsite consulting, device driver development, and so on), but needs will vary according to customer circumstances and installations.

The Benefits of Joining a Linux User Group

Join a local Linux Users Group (LUG)! Joining and participating in a local LUG has many benefits. You will be able to get help, trade information, and learn many new and wonderful things about Linux. Most LUGs do not have membership dues, and many often sponsor regular lectures and discussions from leading Linux, GNU, and open-source experts. For one great place to start, browse to http://www.tux.org/luglist.html.

Documentation

Nearly all Linux distributions include thousands of pages of documentation in the form of manual pages, HOWTO documents (in various formats, such as text and HTML), mini-HOWTO documents, or software package documentation (usually found under the /usr/share/doc/ directory). However, the definitive site for reading the latest versions of these documents is the Linux Documentation Project, found at http://www.tldp.org.

Linux Guides

If you are looking for more extensive and detailed information concerning a Linux subject, try reading one of the many Linux guides. These guides, available for a number of subjects, dwell on technical topics in more detail and at a more leisurely pace than a HOWTO. You find copies of

  • "Advanced Bash-Scripting Guide," by Mendel Cooper; a guide to shell scripting using bash

  • "LDP Author Guide," by Mark F. Komarinski; how to write LDP documentation

  • "Linux Administration Made Easy," by Steve Frampton

  • "Linux Administrator's Security Guide," by Kurt Seifried

  • "Linux Consultants Guide," by Joshua Drake; a worldwide listing of commercial Linux consultants

  • "Linux from Scratch," by Gerard Beekmans; creating a Linux distribution from software

  • "Linux Kernel 2.4 Internals," by Tigran Aivazian; a guide to the 2.4 kernel

  • "Linux Kernel Module Programming Guide," by Ori Pomerantz; a somewhat dated guide to building 2.0 and 2.2 series modules

  • "Securing and Optimizing Linux," by Gerhard Mourani; specific to Red Hat Linux

  • Linux certification

  • "The Linux Network Administrator's Guide, Second Edition," by Olaf Kirch and Terry Dawson; a comprehensive Net admin guide

The Fedora Project

  • http://fedora.redhat.com— Home page for the Fedora Project, Red Hat community-based free Linux distribution. Fedora Core is the main release of this Linux distribution, and includes thousands of software packages that form the core of an up-to-date, cutting-edge Linux-based desktop.

  • http://www.fedoraproject.org/— Home page for the community side of Fedora. You will find a lot of support and HOWTOs here.

Red Hat Linux

  • http://www.redhat.com— Home page for Red Hat's distribution of Red Hat Enterprise Linux for multiple processors and architectures. Support is also provided for older, but now discontinued, versions of the SPARC.

  • http://www.redhat.com/apps/support/documentation.html— Specific web page with links to current official Red Hat manuals and guides, FAQs, HOWTOs, whitepapers, free books, mailing list archives, hardware compatibility lists, and other documentation.

Mini-CD Linux Distributions

Mini-CD Linux distributions are used for many different purposes. Some distributions are used to boot to a read-only firewall configuration; others are used to provide as complete a rescue environment as possible; whereas others are used to either install or help jumpstart an install of a full distribution. Mini-CDs are available in a wide variety of sizes, such as 3" CD-Rs (or CD-RW) with sizes ranging from 185 to 210MB. You can also download an .iso image and create a Linux bootable business card, typically fitting on a 40 or 50MB credit card–sized CD-R (consider using a mini–CD-RW, especially if you want to upgrade your distribution often). Here are some links to these distributions:

  • http://www.lnx-bbc.org— Home page for the Linux BBC, a 40MB image hosting a rather complete live Linux session with X, a web browser, and a host of networking tools.

  • http://crux.nu/— Home page of the CRUX i686–optimized Linux distribution.

  • http://www.trustix.net/— Home page for the free version of the Trustix Secure Linux distribution, which currently uses the latest 2.4 kernel. Trustix is RPM based.

  • http://www.smoothwall.org/community/home/— The 22MB SmoothWall distribution, which easily fits on a bootable business card and is used to install a web-administered firewall, router, or gateway with SSH, HTTP, and other services.

  • http://www.phy.olemiss.edu/debian-cd/— A 185MB Debian 3.0 (Woody) distribution with enough software to bring up a working Debian system. X is not included, so you must download and install other packages to expand the system.

Floppy-Based Linux Distributions

  • http://www.linuxrouter.org— Home page for the Linux Router Project

  • http://floppix.ccai.com/index.html— A Debian-based floppy

  • http://www.toms.net/rb/— Tom's root and boot disk distribution

  • http://www.coyotelinux.com/— Secure routing and embedded Linux disk distributions

  • http://trinux.sourceforge.net— An ultra-secure Linux distribution on floppy

  • http://PenguinBackup.sourceforge.net/— A unique, floppy-based distribution that allows quick backup of your Palm-type PDA

Various Intel-Based Linux Distributions

Choosing a Linux distribution (distro) for an Intel-based PC is generally a matter of personal preference or need. Many Linux users prefer Red Hat's distro because of its excellent support, commercial support options, and widespread use around the world. However, many different Linux distributions are available for download. One of the best places to start looking for a new distro or new version of your favorite distro is http://www.distrowatch.com:

  • http://www.xandros.net— New home of the original and improved version of Corel's Debian-based Linux

  • http://www.debian.org— The Debian Linux distribution, consisting only of software distributed under the GNU GPL license

  • http://www.independence.seul.org— A newer Red Hat–based Linux distribution

  • http://www.libranet.com— A Linux distribution based on Debian

  • http://www.slackware.com— Home page for download of the newest version of one of the oldest Linux distributions, Slackware

  • http://www.suse.com— Home page for SuSE Linux, also available for the PowerPC

  • http://www.mandrakelinux.com— A Pentium-optimized, RPM-based distribution, originally based on Red Hat's Linux distribution

PowerPC-Based Linux Distributions

  • http://penguinppc.org/— Home page for the PowerPC GNU/Linux distribution

  • http://www.suse.com— SuSE PPC Linux; moving to UnitedLinux

  • http://www.yellowdoglinux.com— Home page for Terra Soft Solutions' Yellow Dog Linux for the PowerPC, which is based on Red Hat

Linux on Laptops and PDAs

One of the definitive sites for getting information about running Linux on your laptop is Kenneth Harker's Linux Laptop site. Although not as actively updated as in the past, this site (http://www.linux-laptop.net) still contains the world's largest collection of Linux and laptop information, with links to user experiences and details concerning specific laptop models.

Another site to check is Werner Heuser's Tuxmobil-Mobile Unix website at http://www.tuxmobil.org. You'll find links to information such as IrDA, Linux PDAs, and cell phones. Linux Zaurus PDA users can browse to http://www.openzaurus.org to download a complete open-source replacement operating system for the Zaurus 5000 and 5500 models.

The X Window System

Although much technical information is available on the Internet regarding the X Window System, finding answers to specific questions when troubleshooting can be problematic. If you are having a problem using X, first try to determine whether the problem is software or hardware related. When searching or asking for help (such as on Usenet's comp.os.linux.x newsgroup, which you can access through Google's Groups link; see the next section for other helpful Linux newsgroups), try to be as specific as possible. Some critical factors or information needed to adequately assess a problem include the Linux distribution in use; the kernel version used; the version of X used; the brand, name, and model of your video card; the names, brands, and models of your monitor and other related hardware.

This section lists just some of the basic resources for Linux XFree86 users. Definitive technical information regarding X is available from http://www.X.org:

  • http://www.lesstif.org/— Home page for the GPL'd OSF/Motif clone, LessTif

  • http://www.motifzone.net— Site for download of the open-source version of Motif for Linux, Open Motif

  • http://www.rahul.net/kenton/index.shtml— Ken Lee's X and Motif website with numerous links to tutorial, development, and other information about X

  • http://www.xfree86.org— Home page for The XFree86 Project, developers of XFree86, used with Red Hat Linux

  • http://www.xig.com/— Home page for a commercial version of X for Linux (along with other software products)


Usenet Newsgroups

Linux-related Usenet newsgroups are another good source of information if you're having trouble using Linux. (Refer to Chapter 28, "News Servers and Mailing Lists," for more information about using newsgroups.) If your ISP does not offer a comprehensive selection of Linux newsgroups, you can browse to http://groups.google.com/.

The primary Linux and Linux-related newsgroups are

  • alt.os.linux.dial-up— Using PPP for dial-up

  • alt.os.linux.mandrake— All about Mandrake Linux

  • alt.os.linux.redhat— Alternative discussions about Red Hat Linux

  • alt.os.linux.slackware— Using Slackware Linux

  • alt.os.linux.suse— Using SuSE Linux

  • comp.os.linux.admin— Administering Linux

  • comp.os.linux.advocacy— Heated discussions about Linux and other related issues

  • comp.os.linux.alpha— Using Linux on the Alpha CPU

  • comp.os.linux.announce— General Linux announcements

  • comp.os.linux.answers— Releases of new Linux FAQs and other information

  • comp.os.linux.development.apps— Using Linux development tools

  • comp.os.linux.development.system— Building the Linux kernel

  • comp.os.linux.embedded— Linux embedded device development

  • comp.os.linux.hardware— Configuring Linux for various hardware devices

  • comp.os.linux.help— Help with Linux

  • comp.os.linux.m68k— Linux on Motorola's 68K-family CPUs

  • comp.os.linux.misc— Miscellaneous Linux topics

  • comp.os.linux.networking— Networking and Linux

  • comp.os.linux.portable— Using Linux on laptops

  • comp.os.linux.powerpc— Using PPC Linux

  • comp.os.linux.questions— Questions about Linux

  • comp.os.linux.redhat— All about Red Hat Linux

  • comp.os.linux.security— Linux security issues

  • comp.os.linux.setup— Linux installation topics

  • comp.os.linux.x— Linux and the X Window System

  • comp.windows.x.apps— Using X-based clients

  • comp.windows.x.i386unix— X for Unix PCs

  • comp.windows.x.intrinsics— X Toolkit library topics

  • comp.windows.x.kde— Using KDE and X discussions

  • comp.windows.x.motif— All about Motif programming

  • comp.windows.x— Discussions about X

  • linux.admin.*— Two newsgroups for Linux administrators

  • linux.debian.*— 30 newsgroups about Debian

  • linux.dev.*— 25 or more Linux development newsgroups

  • linux.help— Get help with Linux

  • linux.kernel— The Linux kernel

  • linux.redhat.*— Red Hat-based discussions: linux.redhat.announce, linux.redhat.list, linux.redhat.applixware, linux.redhat.misc, linux.redhat.devel, linux.redhat.pam, linux.redhat.development, linux.redhat.ppp, linux.redhat.digest, linux.redhat.rpm, linux.redhat.install, linux.redhat.sparc, linux.redhat.axp

Fedora Usenet Newsgroups

By the time you read this, you might find that Fedora-related newsgroups have been voted on and formed, perhaps with names beginning with linux.fedora.*.


Mailing Lists

Mailing lists are interactive or digest-form electronic discussions about nearly any topic. To use a mailing list, you must generally send an email request to be subscribed to the list, and then verify the subscription with a return message from the master list mailer. After subscribing to an interactive form of list, each message sent to the list will appear in your email inbox. However, many lists provide a digest form of subscription in which a single- or half-day's traffic is condensed in a single message. The digest form is generally preferred unless you have set up electronic mail filtering (Chapter 28 also discusses the use of mailing lists in Fedora Core).

The main Fedora Project mailing lists are detailed here, but there are quite a few Linux-related lists. Red Hat's offerings are also provided here. You can search for nearly all online mailing lists by using a typical mailing list search web page, such as the one at http://www.lsoft.com/lists/list_q.html.

GNOME and KDE Mailing Lists

GNOME users and developers should know that more than two dozen mailing lists are available through http://mail.gnome.org/. KDE users will also benefit by perusing the KDE-related mailing lists at http://www.kde.org/mailinglists.html.

Fedora Project Mailing Lists

The Fedora Project is still in its infancy at the time of this writing. You will find many other knowledgeable users with answers to your questions by participating in one of Fedora's mailing lists. The lists are focused on using, testing, and developing and participating in Fedora Core's development:

  • fedora-devel-list@redhat.com— Developer information exchanges

  • fedora-docs-list@redhat.com— For Fedora users working on project documentation

  • fedora-list@redhat.com— Discussions among users of Fedora Core releases

  • fedora-test-list@redhat.com— Queries and reports from testers of Fedora Core test releases

Red Hat Mailing Lists

Red Hat provides a comprehensive archive and mailing list management web page at http://www.redhat.com/mailman/listinfo/. You can use this page to subscribe to one of more than 40 mailing lists related to Red Hat Linux. Some of the more pertinent lists are

  • redhat-announce-list— General announcements about Red Hat Linux

  • redhat-devel-list— Information for developers using Red Hat Linux

  • redhat-install-list— Installation issues about Red Hat Linux

  • redhat-list— A general Red Hat Linux discussion list

  • redhat-ppp-list— Issues regarding PPP and dial-up under Red Hat Linux

  • redhat-secure-server— Using Red Hat, Inc.'s secure server

  • redhat-watch-list— Announcements of bug fixes, updates for Red Hat Linux

  • rpm-list— Using the Red Hat Package Manager

  • under-the-brim— Red Hat's helpful electronic newsletter


Internet Relay Chat

Internet Relay Chat (IRC) is a popular form and forum of communication for many Red Hat Linux developers and users because it allows an interactive, real-time exchange of information and ideas. To use IRC, you must have an IRC client and the address of a network and server hosting the desired chat channel for your discussions.

You can use the irc.freenode.net IRC server, or one listed at http://www.freenode.net/ to chat with other Fedora Project users. Two current channels are

  • #fedora channel— General chat about Fedora

  • #fedora-devel— Hangout for a number of Fedora Project developers

One comprehensive list of active Linux-related IRC channels can be found at http://www.helsinki.fi/~rvaranka/Computer/Linux/IRC.shtml. To get help with getting started with IRC, browse to http://www.irchelp.org/. Some of the channels of interest might be

  • #linux— General discussions about Linux

  • #linuxhelp— A help chat discussion for new users

Most IRC networks provide one or more Linux channels, although some providers require sign up and registration before you can access any chat channel.