Red Hat Enterprise Linux 6 Administration PDF
Document Details
Uploaded by TruthfulSphene
Sander van Vugt
Tags
Related
- Red Tag/Yellow Tag Issue and Removal PDF
- FIDIC Conditions of Contract for Construction 1989 PDF
- FIDIC 1989 General Conditions of Contract for Construction PDF
- FIDIC Conditions of Contract for Construction PDF
- Chapter 1: Getting Started with Red Hat Enterprise Linux PDF
- Week 02 - Red Hat Linux Oct 2023 v3.3 PDF
Summary
This book, "Red Hat Enterprise Linux 6 Administration", is a technical guide aimed at administrators. It provides practical, real-world skills using the Red Hat Enterprise Linux platform.
Full Transcript
flast.indd xviii 1/8/2013 10:40:14 AM Red Hat ® Enterprise Linux 6 ® Administration Real World Skills for Red Hat Administrators Sander van Vugt ffirs.indd...
flast.indd xviii 1/8/2013 10:40:14 AM Red Hat ® Enterprise Linux 6 ® Administration Real World Skills for Red Hat Administrators Sander van Vugt ffirs.indd i 1/8/2013 10:39:59 AM Senior Acquisitions Editor: Jeff Kellum Development Editor: Gary Schwartz Technical Editors: Floris Meester, Erno de Korte Production Editor: Rebecca Anderson Copy Editor: Kim Wimpsett Editorial Manager: Pete Gaughan Production Manager: Tim Tate Vice President and Executive Group Publisher: Richard Swadley Vice President and Publisher: Neil Edde Book Designer: Judy Fung and Bill Gibson Proofreaders: Louise Watson and Jennifer Bennett, Word One New York Indexer: J & J Indexing Project Coordinator, Cover: Katherine Crocker Cover Designer: Ryan Sneed Cover Image: © Jacob Wackerhausen / iStockPhoto Copyright © 2013 by John Wiley & Sons, Inc., Indianapolis, Indiana Published simultaneously in Canada ISBN: 978-1-118-30129-6 ISBN: 978-1-118-62045-8 (ebk.) ISBN: 978-1-118-42143-7 (ebk.) ISBN: 978-1-118-57091-3 (ebk.) No part of this publication may be reproduced, stored in a retrieval system or transmitted in any form or by any means, electronic, mechanical, photocopying, recording, scanning or otherwise, except as permitted under Sections 107 or 108 of the 1976 United States Copyright Act, without either the prior written permission of the Publisher, or authorization through payment of the appropriate per-copy fee to the Copyright Clearance Center, 222 Rosewood Drive, Danvers, MA 01923, (978) 750-8400, fax (978) 646-8600. Requests to the Publisher for permission should be addressed to the Permissions Department, John Wiley & Sons, Inc., 111 River Street, Hoboken, NJ 07030, (201) 748-6011, fax (201) 748-6008, or online at http://www.wiley.com/go/permissions. Limit of Liability/Disclaimer of Warranty: The publisher and the author make no representations or warranties with respect to the accuracy or completeness of the contents of this work and specifically disclaim all warranties, including without limitation warranties of fitness for a particular purpose. No warranty may be created or extended by sales or promotional materials. The advice and strategies contained herein may not be suitable for every situation. This work is sold with the understanding that the publisher is not engaged in rendering legal, accounting, or other professional services. If professional assistance is required, the ser- vices of a competent professional person should be sought. Neither the publisher nor the author shall be liable for damages arising herefrom. The fact that an organization or Web site is referred to in this work as a citation and/or a potential source of further information does not mean that the author or the publisher endorses the information the organization or Web site may provide or recommendations it may make. Fur- ther, readers should be aware that Internet Web sites listed in this work may have changed or disappeared between when this work was written and when it is read. For general information on our other products and services or to obtain technical support, please contact our Customer Care Department within the U.S. at (877) 762-2974, outside the U.S. at (317) 572-3993 or fax (317) 572-4002. Wiley publishes in a variety of print and electronic formats and by print-on-demand. Some material included with standard print versions of this book may not be included in e-books or in print-on-demand. If this book refers to media such as a CD or DVD that is not included in the version you purchased, you may download this material at http://booksupport.wiley.com. For more information about Wiley products, visit www.wiley.com. Library of Congress Control Number: 2012954397 TRADEMARKS: Wiley, the Wiley logo, and the Sybex logo are trademarks or registered trademarks of John Wiley & Sons, Inc. and/or its affiliates, in the United States and other countries, and may not be used without written permission. Red Hat is a registered trademark of Red Hat, Inc. Linux is a registered trademark of Linus Torvalds. All other trademarks are the property of their respective owners. John Wiley & Sons, Inc. is not associated with any product or vendor mentioned in this book. 10 9 8 7 6 5 4 3 2 1 ffirs.indd ii 1/8/2013 10:40:01 AM Dear Reader, Thank you for choosing Red Hat Enterprise Linux 6 Administration: Real World Skills for Red Hat Administrators. This book is part of a family of premium-quality Sybex books, all of which are written by outstanding authors who combine practical experience with a gift for teaching. Sybex was founded in 1976. More than 30 years later, we’re still committed to producing consistently exceptional books. With each of our titles, we’re working hard to set a new standard for the industry. From the paper we print on to the authors we work with, our goal is to bring you the best books available. I hope you see all that reflected in these pages. I’d be very interested to hear your com- ments and get your feedback on how we’re doing. Feel free to let me know what you think about this or any other Sybex book by sending me an email at [email protected]. If you think you’ve found a technical error in this book, please visit http://sybex.custhelp.com. Customer feedback is critical to our efforts at Sybex. Best regards, Neil Edde Vice President and Publisher Sybex, an Imprint of Wiley ffirs.indd iii 1/8/2013 10:40:01 AM To Florence, my loving wife of 20 years who supports me and believes in everything I do. Chérie, I’m looking forward to spending the next 60 years of our lives together. ffirs.indd iv 1/8/2013 10:40:02 AM About the Author Sander van Vugt is an author of more than 50 technical books. Most of these books are in his native language of Dutch. Sander is also a technical instructor who works directly for major Linux vendors, such as Red Hat and SUSE. He specializes in high availability and performance issues in Linux. He has also built up a lot of experience in securing serv- ers with SELinux, especially on platforms that don’t support it natively. Sander has applied his skills in helping many companies all over the world who are using Linux. His work has taken him to amazing places like Greenland, Utah, Malaysia, and more. When not working, Sander likes to spend time with his two sons, Franck and Alex, and his beautiful wife, Florence. He also likes outdoor sports, in particular running, hiking, kayaking, and ice-skating. During these long hours of participating in sports, he thinks through the ideas for his next book and the projects on which he is currently working, which makes the actual writing process a lot easier and the project go more smoothly. ffirs.indd v 1/8/2013 10:40:02 AM Acknowledgments Books of this size and depth succeed because of all the hard work put in by a team of pro- fessionals. I’m grateful for all the hard work put in by several people at Sybex on this proj- ect. Gary Schwartz was a great developmental editor. He helped keep things on track and provided excellent editorial guidance. The technical editors, Floris Meester and Erno de Korte, provided insightful input throughout the book. I appreciated the meticulous atten- tion to detail provided by Rebecca Anderson, the production editor for this book. Last, but certainly not least, I want to thank Jeff Kellum, the acquisitions editor, for having the faith in me to write this book for Sybex. ffirs.indd vi 1/8/2013 10:40:02 AM Contents at a Glance Introduction xxiii Part I Getting Familiar with Red Hat Enterprise Linux 1 Chapter 1 Getting Started with Red Hat Enterprise Linux 3 Chapter 2 Finding Your Way on the Command Line 41 Part II Administering Red Hat Enterprise Linux 67 Chapter 3 Performing Daily System Administration Tasks 69 Chapter 4 Managing Software 99 Chapter 5 Configuring and Managing Storage 121 Chapter 6 Connecting to the Network 155 Part III Securing Red Hat Enterprise Linux 187 Chapter 7 Working with Users, Groups, and Permissions 189 Chapter 8 Understanding and Configuring SELinux 229 Chapter 9 Working with KVM Virtualization 245 Chapter 10 Securing Your Server with iptables 269 Chapter 11 Setting Up Cryptographic Services 293 Part IV Networking Red Hat Enterprise Linux 313 Chapter 12 Configuring OpenLDAP 315 Chapter 13 Configuring Your Server for File Sharing 333 Chapter 14 Configuring DNS and DHCP 355 Chapter 15 Setting Up a Mail Server 375 Chapter 16 Configuring Apache on Red Hat Enterprise Linux 385 Part V Advanced Red Hat Enterprise Linux Configuration 411 Chapter 17 Monitoring and Optimizing Performance 413 Chapter 18 Introducing Bash Shell Scripting 467 ffirs.indd vii 1/8/2013 10:40:02 AM Chapter 19 Understanding and Troubleshooting the Boot Procedure 505 Chapter 20 Introducing High-Availability Clustering 529 Chapter 21 Setting Up an Installation Server 561 Appendix A Hands-On Labs 577 Appendix B Answers to Hands-On Labs 589 Glossary 607 Index 625 ffirs.indd viii 1/8/2013 10:40:02 AM Contents Introduction xxiii Part I Getting Familiar with Red Hat Enterprise Linux 1 Chapter 1 Getting Started with Red Hat Enterprise Linux 3 Linux, Open Source, and Red Hat 4 Origins of Linux 4 Distributions 5 Fedora 6 Red Hat Enterprise Linux and Related Products 7 Red Hat Enterprise Linux Server Edition 7 Red Hat Enterprise Linux Workstation Edition 8 Red Hat Add-Ons 8 Red Hat Directory Server 9 Red Hat Enterprise Virtualization 9 JBoss Enterprise Middleware 9 Red Hat Cloud 9 Installing Red Hat Enterprise Linux Server 9 Exploring the GNOME User Interface 33 Exploring the Applications Menu 34 Exploring the Places Menu 35 Exploring the System Menu 36 Summary 39 Chapter 2 Finding Your Way on the Command Line 41 Working with the Bash Shell 42 Getting the Best of Bash 42 Useful Bash Key Sequences 43 Working with Bash History 44 Performing Basic File System Management Tasks 45 Working with Directories 45 Working with Files 46 Piping and Redirection 50 Piping 50 Redirection 51 ftoc.indd ix 1/8/2013 10:38:40 AM x Contents Finding Files 55 Working with an Editor 56 Vi Modes 57 Saving and Quitting 57 Cut, Copy, and Paste 58 Deleting Text 58 Replacing Text 58 Using sed for the Replacement of Text 59 Getting Help 61 Using man to Get Help 61 Using the --help Option 65 Getting Information on Installed Packages 65 Summary 66 Part II Administering Red Hat Enterprise Linux 67 Chapter 3 Performing Daily System Administration Tasks 69 Performing Job Management Tasks 70 System and Process Monitoring and Management 72 Managing Processes with ps 73 Sending Signals to Processes with the kill Command 74 Using top to Show Current System Activity 76 Managing Process Niceness 80 Scheduling Jobs 82 Mounting Devices 83 Working with Links 87 Creating Backups 88 Managing Printers 89 Setting Up System Logging 91 Setting Up Rsyslog 92 Common Log Files 94 Setting Up Logrotate 96 Summary 98 Chapter 4 Managing Software 99 Understanding RPM 100 Understanding Meta Package Handlers 101 Creating Your Own Repositories 103 Managing Repositories 104 RHN and Satellite 106 Installing Software with Yum 109 Querying Software 115 Extracting Files from RPM Packages 118 Summary 119 ftoc.indd x 1/8/2013 10:38:40 AM Contents xi Chapter 5 Configuring and Managing Storage 121 Understanding Partitions and Logical Volumes 122 Creating Partitions 123 Creating File Systems 129 File Systems Overview 129 Creating File Systems 131 Changing File System Properties 132 Checking the File System Integrity 134 Mounting File Systems Automatically Through fstab 135 Working with Logical Volumes 139 Creating Logical Volumes 139 Resizing Logical Volumes 143 Working with Snapshots 146 Replacing Failing Storage Devices 149 Creating Swap Space 149 Working with Encrypted Volumes 151 Summary 154 Chapter 6 Connecting to the Network 155 Understanding NetworkManager 156 Working with Services and Runlevels 156 Configuring the Network with NetworkManager 158 Working with system-config-network 160 Understanding NetworkManager Configuration Files 161 Understanding Network Service Scripts 164 Configuring Networking from the Command Line 164 Troubleshooting Networking 169 Setting Up IPv6 173 Configuring SSH 174 Enabling the SSH Server 175 Using the SSH Client 177 Using PuTTY on Windows Machines 177 Configuring Key-Based SSH Authentication 178 Using Graphical Applications with SSH 181 Using SSH Port Forwarding 182 Configuring VNC Server Access 183 Summary 185 Part III Securing Red Hat Enterprise Linux 187 Chapter 7 Working with Users, Groups, and Permissions 189 Managing Users and Groups 190 Commands for User Management 190 Managing Passwords 192 ftoc.indd xi 1/8/2013 10:38:40 AM xii Contents Modifying and Deleting User Accounts 193 Behind the Commands: Configuration Files 194 Creating Groups 198 Using Graphical Tools for User and Group Management 201 Using External Authentication Sources 203 Understanding the Authentication Process 208 Understanding sssd 208 Understanding nsswitch 209 Understanding Pluggable Authentication Modules 210 Managing Permissions 212 Understanding the Role of Ownership 212 Basic Permissions: Read, Write, and Execute 214 Advanced Permissions 216 Working with Access Control Lists 220 Setting Default Permissions with umask 225 Working with Attributes 226 Summary 227 Chapter 8 Understanding and Configuring SELinux 229 Understanding SELinux 230 What Is SELinux? 231 Understanding the Type Context 231 Selecting the SELinux Mode 233 Working with SELinux Context Types 235 Configuring SELinux Policies 237 Working with SELinux Modules 238 Setting Up SELinux with system-config-selinux 239 Troubleshooting SELinux 239 Summary 244 Chapter 9 Working with KVM Virtualization 245 Understanding the KVM Virtualization Architecture 246 Red Hat KVM Virtualization 246 Red Hat Enterprise Virtualization 247 Preparing Your Host for KVM Virtualization 248 Installing a KVM Virtual Machine 249 Managing KVM Virtual Machines 255 Managing Virtual Machines with Virtual Machine Manager 256 Managing Virtual Machines from the virsh Interface 262 Understanding KVM Networking 263 Summary 268 ftoc.indd xii 1/8/2013 10:38:40 AM Contents xiii Chapter 10 Securing Your Server with iptables 269 Understanding Firewalls 270 Setting Up a Firewall with system-config-firewall 271 Allowing Services 272 Trusted Interfaces 275 Masquerading 275 Configuration Files 278 Setting Up a Firewall with iptables 279 Understanding Tables, Chains, and Rules 280 Understanding How a Rule Is Composed 280 Configuration Example 281 Advanced iptables Configuration 287 Configuring Logging 287 The Limit Module 289 Configuring NAT 289 Summary 292 Chapter 11 Setting Up Cryptographic Services 293 Introducing SSL 294 Proof of Authenticity: the Certificate Authority 295 Managing Certificates with openssl 296 Creating a Signing Request 302 Working with GNU Privacy Guard 302 Creating GPG Keys 303 Key Transfer 305 Managing GPG Keys 307 Encrypting Files with GPG 308 GPG Signing 310 Signing RPM Files 310 Summary 312 Part IV Networking Red Hat Enterprise Linux 313 Chapter 12 Configuring OpenLDAP 315 Understanding OpenLDAP 316 Types of Information in OpenLDAP 316 The LDAP Name Scheme 316 Replication and Referrals 317 Configuring a Base OpenLDAP Server 318 Installing and Configuring OpenLDAP 318 Populating the OpenLDAP Database 320 Creating the Base Structure 320 Understanding the Schema 323 Managing Linux Users and Groups in LDAP 326 ftoc.indd xiii 1/8/2013 10:38:40 AM xiv Contents Using OpenLDAP for Authentication 332 Summary 332 Chapter 13 Configuring Your Server for File Sharing 333 Configuring NFS4 334 Setting Up NFSv4 335 Mounting an NFS Share 337 Making NFS Mounts Persistent 338 Configuring Automount 338 Configuring Samba 342 Setting Up a Samba File Server 342 Samba and SELinux 345 Samba Advanced Authentication Options 346 Accessing Samba Shares 346 Offering FTP Services 348 File Sharing and SELinux 351 Summary 352 Chapter 14 Configuring DNS and DHCP 355 Understanding DNS 356 The DNS Hierarchy 356 DNS Server Types 357 The DNS Lookup Process 358 DNS Zone Types 359 Setting Up a DNS Server 359 Setting Up a Cache-Only Name Server 359 Setting Up a Primary Name Server 361 Setting Up a Secondary Name Server 368 Understanding DHCP 369 Setting Up a DHCP Server 370 Summary 374 Chapter 15 Setting Up a Mail Server 375 Using the Message Transfer Agent 376 Understanding the Mail Delivery Agent 377 Understanding the Mail User Agent 377 Setting Up Postfix as an SMTP Server 377 Working with Mutt 378 Basic Configuration 380 Internet Configuration 382 Configuring Dovecot for POP and IMAP 383 Further Steps 384 Summary 384 ftoc.indd xiv 1/8/2013 10:38:40 AM Contents xv Chapter 16 Configuring Apache on Red Hat Enterprise Linux 385 Configuring the Apache Web Server 386 Creating a Basic Website 386 Understanding the Apache Configuration Files 387 Apache Log Files 393 Apache and SELinux 393 Getting Help 395 Working with Virtual Hosts 396 Securing the Web Server with TLS Certificates 399 Configuring Authentication 404 Setting Up Authentication with.htpasswd 405 Configuring LDAP Authentication 406 Setting Up MySQL 407 Summary 409 Part V Advanced Red Hat Enterprise Linux Configuration 411 Chapter 17 Monitoring and Optimizing Performance 413 Interpreting What’s Going On: The top Utility 414 CPU Monitoring with top 415 Memory Monitoring with top 417 Process Monitoring with top 419 Analyzing CPU Performance 420 Understanding CPU Performance 421 Context Switches and Interrupts 421 Using vmstat 425 Analyzing Memory Usage 425 Page Size 425 Active vs. Inactive Memory 426 Kernel Memory 427 Using ps for Analyzing Memory 430 Monitoring Storage Performance 433 Understanding Disk Activity 434 Finding Most Busy Processes with iotop 438 Setting and Monitoring Drive Activity with hdparm 440 Understanding Network Performance 440 Optimizing Performance 446 Using a Simple Performance Optimization Test 447 CPU Tuning 449 Tuning Memory 451 Optimizing Interprocess Communication 453 ftoc.indd xv 1/8/2013 10:38:40 AM xvi Contents Tuning Storage Performance 455 Network Tuning 459 Optimizing Linux Performance Using cgroups 464 Summary 466 Chapter 18 Introducing Bash Shell Scripting 467 Getting Started 468 Elements of a Good Shell Script 468 Executing the Script 471 Working with Variables and Input 472 Understanding Variables 472 Variables, Subshells, and Sourcing 474 Working with Script Arguments 476 Asking for Input 480 Using Command Substitution 482 Substitution Operators 483 Changing Variable Content with Pattern Matching 485 Performing Calculations 489 Using Control Structures 491 Using if...then...else 493 Using case 496 Using while 498 Using until 499 Using for 500 Summary 503 Chapter 19 Understanding and Troubleshooting the Boot Procedure 505 Introduction to Troubleshooting the Boot Procedure 506 Configuring Booting with GRUB 507 Understanding the grub.conf Configuration File 507 Changing Boot Options 510 Using the GRUB Command Line 513 Reinstalling GRUB 514 GRUB behind the Scenes 514 Common Kernel Management Tasks 516 Analyzing Availability of Kernel Modules 517 Loading and Unloading Kernel Modules 518 Loading Kernel Modules with Specific Options 519 Upgrading the Kernel 521 Configuring Service Startup with Upstart 521 Basic Red Hat Enterprise Linux Troubleshooting 524 Summary 527 ftoc.indd xvi 1/8/2013 10:38:40 AM Contents xvii Chapter 20 Introducing High-Availability Clustering 529 Understanding High-Availability Clustering 530 The Workings of High Availability 530 High-Availability Requirements 531 Red Hat High-Availability Add-on Software Components 534 Configuring Cluster-Based Services 535 Setting Up Bonding 535 Setting Up Shared Storage 537 Installing the Red Hat High Availability Add-On 541 Building the Initial State of the Cluster 542 Configuring Additional Cluster Properties 546 Configuring a Quorum Disk 549 Setting Up Fencing 551 Creating Resources and Services 554 Troubleshooting a Nonoperational Cluster 558 Configuring GFS2 File Systems 559 Summary 560 Chapter 21 Setting Up an Installation Server 561 Configuring a Network Server As an Installation Server 562 Setting Up a TFTP and DHCP Server for PXE Boot 563 Installing the TFTP Server 564 Configuring DHCP for PXE Boot 565 Creating the TFTP PXE Server Content 565 Creating a Kickstart File 568 Using a Kickstart File to Perform an Automated Installation 568 Modifying the Kickstart File with system-config-kickstart 570 Making Manual Modifications to the Kickstart File 573 Summary 576 Appendix A Hands-On Labs 577 Appendix B Answers to Hands-On Labs 589 Glossary 607 Index 625 ftoc.indd xvii 1/8/2013 10:38:40 AM flast.indd xviii 1/8/2013 10:40:14 AM Table of Exercises Exercise 1.1 Installing Linux on Your Machine................................. 11 Exercise 2.1 Discovering the Use of Pipes..................................... 50 Exercise 2.2 Using grep in Pipes............................................. 51 Exercise 2.3 Redirecting Output to a File...................................... 51 Exercise 2.4 Using Redirection of STDIN...................................... 52 Exercise 2.5 Separating STDERR from STDOUT............................... 53 Exercise 2.6 Replacing Text with vi.......................................... 59 Exercise 2.7 Working with man -k............................................ 64 Exercise 3.1 Managing Jobs................................................ 71 Exercise 3.2 Managing Processes with ps and kill.............................. 75 Exercise 3.3 Using nice to Change Process Priority............................. 80 Exercise 3.4 Running a Task from cron....................................... 83 Exercise 3.5 Mounting a USB Flash Drive..................................... 86 Exercise 3.6 Creating Links................................................. 88 Exercise 3.7 Archiving and Extracting with tar................................. 89 Exercise 3.8 Configuring Logging............................................ 97 Exercise 4.1 Setting Up Your Own Repository................................ 103 Exercise 4.2 Working with yum............................................. 105 Exercise 4.3 Installing Software with yum................................... 115 Exercise 4.4 Finding More Information About Installed Software................ 118 Exercise 4.5 Extracting Files from RPM Packages............................. 119 Exercise 5.1 Creating Partitions............................................ 124 Exercise 5.2 Creating a File System......................................... 131 Exercise 5.3 Setting a File System Label..................................... 134 Exercise 5.4 Mounting Devices Through /etc/fstab............................ 137 Exercise 5.5 Fixing /etc/fstab Problems...................................... 138 Exercise 5.6 Creating LVM Logical Volumes.................................. 140 Exercise 5.7 Extending a Logical Volume.................................... 144 Exercise 5.8 Extending a Volume Group..................................... 145 Exercise 5.9 Reducing a Logical Volume..................................... 146 Exercise 5.10 Managing Snapshots.......................................... 147 Exercise 5.11 Creating a Swap File........................................... 150 Exercise 5.12 Creating an Encrypted Device................................... 152 flast.indd xix 1/8/2013 10:40:14 AM xx Table of Exercises Exercise 5.13 Mounting an Encrypted Device Automatically..................... 154 Exercise 6.1 Working with Services......................................... 157 Exercise 6.2 Configuring a Network Interface with ip.......................... 165 Exercise 6.3 Setting a Fixed IPv6 Address.................................... 174 Exercise 6.4 Enabling and Testing the SSH Server............................. 175 Exercise 6.5 Securing the SSH Server....................................... 176 Exercise 6.6 Setting Up Key-Based Authentication............................ 179 Exercise 6.7 Setting Up Key-Based SSH Authentication Protected with a Passphrase......................................... 181 Exercise 6.8 Setting Up a VNC Server....................................... 184 Exercise 7.1 Creating Users................................................ 198 Exercise 7.2 Creating and Managing Groups................................. 200 Exercise 7.3 Logging in Using an LDAP Directory Server....................... 205 Exercise 7.4 Configuring PAM.............................................. 211 Exercise 7.5 Setting Permissions for Users and Groups........................ 216 Exercise 7.6 Working with Special Permissions............................... 219 Exercise 7.7 Refining Permissions Using ACLs................................ 224 Exercise 8.1 Displaying SELinux Type Context................................ 232 Exercise 8.2 Switching Between SELinux Modes.............................. 234 Exercise 8.3 Applying File Contexts......................................... 236 Exercise 8.4 Working with SELinux Booleans................................. 238 Exercise 8.5 Enabling sealert Message Analysis.............................. 243 Exercise 9.1 Determining Whether Your Server Meets KVM Virtualization Requirements................................ 246 Exercise 9.2 Preparing Your Server to Function as a KVM Hypervisor............ 249 Exercise 9.3 Installing a KVM Virtual Machine................................ 250 Exercise 9.4 Working with Virtual Machine Manager.......................... 258 Exercise 9.5 Changing a VM Hardware Configuration.......................... 259 Exercise 9.6 Exploring virsh............................................... 262 Exercise 9.7 Changing Virtual Machine Networking........................... 264 Exercise 9.8 Reconfiguring Networking in a Virtual Machine.................... 267 Exercise 10.1 Allowing Basic Services Through the Firewall..................... 272 Exercise 10.2 Configuring Port Forwarding.................................... 277 Exercise 10.3 Building a Netfilter Firewall..................................... 282 Exercise 10.4 Setting Up iptables Logging.................................... 288 Exercise 10.5 Configuring NAT.............................................. 291 flast.indd xx 1/8/2013 10:40:14 AM Table of Exercises xxi Exercise 11.1 Creating a Self-signed Certificate................................ 298 Exercise 11.2 Creating and Exchanging GPG Keys.............................. 306 Exercise 11.3 Encrypting and Decrypting Files................................. 309 Exercise 11.4 Signing RPM Packages with GPG Keys........................... 311 Exercise 12.1 Changing the Base LDAP Configuration.......................... 319 Exercise 12.2 Creating the Base LDAP Directory Structure....................... 323 Exercise 12.3 Installing the Schema File for DHCP.............................. 324 Exercise 12.4 Creating an LDAP User......................................... 329 Exercise 12.5 Adding an LDAP Group........................................ 330 Exercise 13.1 Creating NFS Shares.......................................... 336 Exercise 13.2 Mounting an NFS Share........................................ 337 Exercise 13.3 Using /net to Access an NFS Share.............................. 339 Exercise 13.4 Creating an Automount Indirect Map............................. 340 Exercise 13.5 Creating an Automount Configuration for Home Directories......... 341 Exercise 13.6 Setting Up a Samba Server..................................... 344 Exercise 13.7 Setting SELinux Labels for Samba............................... 345 Exercise 13.8 Mounting a Samba Share Using /etc/fstab........................ 348 Exercise 13.9 Enabling an Anonymous FTP Server............................. 351 Exercise 14.1 Configuring a Cache-Only Name Server.......................... 360 Exercise 14.2 Setting Up a Primary DNS Server................................ 367 Exercise 14.3 Setting Up a DHCP Server...................................... 374 Exercise 15.1 Getting to Know Mutt.......................................... 378 Exercise 15.2 Sending a Message to an External User.......................... 379 Exercise 15.3 Opening Your Mail Server for External Mail....................... 381 Exercise 15.4 Creating a Base Dovecot Configuration........................... 383 Exercise 16.1 Creating a Basic Website....................................... 386 Exercise 16.2 Configuring SELinux for Apache................................. 394 Exercise 16.3 Installing and Using the Apache Documentation................... 396 Exercise 16.4 Configuring Virtual Hosts...................................... 397 Exercise 16.5 Setting Up an SSL-Based Virtual Host............................ 401 Exercise 16.6 Setting Up a Protected Web Server.............................. 406 Exercise 16.7 Installing MySQL and Creating User Accounts..................... 407 Exercise 17.1 Monitoring Buffer and Cache Memory........................... 418 Exercise 17.2 Analyzing CPU Performance.................................... 420 Exercise 17.3 Analyzing Kernel Memory...................................... 430 flast.indd xxi 1/8/2013 10:40:14 AM xxii Table of Exercises Exercise 17.4 Exploring I/O Performance..................................... 439 Exercise 17.5 Configuring Huge Pages....................................... 452 Exercise 17.6 Changing Scheduler Parameters................................ 458 Exercise 18.1 Creating Your First Shell Script.................................. 469 Exercise 18.2 Creating a Script That Works with Arguments..................... 476 Exercise 18.3 Referring to Command-Line Arguments in a Script................. 477 Exercise 18.4 Counting Arguments.......................................... 479 Exercise 18.5 Asking for Input with read...................................... 480 Exercise 18.6 Working with Pattern-Matching Operators........................ 485 Exercise 18.7 Applying Pattern Matching on a Date String....................... 488 Exercise 18.8 Example Script Using case..................................... 496 Exercise 18.9 Checking Whether the IP Address Is Still There.................... 499 Exercise 19.1 Adding a GRUB Boot Password................................. 509 Exercise 19.2 Booting with Alternative Boot Options........................... 512 Exercise 19.3 Manually Starting GRUB....................................... 513 Exercise 19.4 Applying Kernel Module Options................................ 521 Exercise 19.5 Starting Your Server in Minimal Mode............................ 525 Exercise 19.6 Resetting the Root Password................................... 526 Exercise 19.7 Starting a Rescue System...................................... 527 Exercise 20.1 Creating a Bond Device........................................ 536 Exercise 20.2 Creating an iSCSI Target Configuration........................... 538 Exercise 20.3 Connecting to an iSCSI Target.................................. 540 Exercise 20.4 Creating an /etc/hosts File...................................... 541 Exercise 20.5 Creating a Cluster with Conga................................... 542 Exercise 20.6 Creating a Quorum Disk........................................ 549 Exercise 20.7 Creating an HA Service for Apache.............................. 555 Exercise 20.8 Creating a GFS File System..................................... 559 Exercise 21.1 Setting Up the Network Installation Server........................ 562 Exercise 21.2 Configuring the TFTP Server for PXE Boot........................ 566 Exercise 21.3 Performing a Virtual Machine Network Installation Using a Kickstart File...................................... 569 flast.indd xxii 1/8/2013 10:40:15 AM Introduction Red Hat is the number-one Linux vendor on the planet. Even though official figures have never been released, as the fi rst open source, one-billion dollar company, Red Hat is quite successful in enterprise Linux. More and more companies are installing Red Hat servers every day, and with that, there’s an increasing need for Red Hat skills. That is why I wrote this book. This book is a complete guide that contains real-world examples of how Red Hat Enterprise Linux should be administered. It targets a broad audience of both beginning and advanced Red Hat Enterprise Linux administrators who need a reference guide to learn how to perform complicated tasks. This book was also written as a study guide, which is why there are many exercises included in the book. Within each chapter, you’ll fi nd step-by-step exercises that lead you through specific procedures. Also, in Appendix A at the end of the book, you’ll find lab exercises that help you wrap up everything you’ve learned in the chapter. Red Hat offers two certifications that are relevant for system administrators: Red Hat Certified System Administrator (RHCSA) and Red Hat Certified Engineer (RHCE). This book does not prepare for either the Red Hat RHCSA or RHCE exams, but it does cover most of the objectives of both exams. For those interested in taking RHCSA and RHCE exams, it is recommended that you also attend a Red Hat training course, where the learner risks meeting the author of this book who has been a Red Hat Certified Instructor for many years now. Who Should Read This Book? This book was written for Red Hat administrators. The book is for beginning administra- tors as well as those who already have a couple of years of experience working with Red Hat systems. For the advanced administrators, it is written as a reference guide that helps them set up services such as web servers, DNS and DHCP, clustering, and more. It also contains advanced information, such as a long chapter on performance optimization. What You Need To work with this book, you need a dedicated computer on which you can install Red Hat Enterprise Linux. If this is not feasible, a virtual machine can be used as an alternative, however this is absolutely not recommended, as you won’t be able to do all the exercises on virtualization. To install Red Hat Enterprise Linux and use it as a host for KVM virtualiza- tion, make sure that your computer meets the following minimum criteria: 64-bit CPU with support for virtualization. At least 2GB of RAM is recommended. (It will probably work with 1GB, but this is not recommended.) flast.indd xxiii 1/8/2013 10:40:15 AM xxiv Introduction A DVD drive. A hard disk that is completely available and at least 40GB in size. A network card and connection to a network switch. What Is Covered in This Book? Red Hat Linux Enterprise 6 Administration is organized to provide the knowledge that you’ll need to administer Red Hat Enterprise Linux 6. It includes the following chapters: Part I: Getting Familiar with Red Hat Enterprise Linux Chapter 1, “Getting Started with Red Hat Enterprise Linux” This chapter introduces Red Hat Enterprise Linux and explains its particulars. You’ll also learn about the value added by this commercial Linux distribution as compared to free Linux distributions. In the sec- ond part of this chapter, you’ll learn how to install Red Hat Enterprise Linux. You’ll also get a quick introduction to the workings of the graphical user interface. Chapter 2, “Finding Your Way on the Command Line” This chapter introduces you to working on the command line, the most important interface you’ll use to manage your Red Hat Enterprise Linux server. Part II: Administering Red Hat Enterprise Linux Chapter 3, “Performing Daily System Administration Tasks” In this chapter, you’ll learn about some common system administration tasks. This includes mounting and unmount- ing fi le systems, setting up and managing a printing environment, and scheduling jobs with cron. You’ll also learn how to do process administration and make backups. Chapter 4, “Managing Software” In this chapter, you’ll learn how to install software. You’ll also read how to manage software, which includes querying software packages to fi nd out everything you need to know about installed software. You’ll also read how to set up the repositories that you’ll need for an easy way to install and manage software. Chapter 5, “Configuring and Managing Storage” This chapter teaches you how to set up storage. It includes information about managing partitions, logical volumes, and encrypted volumes. You’ll also learn how to set up automatic mounting of volumes through fstab and how to create and manage swap space. Chapter 6, “Connecting to the Network” Here you’ll learn how to connect your server to the network. The chapter addresses setting up the network interface, both from the com- mand line and from the configuration fi les. You’ll set up normal network connections, and you will also learn how to create a bonded network interface. Finally, you’ll learn how to test your network using common utilities such as ping and dig. flast.indd xxiv 1/8/2013 10:40:15 AM Introduction xxv Part III: Securing Red Hat Enterprise Linux Chapter 7, “Working with Users, Groups, and Permissions” To manage who can do what on your system, you’ll need to create users and put them in groups. In this chapter, you’ll learn how to do that and how to add users to primary and secondary groups. You’ll also learn how to work with basic and advanced permissions and set up access control lists. Chapter 8, “Understanding and Configuring SELinux” This chapter teaches you how to make your Red Hat Enterprise Linux server really secure using SELinux. You’ll learn about the different modes that are available and how to set file system context labels and Booleans to tune SELinux exactly to your needs. Chapter 9, “Working with KVM Virtualization” Red Hat Enterprise Linux offers virtu- alization capabilities by default. In this chapter, you’ll learn how to set these up using KVM virtualization. You’ll learn what your server needs to be a KVM host, and you’ll read how to create and manage virtual machines. Chapter 10, “Securing Your Server with iptables” iptables is a kernel-provided fi rewall, which blocks or allows access to services configured to listen at specific ports. In this chapter, you’ll learn how to set up the iptables fi rewall from the command line. Chapter 11, “Setting Up Cryptographic Services” In this chapter, you’ll learn how to set up cryptographic services on Red Hat Enterprise Linux. You’ll learn how to configure SSL certificates and have them signed by a certificate authority. You’ll also learn how to use GPG for fi le and email encryption and security. Part IV: Networking Red Hat Enterprise Linux Chapter 12, “Configuring OpenLDAP” If you really need to manage more than just a few users, using a directory service such as OpenLDAP can be handy. In this chapter, you’ll learn how to set up OpenLDAP on your server. You’ll also learn how to add user objects to the OpenLDAP server and how to configure your server to authenticate on OpenLDAP. Chapter 13, “Configuring Your Server for File Sharing” This chapter teaches you how to set up your server for fi le sharing. You’ll learn about common fi le sharing solutions, such as FTP, NFS, and Samba. You’ll also learn how to connect to servers offering these services from Red Hat Enterprise Linux. Chapter 14, “Configuring DNS and DHCP” In this chapter, you’ll read how to set up a Dynamic Host Configuration Protocol (DHCP) server to automate providing computers in your network with IP addresses and related information. You’ll also learn how to set up Domain Name System (DNS) on your servers, configuring them as primary and secondary servers, as well as cache-only servers. Chapter 15, “Setting Up a Mail Server” Postfi x is the default mail server on Red Hat Enterprise Linux. In this chapter, you’ll learn how to set up Postfi x to send and receive email on your server. You’ll also learn how to set up Dovecot to make email accessible for clients using POP or IMAP. flast.indd xxv 1/8/2013 10:40:15 AM xxvi Introduction Chapter 16, “Configuring Apache on Red Hat Enterprise Linux” In this chapter, you’ll learn how to set up Apache on your server. You’ll learn how to configure basic hosts, virtual hosts, and SSL secured hosts. The chapter also teaches you how to set up fi le-based or LDAP-based user authentication. Part V: Advanced Red Hat Enterprise Linux Configuration Chapter 17, “Monitoring and Optimizing Performance” For your server to function prop- erly, it is important that it performs well. In this chapter, you’ll learn how to analyze server performance and how to fi x it if there are problems. You’ll also read some hints about setting up the server in a way that minimizes the chance of having performance-related problems. Chapter 18, “Introducing Bash Shell Scripting” Every Linux administrator should at least know the basics of shell scripting. This chapter teaches you how it works. You’ll learn how to set up a shell script and how to use common shell scripting structures to handle jobs in the most ideal manner. Chapter 19, “Understanding and Troubleshooting the Boot Procedure” Many tasks are executed sequentially when your server boots. In this chapter, you’ll learn about everything that happens during server startup, including GRUB configuration and the way Upstart is used. You’ll also learn how to troubleshoot common issues that you may encounter while booting your server. Chapter 20, “Introducing High-Availability Clustering” In a mission-critical environ- ment, the Red Hat High Availability add-on can be a valuable addition to your datacen- ter. In this chapter, you’ll learn how to design and set up high availability on Red Hat Enterprise Linux. Chapter 21, “Setting Up an Installation Server” In a datacenter environment, you don’t want to set up every server manually. This is why it makes sense to set up an installation server. This chapter teaches you how to automate the installation of Red Hat Enterprise Linux completely. It includes setting up a network installation server and configuring a TFTP server that hands out boot images to clients that perform a PXE boot. You’ll also learn how to create a kickstart configuration fi le, which passes all parameters that are to be used for the installation. Glossary This contains defi nitions of the relevant vocabulary terms in this book. How to Contact the Author If you want to provide feedback about the contents of this book or if you’re seeking a helping hand in setting up an environment or fixing problems, you can contact me directly. The easi- est way to get in touch with me is by sending an email to [email protected]. You can flast.indd xxvi 1/8/2013 10:40:15 AM Introduction xxvii also visit my website at www.sandervanvugt.com. If you’re interested in the person behind the book, you’re also more than welcome to visit my hobby site at www.sandervanvugt.org. Sybex strives to keep you supplied with the latest tools and information you need for your work. Please check their website at www.sybex.com, where we’ll post additional content and updates that supplement this book if the need arises. Enter search terms in the Search box (or type the book’s ISBN: 978-1-118-30129-6), and click Go to get to the book’s update page. flast.indd xxvii 1/8/2013 10:40:15 AM flast.indd xxviii 1/8/2013 10:40:15 AM Getting Familiar PART with Red Hat Enterprise Linux I c01.indd 1 1/7/2013 5:43:16 PM c01.indd 2 1/7/2013 5:43:18 PM Chapter Getting Started with Red Hat 1 Enterprise Linux TOPICS COVERED IN THIS CHAPTER: Linux, Open Source, and Red Hat Red Hat Enterprise Linux and Related Products Installing Red Hat Enterprise Linux Server Exploring the GNOME User Interface c01.indd 3 1/7/2013 5:43:18 PM Red Hat Enterprise Linux is in use at most Fortune 500 com- panies, and it takes care of mission-critical tasks in many of them. This chapter introduces Red Hat Enterprise Linux. It begins with a brief history, where you’ll learn about Linux in general and the role of Red Hat in the Linux story. Following that, it provides an overview of Red Hat Enterprise Linux (RHEL) and its related products. Finally, you’ll learn how to install RHEL so that you can start building your RHEL skills. Linux, Open Source, and Red Hat If you want to work with Red Hat, it helps to understand a little bit about its background. In this introduction, you’ll learn about the rise of UNIX, the Linux kernel and open source, and the founding of Red Hat. Origins of Linux The late 1960s and early 1970s were the dawn of the modern computing era. It was the period of proprietary stacks, where a vendor would build a “closed” computer system and create the operating software to run on it. Computers were extremely expensive and rare among businesses. In that period, scientists were still looking for the best way to operate a computer, and that included developing the best programming language. It was normal for computer programmers to address the hardware directly, using very complex assembly pro- gramming languages. An important step forward was the development of the general-purpose programming language C by Dennis Richie at Bell Telephone Laboratories in 1969. This language was developed for use with the UNIX operating system. The UNIX operating system was the fi rst operating system where people from different companies tried to work together to build instead of competing with each other, keeping their efforts secret. This spirit brought UNIX to scientific, government, and higher- education institutions. There it also became the basis for the rise of another phenomenon, the Internet Protocol (IP) and the Internet. One of the huge contributors to the success of UNIX was the spirit of openness of the operating system. Everyone could contribute to it, and the specifications were freely available to anyone. c01.indd 4 1/7/2013 5:43:19 PM Linux, Open Source, and Red Hat 5 Because of the huge success of UNIX, companies started claiming parts of this operat- ing system in the 1970s. They succeeded fairly well, and that was the beginning of the development of different flavors of UNIX, such as BSD, Sun Solaris, and HP AIX. Instead of working together, these UNIX flavors worked beside one another, with each sponsoring organization trying to develop the best version for a specific solution. As a reaction to the closing of UNIX, Richard Stallman of MIT announced in 1984 the GNU operating system project. The goal of this project was to develop “a sufficient body of free software [...] to get along without any software that is not free.” During the 1980s, many common Unix commands, tools, and applications were devel- oped until, in 1991, the last gap was fi lled in with the launch of the Linux kernel by a stu- dent at the University of Helsinki in Finland, Linus Torvalds. The interesting fact about the Linux kernel is that it was never developed to be part of the GNU project. Rather, it was an independent initiative. Torvalds just needed a license to ensure that the Linux kernel would be free software forever, and he chose to use the GNU General Public License (GPL) for this purpose. The GPL is a copyleft license, which means that derived works can be distrib- uted only under the same license terms. Using GPL made it possible to publish open source software where others could freely add to or modify lines of code. Torvalds also made an announcement on Usenet, a very popular news network that was used to communicate information about certain projects in the early 1990s. In his Usenet message, Torvalds asked others to join him working on the Linux kernel, a challenge that was very soon taken up by many programmers around the world. Distributions With the adoption of the Linux kernel, fi nally everything that was needed to create a com- plete operating system was in place. There were many GNU utilities to choose from, and those tools, together with a kernel, made a complete operating system. The only thing enthusiastic users still needed to do was to gather this software, compile it from source code, and install the working parts on a computer. Because this was a rather complicated task, some initiatives started soon to provide ready-to-install Linux distributions. Among the fi rst was MCC Interim Linux, a distribution made available for public download in February 1992, shortly after the release of the Linux kernel itself. In 1993, Patrick Volkerding released a distribution called Slackware, a distribution that could be downloaded to floppy disk images in the early days. It is still available and actively being developed today. In 1993, Marc Ewing and Bob Young founded Red Hat, the fi rst Linux distributor operating as a business. Since then, Red Hat has acquired other companies to integrate specific Linux-related technologies. Red Hat went public in 1999, thus becoming the fi rst Linux-based company on Wall Street. Because of the publicity stemming from its IPO, Red Hat and Linux received great exposure, and many companies started using it for their enterprise IT environments. It was c01.indd 5 1/7/2013 5:43:19 PM 6 Chapter 1 Getting Started with Red Hat Enterprise Linux initially used for applications, such as intranet web servers running Apache software. Soon Linux was also used for core fi nancial applications. Today Linux in general and Red Hat Linux in particular is at the heart of the IT orga- nization in many companies. Large parts of the Internet operate on Linux, using popular applications such as the Apache web server or the Squid proxy server. Stock exchanges use Linux in their real-time calculation systems, and large Linux servers are running essential business applications on top of Oracle and SAP. Linux has largely replaced UNIX, and Red Hat is a leading force in Linux. One reason why Red Hat has been so successful since the beginning is the level of sup- port the company provides. Red Hat offers three types of support, and this gives companies the confidence they need to run vital business applications on Linux. The three types of Linux support provided by Red Hat are as follows: Hardware Support Red Hat has agreements with every major server hardware vendor to make sure that whatever server a customer buys, the hardware vendor will assist them in fi xing hardware issues, when Red Hat is installed on it. Software Support Red Hat has agreements with every major enterprise software vendor to make sure that their software runs properly on top of the Red Hat Linux operating system and that the enterprise software is also guaranteed to run on Red Hat Linux by the vendor of the operating system. Hands-on Support This means that if a customer is experiencing problems accomplish- ing tasks with Red Hat software, the Red Hat Global Support organization is there to help them by fi xing bugs and providing technical assistance. It is also important to realize that Red Hat is doing much more than just gathering the software pieces and putting them together on the installation media. Red Hat employs hundreds of developers who work on developing new solutions that will run on Red Hat Enterprise Linux in the near future. Fedora Even as Red Hat is actively developing software to be part of Red Hat Linux, it still is largely involved in the open source community. The most important approach to do this is by sponsoring the Fedora project. Fedora is a freely available Linux distribution that is completely comprised of open source software, and Red Hat is providing the funds and people to tackle this project. Both Red Hat and Fedora are free of charge; with Red Hat you pay only for updates and support. Fedora is used as a development platform for the latest and greatest version of Linux, which is provided free of charge for users who are interested. As such, Fedora can be used as a test platform for features that will eventually be included in Red Hat Enterprise Linux. If you want to know what will be included in future versions of Red Hat Linux, Fedora is the best place to look. Also, Fedora makes an excellent choice to install on your personal computer, because it offers all the functions you would expect from a modern operating system—even some functions that are of interest only to home users. c01.indd 6 1/7/2013 5:43:19 PM Red Hat Enterprise Linux and Related Products 7 Red Hat Enterprise Linux and Related Products Red Hat offers several products, of which Red Hat Enterprise Linux and JBoss are the most important solutions. There are other offerings in the product catalog as well. In the follow- ing sections, you can read about these products and their typical application. Red Hat Enterprise Linux Server Edition The core of the Red Hat offering is Red Hat Enterprise Linux. This is the basis for two editions: a server edition and a workstation edition. The RHEL Server edition is the highly successful Red Hat product that is used in companies around the globe. At the time of this writing, the current RHEL release is version 6.2. With the Red Hat Enterprise Linux Server edition, there is a major new release about every three to four years. In between the major updates, there are minor ones, represented by the number after the dot in the version number. Apart from these releases, Red Hat pro- vides patches to fi x bugs and to apply security updates. Typically, these patches are applied by using the Red Hat Network, a certified collection of repositories where Red Hat makes patches available after verifying them. To download and install repositories from the Red Hat Network (RHN), a current subscription is required. Without a current subscription, you can still run RHEL, but no updates will be installed through RHN. As an alternative to connecting each server directly to RHN, Red Hat provides a solution called Satellite. Satellite works as a proxy to RHN, and just the Satellite server is configured to fetch updates from RHN, after which the Red Hat nodes in the network connect to Satellite to access their updates. Be aware that there is also a product called RHN Proxy, which is a real caching proxy, whereas Satellite is a versioning and deployment tool. Red Hat Enterprise Linux for Free If you want updates and support, you have to pay for Red Hat Enterprise Linux, so how come people have to buy licenses for GPL software that is supposed to be available for free? Well, the fact is that the sources of all the software in RHEL are indeed available for free. As with any other Linux vendor, Red Hat provides source code for the software in RHEL. What customers typically buy, however, is a subscription to the compiled version of the software that is in RHEL. In the compiled version, the Red Hat logo is included. c01.indd 7 1/7/2013 5:43:20 PM 8 Chapter 1 Getting Started with Red Hat Enterprise Linux This is more than just a logo; it’s the guarantee of quality that customers expect from the leader in Linux software. Still, the fact is that the sources of the software contained in RHEL are available for free. Some Linux distributions have used these sources to create their own dis- tributions. The two most important distributions are CentOS (short for Community Enterprise Operating System) and Scientific Linux. Because these distributions are built upon Red Hat Linux with the Red Hat logo removed, the software is basically the same. However, small binary differences do exist, such as the integration of the software with RHN. The most important difference, however, is that these dis- tributions don’t offer the same level of support as in in RHEL. So, you’re better off going for the real thing. You can download a free version of RHEL with 30 days of access to RHN at www.redhat.com. Alternatively, you can download CentOS at www.centos.org or Scientific Linux at www.scientificlinux.org. Red Hat Enterprise Linux Workstation Edition The other product that falls under Red Hat Enterprise Linux is the Workstation edition. This solution is based on the same code as RHEL Server. Also, the same license conditions apply for RHEL Workstation as for RHEL Server, and you need a current subscription to access and install updates from RHN. To date, Red Hat Linux Workstation hasn’t experi- enced the same level of success as Red Hat Linux Enterprise Server. Red Hat Add-Ons RHEL includes everything most people need to run a Linux server. Some components require an extra effort, though, and for that reason they are offered as add-ons in RHEL. The two most significant kinds of add-on are the Enterprise File System (XFS) and Red Hat Cluster Services. Enterprise File System (XFS) The Enterprise File System offers full scalability for large environments where many fi les or very large fi les have to be handled on large fi le systems. Even though ext4, the default fi le system in Red Hat Enterprise Linux, has been optimized significantly over time, it still doesn’t fit well in environments that have very specific storage needs, such as the need to stream multimedia fi les or to handle hundreds of thousands of fi les per day. Red Hat Cluster Services (RHCS) RHCS offers high-availability clustering to vital ser- vices in the network. In an RHCS cluster, you run specialized cluster software on multiple nodes that are involved in the cluster, and that software monitors the availability of vital services. If anything goes down with such a service, Red Hat Cluster Services takes over and makes sure that the service is launched on another node. c01.indd 8 1/7/2013 5:43:21 PM Installing Red Hat Enterprise Linux Server 9 Red Hat Directory Server In a corporate environment where many user accounts have to be managed, it doesn’t make sense to manage these accounts in stand-alone databases on individual servers. One solution is to have servers handle their authentication on external directory servers. An example of this approach is to connect RHEL to Microsoft Active Directory, an approach that is used fre- quently by many Red Hat customers. Another approach is to use Red Hat Directory Server, a dedicated LDAP directory service that can be used to store and manage corporate identities. Red Hat Enterprise Virtualization Red Hat Enterprise Virtualization (RHEV) provides a virtualization platform that can be compared with other solutions, such as VMware vSphere. In RHEV, several dedicated serv- ers running the KVM hypervisor are managed through RHEV-M, the management server for the virtual environment. In the RHEV infrastructure, fully installed RHEL servers as well as dedicated on-iron hypervisors (the RHEV-H) can be used. A major reason why companies around the world are using RHEV is because it offers the same functionality as VMware vSphere, but for a fraction of the price. JBoss Enterprise Middleware JBoss Enterprise Middleware is an application layer that can be installed on top of any operating system, including RHEL. The platform is used to build custom-made applica- tions which can offer their services to perform any tasks you can think of. JBoss is an open platform, and therefore its adoption level is high. Red Hat has had huge success selling JBoss solutions on top of Red Hat Enterprise Linux. Red Hat Cloud Red Hat Cloud is the solution where everything comes together. In the lower layers of the cloud infrastructure, Red Hat can offer Platform as a Service services that are based on RHEV or any other virtualization platform. At the PaaS layer, Red Hat Cloud helps deploy virtual machines on demand easily. In the higher layers of the cloud, combined with JBoss Enterprise Middleware, Red Hat Cloud delivers software as a service, thus helping custom- ers build a complete cloud infrastructure on top of Red Hat software. Installing Red Hat Enterprise Linux Server There is a version of RHEL Server for almost any hardware platform. That means you can install it on a mainframe computer, a mid-range system, or PC-based server hardware using a 64- or 32-bit architecture. Currently, the 64-bit version of Red Hat Enterprise Linux is c01.indd 9 1/7/2013 5:43:21 PM 10 Chapter 1 Getting Started with Red Hat Enterprise Linux the most used version, and that is why, in this chapter, you can read about how to install this software version on your computer. The exact version you need is Red Hat Enterprise Linux Server for 64-bit x86_64. If you don’t have the software yet, you can download a free evaluation copy at www.redhat.com. The ideal installation is on server-grade hardware. However, you don’t have to buy actual server hardware if you just want to learn how to work with Red Hat Enterprise Linux. Basically, any PC will do as long as it meets the following minimum requirements: A CPU capable of handling 64-bit instructions 1GB of RAM 20GB of available hard disk space A DVD drive A network card Make sure your computer meets these minimum requirements. To work your way through the exercises in this book, I’ll assume you have a com- puter or virtual machine that meets them. You can run Red Hat Enterprise Linux with less than this, but if you do, you’ll miss certain functionality. For instance, you can install RHEL on a machine that has 512MB of RAM, but you’ll lose the graphical user interface. You could also install RHEL on a 32-bit CPU or on a VMware or VirtualBox virtual machine, but within these environments you cannot configure KVM virtualization. Because this book includes some exercises that work directly on the hard disk of your computer and you don’t want to risk destroying all of your data by accident, it is strongly recommended that you do not install a dua