|
|
Guide to Red Hat Linux
Whether you're a Linux newbie looking for goof-proof
installation tips or a Red Hat veteran who wants the scoop
on the latest networking, desktop, and server enhancements,
this authoritative guide delivers all the information you
need to make the most of Red Hat Linux 7.2. From customizing
a desktop to troubleshooting a network or setting up a Web
server, it's the only reference you'll ever need to become a
Red Hat Linux pro.
Inside, you'll find complete coverage of Red Hat Linux:
_ Take advantage of expert tips for fast, painless
installation
_ Learn your way around the Linux shell, file system, and X
Window system
_ Master Linux administration, from automating system tasks
to locking in security
_ Discover how easy it is to set up a LAN and connect to the
Internet
_ Find expert help on tracking down and fixing typical
problems
_ Get the scoop on configuring servers, from Web and print
servers to e-mail and FTP servers
|
|
Chapter 1: An Overview Of Red
Hat Linux
Linux is a free computer
operating system that was created by Linus Torvalds in 1991
and that has grown from contributions from software
developers all over the world. Red Hat Linux is a
distribution of Linux that packages together the software
needed to run Linux and makes it easier to install and run.
Features in Red Hat Linux include a simplified installation
procedure, Red Hat Package Management (RPM) tools for
managing the software, and easy-to-use Gnome and KDE desktop
environments. You can get Red Hat Linux from the Internet,
from distributions that come with books such as this one, or
from a commercially available boxed set of Red Hat Linux
software. Linux is based on a culture of free exchange of
software. Linux’s roots are based in the UNIX operating
system. UNIX provided most of the framework that was used to
create Linux. That framework came in the form of the POSIX
standard, which defined the interfaces a UNIX system needs
to support in order to be a UNIX system.
|
|
Chapter 2: Installing Red Hat
Linux
Installing Linux is not
nearly the adventure it once was. Precompiled binary
software and preselected packaging and partitions can make
most Red Hat Linux installations a simple proposition. This
type of installation has made entering the Linux arena more
possible for computer users who are not programmers. Besides
providing some step-by-step installation procedures, this
chapter discussed some of the trickier aspects of Red Hat
Linux installation. In particular, ways of partitioning your
hard disk, creating installation boot disks, and changing
the boot procedure were described. The chapter also
discussed how to reconfigure and install a new kernel.
|
|
Chapter 3: Getting To Know
Red Hat Linux
Working from a shell
command-line interpreter within Red Hat Linux may not be as
simple as using a GUI, but it offers many powerful and
flexible features. This chapter describes how to log in to
Red Hat Linux and work with shell commands. Features for
running commands include recalling commands from a history
list, completing commands, and joining commands in various
ways. This chapter describes how shell environment variables
can be used to store and recall important pieces of
information. It also teaches you to modify shell
configuration files to tailor the shell to suit your needs.
Finally, the chapter describes how to use the Red Hat Linux
file system to create files and directories, understand
permissions, and work with files (moving, copying, and
removing them).
|
|
Chapter 4: Working With The
Desktop
The X Window System provides
the basis for most graphical user interfaces available for
Red Hat and other Linux systems today. Although X provides
the framework for running and sharing applications, the
GNOME and KDE desktop environments, along with a window
manager, provide the look-and-feel of your desktop. Using
various configuration files and commands, you can change
nearly every aspect of your graphical environment.
Backgrounds can be assigned a single color or can be filled
with single or tiled graphic images. Menus can be changed or
enhanced. Multiple virtual workspaces can be used and
managed. There are also many settings associated with X
itself that you can use directly to change the behavior of
your desktop.
|
|
Chapter 5: Accessing And
Running Applications
Between applications written
directly for Linux and other UNIX systems, those that have
been ported to Linux, and those that can run in emulation,
there are hundreds of applications available that can be
used with Red Hat Linux. There are dozens of locations on
the Internet for downloading Linux applications, and many
more that can be purchased on CD. To simplify the process of
installing and managing your Linux applications, Red Hat
developed the Red Hat Package Manager (RPM). Using tools
developed for RPM, such as the rpm command, you can easily
install, remove, and do a variety of queries on Linux
packages that are in RPM format. Of the types of
applications that can run in Linux, those created for the X
Window System provide the greatest level of compatibility
and flexibility when used in Linux. However, using emulation
software, it is possible to run applications intended for
DOS, Windows 95/98, and Macintosh operating systems.
|
|
Chapter 6: Publishing With
Red Hat Linux
In recent times, modern
GUI-based publishing tools have augmented the text-based
publishing tools that have always been available with Red
Hat Linux (and other UNIX systems). Publishing tools that
come with Red Hat Linux include Groff (which implements
traditional troff/nroff text processing) and LaTeX (a TeX
macro interface that is particularly suited for scientific
and mathematical publishing). In recent years, DocBook, an
SGML-based data type definition, has become the standard for
producing documentation of Linux and other software
projects. Along with Red Hat Linux’s growing popularity,
more commercial publishing applications have appeared that
work with Red Hat Linux. Anyware Office and Star Office are
two application suites that provide powerful publishing
features in Linux. The popular WordPerfect word processor
has also been ported to Linux. Although you do have to pay
for Anyware Office and WordPerfect, their prices are
reasonable (especially when measured against comparable MS
Windows applications). Red Hat Linux does include one free
word processor: AbiWord. Though AbiWord isn't up to the
level of the best commercial word processors, it does have
good, basic features and potential for the future. To create
and manage graphics, Red Hat Linux comes with applications
like GIMP, xv, and xpaint. Each of these applications
enables you to input and output graphics files from a
variety of formats. There is also an interface to scanners
called Scanner Access Now Easy (SANE). With SANE, a variety
of applications can access scanner devices, and the devices
can be shared across a network.
|
|
Chapter 7: Playing Games With
Red Hat Linux
While Red Hat Linux has not
yet become a dominant gaming platform, there are still
plenty of games running on Red Hat Linux that you can spend
your time on. Old UNIX games that have made their way to
Linux include a variety of text-based and X Window-based
games. There are card games, strategy games, and some action
games. For games that were intended for certain gaming
consoles and arcade machines, the xmame emulator provides an
environment within the Linux system in which those games
could be played. Hundreds of game ROMs are available on the
Internet, although copyright laws restrict what you can
legally download and use. On the commercial front,
Civilization: Call to Power for Linux, Myth II, and Quake
III Arena are available to use on your Red Hat Linux system.
Most of these games offer excellent graphics and animation,
but they require certain video cards and drivers to work
effectively.
|
|
Chapter 8: Multimedia In Red
Hat Linux
Getting your Red Hat Linux
system set up for sound and video can take some doing, but
once it’s done you can play most audio and video content
that is available today. This chapter took you through the
steps of setting up and troubleshooting your sound card.
When that was done, you learned how to find software to play
music through that card. Video players, such as Xanim, were
described for playing video clips in Red Hat Linux. The
chapter also covered how to get the RealPlayer from Real
Networks so you can draw from the large pool of RealMedia
content available on the Web. To download images from a
digital camera, the gPhoto window was described. If your
computer has a CD burner, use descriptions in this chapter
to create your own music CDs and CD labels. The chapter
described a few plug-ins that you can add to your Netscape
browser to play some types of multimedia content as you
browse the Web. Finally, it described the current state of
DVD and VRML content in Linux.
|
|
Chapter 9: Tools For Using
The Internet And The Web
Most use of the World Wide
Web centers on the Web browser. Over your existing Internet
connection, the browser lets you indicate Web pages and
other content that you want to access using addresses
referred to as URLs (Uniform Resource Locators). Mozilla and
Netscape are the most popular browsers with Red Hat and
other Linux systems, and are accessible from a button on
your desktop. E-mail is probably the Internet application
that is used most. The e-mail program that comes with
Mozilla, called Mozilla Mail, integrates well with the
Mozilla browser and provides most everything needed for
reading, sending, and managing your mail. There are several
traditional UNIX mail programs available with Red Hat Linux
as well, including elm, pine, and mail. To read newsgroups,
you can use Netscape Messenger. Text-based newsreaders are
also available. To pass data around freely between trusted
hosts, you can use a set of commands sometimes referred to
as “r” commands. The rlogin command lets you log in to other
computers over the network. With the rcp command, you can
copy one file, many files, or a whole directory structure of
files among computers on the network. The rsh command lets
you run programs on different computers on a network and
direct the output to the local computer or to a remote
computer. Commands such as telnet (for remote login) and ftp
(for remote file copying) are also available with Red Hat
Linux.
|
|
Chapter 10: Understanding
System Administration
Even though you may be using
Red Hat Linux as a single-user system, many of the tasks you
must do to keep your computer running are defined as
administrator tasks. A special user account called the root
user is needed to do many of the things necessary to keep
Linux working as you would like it to. If you are
administering a Linux system that is used by lots of people,
the task of administration becomes even larger. You need to
be able to add and support users, maintain the file systems,
and make sure that system performance serves your users
well. To help the administrator, Linux comes with a variety
of command-line utilities and graphical windows for
configuring and maintaining your system. The linuxconf
program contains dozens of configuration and control tasks
for everything from network configuration to user setup to
run level management tools. The kudzu program can be used to
probe and reconfigure Red Hat Linux when you add or remove
hardware. Commands such as mkfs and mount let you create and
mount file systems, respectively. Tools like top, gtop, and
vmstat let you monitor system performance.
|
|
Chapter 11: Setting Up And
Supporting Users
It is not uncommon for a Red
Hat Linux system to be used as a single-task server with no
actual users. It sits quietly in a server room, serving Web
pages or handling domain name service, never crashing, and
rarely needing attention. This is not always the case,
however. You may have to support users on your Red Hat Linux
server, and that can be the most challenging part of your
system-administration duties. Red Hat Linux provides a
variety of tools that help you with your administrative
chores. The useradd, usermod, and userdel commands enable
easy command-line manipulation of user account data.
Furthermore, creating a support mailbox and building shell
scripts to automate repetitive tasks lightens your load even
more. Red Hat Linux builds on top of the rich history of
UNIX and provides an ideal platform to support the diverse
needs of your users.
|
|
Chapter 12: Automating System
Tasks
Shell scripts are an integral
part of the Red Hat Linux system for configuring, booting,
administering, and customizing Red Hat Linux. They are used
to eliminate typing repetitive commands. They are frequently
executed from the scheduling facilities within Red Hat
Linux, allowing much flexibility in determining when and how
often a process should run. And they control the start-up of
most daemons and server processes at boot time. The init
daemon and its configuration file, /etc/inittab, also factor
heavily in the initial start-up of your Red Hat Linux
system. They implement the concept of run levels that is
carried out by the shell scripts in /etc/rc.d/init.d, and
they provide a means by which the machine can be shut down
or rebooted in an orderly manner. To have shell scripts
configured to run on an ongoing basis, you can use the cron
facility. Cron jobs can be added by editing cron files
directly or by running commands such as at and batch to
enter the commands to be run.
|
|
Chapter 13: Backing Up And
Restoring Files
It may take some work to put
a proper backup schedule in place, but the effort is well
worth it. Hopefully, you will never experience a major hard
drive crash, but if you ever do, the effort of making
backups will repay itself many times over. Think of it as an
insurance policy. You hope to never use it, but you’re glad
you have it when disaster strikes. A variety of low-cost
backup hardware is available to use with your Red Hat Linux
system. The traditional tape drive is an excellent choice
for backing up large amounts of data. If long-term archiving
of data is needed, a writable CD drive is a good choice. If
minimizing downtime is your main concern, mirroring data to
a second hard drive is another smart choice. Whatever backup
strategy you choose to use with your Red Hat Linux system,
be sure to choose one, and stick with it. You have invested
a lot of time creating your data. Invest a little more to
keep it safe.
|
|
Chapter 14: Computer Security
Issues
With the rise of the
Internet, security has become a critical issue for nearly
all computer users. The Red Hat Linux operating system is a
powerful tool that can help you get the most out of the
Internet, but care must be taken to prevent break-ins by
crackers. Proper use of password security in Red Hat Linux
is critical, as is proper configuration of the various
network services. Understanding system log files so that you
can recognize a cracker attack is another important part of
defending your system from crackers. In general, knowledge
is your most important tool. Learn everything you can about
how your Linux system works and where the vulnerabilities
are. And remember, good security is not a one-time job; it
is an ongoing process that requires constant vigilance. Take
advantage of the many great security tools that are
available on the Internet. Applications such as Crack,
Tiger, and Tripwire can help you keep your system secure.
Run them periodically to make sure your system stays secure.
Logcheck and PortSentry are software packages produced by
Psionic Software, Inc., to help protect your Red Hat Linux
system from intrusions from the network. The Logcheck
package scans your system logs for messages that may
represent break-in attempts. PortSentry takes an active
approach to protecting your system by monitoring ports and
responding in a variety of ways to those who try to
improperly access those ports. Subscribe to the CERT and
CIAC mailing lists and install security-related patches as
soon as they become available. It is better to spend a few
minutes upgrading a system program than to spend many hours
rebuilding an entire server.
|
|
Chapter 15: Setting Up A
Local Area Network
Red Hat Linux is at its best
when it is connected to a network. Configuring a LAN enables
you to share resources with other computers in your home or
organization. These resources can include files, printers,
CD-ROM drives, and backup media. This chapter describes how
to create a LAN with a Red Hat Linux system being used on
one of the computers on that LAN. It helps you determine the
kind of equipment you need to obtain, and the layout
(topology) of the network. On the Red Hat Linux side, you
learned about choosing and installing Ethernet cards (also
called NICs). You also learned to configure TCP/IP so that
you can later employ a variety of TCP/IP tools to use the
network. If something isn’t working with your Red Hat Linux
interface to the LAN, you can use utilities such as ifconfig
to check that your Ethernet interface is configured and
running properly. You can also check that Linux found and
installed the proper driver for your Ethernet card. After an
Ethernet interface is working, you can use the Ethereal
window to monitor the packets coming and going across the
interface between your computer and the network.
|
|
Chapter 16: Connecting To The
Internet
Connecting to the Internet
opens a whole world of possibilities for your Red Hat Linux
computer. Using Red Hat Linux as a Web server, mail server,
or FTP server depends on Red Hat Linux’s capability to
connect to the Internet. Likewise, if your computers are
already connected together in a LAN, adding an Internet
connection can provide Internet access to everyone on the
LAN in one stroke. Descriptions of how Internet domains are
organized built on discussions of IP addresses in the
previous chapter. Creating dial-up connections to the
Internet focused on descriptions of the PPP protocol.
Debugging methods were also described. For connecting your
LAN to the Internet, several different techniques were
discussed. You can set up your Red Hat Linux computer as a
router. The Red Hat Linux router either can route packets
from computers on your network that have valid IP addresses
or can use a special packet-forwarding technique so that
computers with private IP addresses can use the Internet.
This technique is referred to as IP masquerading. Finally,
the last section described how to set up Red Hat Linux as a
proxy server. Using Red Hat Linux as a proxy server with the
Squid proxy server software, you can save client computers
from having to set up DNS and other information themselves.
Each client simply has to identify the proxy server to the
Web browser to be capable of using that server to gain
access to the Internet.
|
|
Chapter 17: Setting Up A
Print Server
Sharing printers is an
economical and efficient way to use your organization’s
printing resources. A centrally located printer can make it
easier to maintain a printer, while still allowing everyone
to get his or her printing jobs done. Printer configuration
is done with the printconf-gui tool. Printers configured
with that tool can be printed using the lpr command. A
variety of filters make it possible to print to different
kinds of printers, as well as to printers that are connected
to computers on the network. Besides being able to set up
your computer as a Red Hat Linux print server, you can also
have your computer emulate a NetWare or an SMB (Windows 9x)
print server. After your network is configured properly and
a local printer is installed, sharing that printer over the
network as a UNIX, NetWare, or SMB print server is not very
complicated.
|
|
Chapter 18: Setting Up A File
Server
By providing centralized file
servers, an organization can efficiently share information
and applications with people within the organization, with
customers, or with anyone around the world. Several
different technologies are available in Red Hat Linux to
enable you to make your Red Hat Linux computer a file
server. The Network File System (NFS) protocol was one of
the first file server technologies available. It is
particularly well suited for sharing file systems among Red
Hat Linux and other UNIX systems, although you can also
access NFS file systems from Windows 9x operating systems if
those systems are configured to do so. NFS uses standard
mount and umount commands to connect file systems into the
directory structures of client computers. The Samba software
package that comes with Red Hat Linux contains protocols and
utilities for sharing files and printers among Windows and
OS/2 operating systems. It uses SMB protocols that are
included with all Microsoft Windows systems, and therefore
provide a convenient method of sharing resources on LANs
containing many Windows systems. NetWare was once the
dominant network operating system used on LANs. It provided
file- and printer-sharing services for networked PCs,
although in recent years it has branched out to offer a
variety of network services. With the mars_nwe package, you
can provide basic NetWare file and print services from your
Red Hat Linux computer. With the ncpfs package, you can also
use many NetWare client services to query NetWare servers
and use NetWare file systems and printers.
|
|
Chapter 19: Setting Up A Mail
Server
Installing a mail server in
Red Hat Linux is the easy part; it’s the configuration that
takes patience, resolve, and a fair bit of experimentation.
Even though it may be considerably faster and easier to
utilize the m4 macros, eventually you’ll need to edit the
sendmail.cf file. Just hope that it’s not the rewriting
rules that need editing. Sooner or later, an alias
definition in /etc/aliases will become unmanageable. At this
point, mailing list software can provide the flexibility
necessary to manage a large distribution list, with the
added benefits of archiving, moderation, digesting, and
automated administration.
|
|
Chapter 20: Setting Up An FTP
Server
The FTP service is the
primary method of offering archives of document and software
files to users over the Internet and other TCP/IP networks.
The FTP package that is delivered with Red Hat Linux
(wu-ftpd) contains a full set of features that enable you to
set up and maintain your own FTP server. The FTP server
package centers on the ftp daemon process (ftpd, which is
run in Red Hat Linux as in.ftpd by the xinetd daemon), which
services connection requests to your FTP server.
Configuration of features is done in the /etc/ftpaccess
file. A wide range of features are available with the
ftpaccess file that enable you to control who can access
your server, which areas of your file system they can
access, and how they can access them (incoming transfers,
outgoing transfers, deleting files, renaming files, and so
on). To check out your FTP server once it is set up, you can
use several different tools. The ftp command is available
with Linux and with any other UNIX system. For a more
graphical interface, there is the gFTP window. To access
your FTP site as most others will access it, you can type
the URL of your FTP site in the location box of your browser
window. (You can even add FTP user and password information
to the location of the FTP site.)
|
|
Chapter 21: Setting Up A Web
Server
Web servers are responsible
for storing and delivering the vast amount of content that
is available on the World Wide Web to clients all over the
world. Although several software packages are available for
Red Hat Linux, the most popular (and the one that comes with
Red Hat Linux) is the Apache Web server. This chapter
describes how to install, configure, and run an Apache
server in Red Hat Linux. The httpd daemon process handles
requests for Web content (HTTP). Configuration files define
what content is made available and how it can be accessed.
In particular, the /etc/httpd/conf/httpd.conf file is used
to configure the server. The apache package also includes
facilities for logging error and transfer messages. You can
look for the access_log and error_log files in the
/etc/httpd/logs directory. The access_log file contains
information on content requests that have been serviced by
the server. The error_log file contains listings of error
conditions that have occurred and times when service has
been denied.
|
|
Chapter 22: Setting Up A News
Server
Setting up a news server can
be a complex task. In general, it is a task that should be
avoided for most organizations in which only a few users
need to access news. (In this case, get access to your ISP’s
server if you can.) If, however, you decide that you want to
go ahead and build your own news server, the InterNetNews
(INN) package comes with Red Hat Linux and is ready to use.
Being the administrator of a news server requires that you
perform several tasks. The most important file to configure
is the inn.conf file (probably located in /etc/news). Many
of the basic INN options are set up in that file. In
addition to setting up inn.conf, you need to configure which
hosts you get your news feed from and which hosts you feed
your users' article to. An initial task with INN is to
choose and configure a storage method for the articles on
your server. The traditional method is to store files in
spool directories that are associated with each newsgroup.
The timehash storage method enables you to gather news
articles based on when they were received (making it easier
to enforce policies on how long articles should be kept).
The cnfs storage method lets you create buffer files and
have them store the articles (rotating out articles when the
buffers are full).
|
|
Chapter 23: Setting Up Boot
Servers - DHCP And NIS
DHCP and NIS both provide
mechanisms for centrally administering computers on your
network. DHCP can provide information that helps client
computers get up and running quickly on the network. NIS
lets you distribute a wide range of configuration
information among Linux and UNIX systems. DHCP is used to
provide information about your network to Windows, Linux,
Mac, or other client computers on your network. IP addresses
can be assigned dynamically, meaning they are distributed
from a pool of IP addresses. Or specific addresses can be
assigned to clients, based on specific Ethernet hardware
addresses. You can configure Red Hat Linux as an NIS client,
an NIS master server, or an NIS slave server. An NIS client
can take advantage of shared information from an NIS server.
The NIS master server builds the databases of information
(called maps) and enables access to those maps from the
network. Optional NIS slave servers can be used to maintain
copies of the NIS maps, enabling NIS service to continue on
the network in the event that the NIS master server goes
down.
|
|
Chapter 24: Setting Up A
Mysql Database Server
MySQL is a Structured Query
Language (SQL) server that runs on Red Hat Linux, as well as
other operating systems. Using a start-up script
(/etc/init.d/mysqld) and a configuration file (/etc/my.cnf),
you can quickly get a MySQL server up and running. With
tools such as the mysqladmin and mysql commands, you can
administer the MySQL server and create databases and tables
that are as simple or complex as you need. During mysql
sessions, you can modify the structure of your database
tables or add, update, or delete database records. You have
a variety of options for querying data and sorting the
output. You also have a lot of control over who can access
your database tables and what privileges users have to
modify, add to, or delete from the databases you control.
|
|
Chapter 25: Building A
Wireless Linux LAN
A wireless LAN can offer an
effective way of extending your network to areas that are
difficult or expensive to reach with wired connections.
Using low-cost wireless LAN cards, you can create
peer-to-peer or point-to-point networks. Add Red Hat Linux
systems as one or more of your wireless nodes and you can
use powerful security, routing, and monitoring tools to
further expand and secure your network. You can control your
wireless LAN card in Red Hat Linux by passing options to the
card's module at start-up time. Once the interface is
running, you can use the iwconfig command to change wireless
settings, either from the command line or by adding iwconfig
options to a configuration file so they are loaded
automatically.
|
|
Chapter 26: Getting Red Hat
Linux “Up2date”
The chore of keeping your Red
Hat Linux system upgraded with the latest bug fixes,
security patches, and enhancements has been simplified
greatly with Red Hat’s up2date tool. Using up2date, you can
automatically check for updates, download updated packages
to your computer, and install them. By registering your
system with the Red Hat Network, you can take advantage of
services that let you manage your computers and track
updates. You can receive free automatic upgrades for the
first computer you register; updates for subsequent
computers involve a fee. Chris Negus has been working with
UNIX systems, the Internet, and (more recently) Linux
systems for more than two decades. During that time, Chris
worked at AT&T Bell Laboratories, UNIX System Laboratories,
and Novell, helping to develop the UNIX operating system.
Features from many of the UNIX projects Chris worked on at
AT&T have found their way into Red Hat and other Linux
systems. During the past few years, Chris has written
several books on UNIX and the Internet, including Caldera
OpenLinux Bible, Internet Explorer 4 Bible, and Netscape
Plug-ins For Dummies for Hungry Minds (formerly IDG Books
Worldwide). He also co-wrote several books for Que
Corporation, including The Complete Idiot’s Guide to
Networking (second and third editions) and Using UNIX
(second edition). Chris’s other writings include articles
for Internet World, NetWare Connection, and Visual Developer
magazines. At home, Chris enjoys spending time with his
wife, Sheree, and his boys, Caleb and Seth. His hobbies
include soccer, singing, and exercising with Sheree.
|
|