Book Image

Red Hat Enterprise Linux Server Cookbook

By : Jakub Gaj, Leemans
5 (1)
Book Image

Red Hat Enterprise Linux Server Cookbook

5 (1)
By: Jakub Gaj, Leemans

Overview of this book

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.
Table of Contents (12 chapters)
11
Index

Creating a copy of an RHN repository


In this recipe, I'll show you how you can set up a yum repository for Red Hat Network-based and "plain" yum repositories.

Getting ready

Before you create a copy of an RHN repository, you need to ensure that you have a valid subscription to the repository that you want to duplicate. When this prerequisite is met, you can perform this recipe from the machine that uses the subscription.

How to do it…

Before being able to create yum repositories, we need to install a couple of tools by performing the following steps:

  1. Install the createrepo and yum-utils packages using the following command:

    ~]# yum install -y yum-utils createrepo
    
  2. Now, install the Apache web server, as follows:

    ~]# yum install -y httpd
    

Syncing RHN repositories

You can only sync RHN subscriptions that you have access to. Perform the following steps:

  1. Create a directory to hold the RHN rhel7 repository, as follows:

    ~]# mkdir /var/www/html/repo/rhel/rhel-x86_64-server-7/packages
    
  2. Now, create /mnt/iso...