Chapter 15. Creating a remote repository

Follow the steps in this procedure to create an installation source for a network-based installation using a remote repository containing extracted contents of the Binary DVD ISO image. The installation source is accessed over HTTP or HTTPS.

Prerequisites

  • A Red Hat Enterprise Linux 8 installation DVD/ISO image
  • Several servers running Red Hat Enterprise Linux

15.1. Installing Apache on RHEL

This procedure will help you install Apache on Red Hat Enterprise Linux 8.

Prerequisites

  • Access to a repo with Apache webserver

Procedure

  1. Install the httpd package

    # yum install httpd
  2. Run, then enable the Apache webserver. These commands will also start the webserver after reboot.

    # systemctl enable httpd
    # systemctl start httpd
  3. Insert any website files you may have.

    # echo Apache on RHEL 8 > /var/www/html/index.html
  4. Update the firewall.

    # firewall-cmd --add-service=http --permanent
    # firewall-cmd --add-service=http
  5. Access the website.

    http://<the-apache-ip-address>
    
    http://<the-apache-hostname>

15.2. Creating a remote repository

Multiple Red Hat Enterprise Linux servers may access a single Red Hat Enterprise Linux repository on the network. This requires a running web server, most likely this will be Apache.

Prerequisites

  • A Red Hat Enterprise Linux 8 installation DVD
  • Several servers running Red Hat Enterprise Linux

Procedure

  1. Mount and copy the content of downloaded DVD.

    mkdir /mnt/rhel8
    mount -o loop,ro rhel-8.1-x86_64-dvd.iso /mnt/rhel8/
    cp -r /mnt/rhel8/ /var/www/html/
    umount  /mnt/rhel8

    The next step is performed on the client side, not on the server where Apache is installed.

  2. Create a repo file for both BaseOS and AppStream repositories.

    vi /etc/yum.repos.d/rhel_http_repo.repo
    
    [BaseOS_repo_http]
    name=RHEL_8.0_x86_64_HTTP BaseOS
    baseurl="http://myhost/rhel8/BaseOS"
    gpgcheck=1
    gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
    
    [AppStream_repo_http]
    name=RHEL_8.0_x86_64_HTTP AppStream
    baseurl="http://myhost/rhel8/AppStream"
    gpgcheck=1
    gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
    
    [root@localhost ~]# yum repolist
    Updating Subscription Management repositories.
    Unable to read consumer identity
    This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
    Last metadata expiration check: 0:08:33 ago on Út 23. července 2019, 16:48:09 CEST.
    repo id                                                              repo name                                                                        status
    AppStream_repo_http                                                  RHEL_8.0_x86_64_HTTP AppStream                                                   4,672
    BaseOS_repo_http                                                     RHEL_8.0_x86_64_HTTP BaseOS                                                      1,658
    [root@localhost ~]#