You are previewing Red Hat Enterprise Linux Server Cookbook.
O'Reilly logo
Red Hat Enterprise Linux Server Cookbook

Book Description

Over 60 recipes to help you build, configure, and orchestrate RHEL 7 Server to make your everyday administration experience seamless

About This Book

  • Create fully unattended installations and deploy configurations without breaking a sweat

  • Discover and kick-start the newest RHEL 7 configuration and management tools through an easy-to-follow, practical approach for a lazy system management

  • Be guided by an experienced RHEL expert who is a certified Linux engineer with a passion for open source and open standards

  • Who This Book Is For

    Red Hat Enterprise Linux Server Cookbook is for RHEL 7 system administrators and DevOps in need of a practical reference guide to troubleshoot common issues and quickly perform tasks.

    What You Will Learn

  • Set up and configure RHEL 7 Server

  • Use NetworkManager to configure all aspects of your network

  • Manage virtual environments using libvirt

  • Set up software repositories

  • Secure and monitor your RHEL environment

  • Configure SELinux, and create and apply its policies

  • Create kickstart scripts to automatically deploy RHEL 7 systems

  • Use Orchestration and configuration management tools to manage your environment

  • In Detail

    Dominating the server market, the Red Hat Enterprise Linux operating system gives you the support you need to modernize your infrastructure and boost your organization’s efficiency. Combining both stability and flexibility, RHEL helps you meet the challenges of today and adapt to the demands of tomorrow.

    This practical Cookbook guide will help you get to grips with RHEL 7 Server and automating its installation. Designed to provide targeted assistance through hands-on recipe guidance, it will introduce you to everything you need to know about KVM guests and deploying multiple standardized RHEL systems effortlessly. Get practical reference advice that will make complex networks setups look like child’s play, and dive into in-depth coverage of configuring a RHEL system. Also including full recipe coverage of how to set up, configuring, and troubleshoot SELinux, you’ll also discover how secure your operating system, as well as how to monitor it.

    Style and approach

    This practical guide is packed full of hands-on recipes that provide quick solutions to the problems faced when building your RHEL 7 system from scratch using orchestration tools. Each topic is explained sequentially in the process of setting up a system and binding everything together.

    Downloading the example code for this book. You can download the example code files for all Packt books you have purchased from your account at http://www.PacktPub.com. If you purchased this book elsewhere, you can visit http://www.PacktPub.com/support and register to have the code file.

    Table of Contents

    1. Red Hat Enterprise Linux Server Cookbook
      1. Table of Contents
      2. Red Hat Enterprise Linux Server Cookbook
      3. Credits
      4. About the Author
      5. About the Reviewers
      6. www.PacktPub.com
        1. Support files, eBooks, discount offers, and more
          1. Why Subscribe?
          2. Free Access for Packt account holders
      7. Preface
        1. What this book covers
        2. What you need for this book
        3. Who this book is for
        4. Sections
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
          5. See also
        5. Conventions
        6. Reader feedback
        7. Customer support
          1. Downloading the color images of this book
          2. Errata
          3. Piracy
          4. Questions
      8. 1. Working with KVM Guests
        1. Introduction
        2. Installing and configuring a KVM
          1. Getting ready
          2. How to do it…
            1. Manual installation
            2. Kickstart installation
            3. Graphical setup during the system's setup
          3. See also
        3. Configuring resources
          1. Getting ready
          2. How to do it…
            1. Creating storage pools
            2. Querying storage pools
            3. Removing storage pools
            4. Creating a virtual network
            5. Removing networks
          3. How it works…
          4. There's more…
            1. Local storage pools
            2. Networked or shared storage pools
          5. See also
        4. Building guests
          1. Getting ready
          2. How to do it…
            1. Create a guest
            2. Deleting a guest
          3. How it works…
          4. There's more…
          5. See also
        5. Adding CPUs on the fly
          1. Getting ready
          2. How to do it…
            1. On the KVM host, perform the following steps:
            2. On the KVM guest, perform the following:
        6. Adding RAM on the fly
          1. Getting ready
          2. How to do it…
        7. Adding disks on the fly
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
        8. Moving disks to another storage
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
        9. Moving VMs
          1. Getting ready
          2. How to do it…
            1. Live native migration over the default network
            2. Live native migration over a dedicated network
          3. How it works…
          4. There's more…
          5. See also
        10. Backing up your VM metadata
          1. How to do it…
          2. How it works…
          3. See also
      9. 2. Deploying RHEL "En Masse"
        1. Introduction
        2. Creating a kickstart file
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
          5. See also
        3. Publishing your kickstart file using httpd
          1. How to do it…
          2. There's more…
          3. See also
        4. Deploying a system using PXE
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
          5. See also
        5. Deploying a system using a custom boot ISO file
          1. How to do it…
          2. How it works…
      10. 3. Configuring Your Network
        1. Introduction
        2. Creating a VLAN interface
          1. Getting ready
          2. How to do it…
            1. Creating the VLAN connection with nmcli
            2. Creating the VLAN connection with nmtui
            3. Creating the VLAN connection with kickstart
          3. There's more…
          4. See also
        3. Creating a teamed interface
          1. Getting ready
          2. How to do it…
            1. Creating the teamed interface using nmcli
            2. Creating the teamed interface using nmtui
            3. Creating the teamed interface with kickstart
          3. There's more…
            1. nmcli
            2. nmtui
            3. kickstart
          4. See also
        4. Creating a bridge
          1. Getting ready
          2. How to do it…
            1. Creating a bridge using nmcli
            2. Creating a bridge using nmtui
            3. Creating a bridge with kickstart
          3. There's more…
          4. See also
        5. Configuring IPv4 settings
          1. How to do it…
            1. Setting your IPv4 configuration using nmcli
            2. Setting your IPv4 configuration using nmtui
          2. There's more…
        6. Configuring your DNS resolvers
          1. How to do it…
            1. Setting your DNS resolvers using nmcli
            2. Setting your DNS resolvers using nmtui
          2. There's more…
        7. Configuring static network routes
          1. How to do it…
            1. Configuring static network routes using nmcli
            2. Configuring network routes using nmtui
      11. 4. Configuring Your New System
        1. Introduction
        2. The systemd service and setting runlevels
          1. How to do it…
          2. There's more…
          3. See also
        3. Starting and stopping systemd services
          1. How to do it…
          2. There's more…
          3. See also
        4. Configuring the systemd journal for persistence
          1. How to do it…
          2. There's more…
          3. See also
        5. Monitoring services using journalctl
          1. How to do it…
          2. There's more…
          3. See also
        6. Configuring logrotate
          1. How to do it…
          2. How it works…
          3. There's more…
          4. See also
        7. Managing time
          1. How to do it…
            1. Managing time through chrony
            2. Managing time through ntpd
          2. There's more…
          3. See also
        8. Configuring your boot environment
          1. How to do it…
          2. How it works…
          3. There's more…
          4. See also
        9. Configuring smtp
          1. How to do it…
          2. There's more…
          3. See also
      12. 5. Using SELinux
        1. Introduction
        2. Changing file contexts
          1. Getting ready
          2. How to do it…
            1. Temporary context changes
            2. Persistent file context changes
          3. There's more…
          4. See also
        3. Configuring SELinux booleans
          1. How to do it…
            1. Listing SELinux booleans
            2. Changing SELinux booleans
          2. There's more…
        4. Configuring SELinux port definitions
          1. How to do it…
          2. There's more…
        5. Troubleshooting SELinux
          1. Getting ready
          2. How to do it…
            1. audit.log
            2. syslog
            3. ausearch
          3. There's more…
          4. See also
        6. Creating SELinux policies
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
          5. See also
        7. Applying SELinux policies
          1. Getting ready
          2. How to do it...
          3. How it works…
          4. There's more…
          5. See also
      13. 6. Orchestrating with Ansible
        1. Introduction
        2. Install Ansible
          1. Getting ready
          2. How to do it…
            1. Installing the latest tarball
            2. Installing cutting edge from Git
            3. Installing Ansible from the EPEL repository
          3. There's more…
        3. Configuring the Ansible inventory
          1. How to do it…
            1. The static inventory file
            2. The dynamic inventory file
            3. host_vars files
            4. group_vars files
          2. How it works…
          3. There's more…
          4. See also
        4. Creating a template for a kickstart file
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
          5. See also
        5. Creating a playbook to deploy a new VM with kickstart
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
          5. See also
        6. Creating a playbook to perform system configuration tasks
          1. Getting ready
          2. How to do it…
          3. There's more…
          4. See also
        7. Troubleshooting Ansible
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
      14. 7. Puppet Configuration Management
        1. Introduction
        2. Installing and configuring Puppet Master
          1. How to do it…
          2. There's more…
          3. See also
        3. Installing and configuring the Puppet agent
          1. How to do it…
          2. There's more…
        4. Defining a simple module to configure time
          1. Getting ready
          2. How to do it…
          3. How it works...
          4. There's more...
          5. See also
        5. Defining nodes and node grouping
          1. How to do it…
            1. Create the configuration node
            2. Create a node group
          2. There's more…
        6. Deploying modules to single nodes and node groups
          1. How to do it…
            1. Configure to deploy a module or manifest to a single client
            2. Configure to deploy a module or manifest to a node group
            3. Configure to deploy to all registered systems
            4. Deploy to a system
          2. There's more…
      15. 8. Yum and Repositories
        1. Introduction
        2. Managing yum history
          1. How to do it…
            1. Your yum history
            2. Information about a yum transaction or package
            3. Undoing/redoing certain yum transactions
            4. Roll back to a certain point in your transaction history
          2. There's more…
          3. See also
        3. Creating a copy of an RHN repository
          1. Getting ready
          2. How to do it…
            1. Syncing RHN repositories
          3. There's more…
          4. See also
        4. Configuring additional repositories
          1. Getting ready
          2. How to do it…
          3. There's more…
          4. See also
        5. Setting up yum to automatically update
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
          5. See also
        6. Configuring logrotate for yum
          1. How to do it…
          2. How it works…
          3. See also
        7. Recovering from a corrupted RPM database
          1. Getting ready
          2. How to do it…
          3. There's more…
      16. 9. Securing RHEL 7
        1. Introduction
        2. Installing and configuring IPA
          1. Getting ready
          2. How to do it…
            1. Installing the IPA server
            2. Installing the IPA client
          3. There's more…
          4. See also
        3. Securing the system login
          1. How to do it…
          2. How it works…
          3. There's more…
          4. See also
        4. Configuring privilege escalation with sudo
          1. Getting ready
          2. How to do it…
          3. There's more…
          4. See also
        5. Secure the network with firewalld
          1. How to do it…
            1. Showing the currently allowed services and ports on your system
            2. Allowing incoming requests for NFS (v4)
            3. Allowing incoming requests on an arbitrary port
          2. There's more…
          3. See also
        6. Using kdump and SysRq
          1. How to do it…
            1. Installing and configuring kdump and SysRq
            2. Using kdump tools to analyze the dump
          2. There's more…
          3. See also…
        7. Using ABRT
          1. How to do it…
            1. Installing and configuring abrtd
            2. Using abrt-cli
          2. There's more…
          3. See also
        8. Auditing the system
          1. How to do it…
            1. Configuring a centralized syslog server to accept audit logs
            2. Some audit rules
            3. Showing audit logs for the preceding rules
          2. See also
      17. 10. Monitoring and Performance Tuning
        1. Introduction
        2. Tuning your system's performance
          1. How to do it…
          2. There's more…
          3. See also
        3. Setting up PCP – Performance Co-Pilot
          1. How to do it…
            1. The default installation
            2. The central collector
          2. There's more…
          3. See also
        4. Monitoring basic system performance
          1. How to do it…
          2. There's more…
        5. Monitoring CPU performance
          1. How to do it…
        6. Monitoring RAM performance
          1. How to do it…
        7. Monitoring storage performance
          1. How to do it…
        8. Monitoring network performance
          1. How to do it…
      18. Index