Chapter 16. 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 DVD ISO image. The installation source is accessed over HTTP or HTTPS.

Prerequisites

  • You have a Red Hat Enterprise Linux 8 installation DVD/ISO image.
  • You have several servers running Red Hat Enterprise Linux.

16.1. Installing Apache on RHEL

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

Prerequisites

  • You have 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 {ProductNumber} > /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>

16.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

  • You have a Red Hat Enterprise Linux 8 installation DVD/ISO image.
  • You have several servers running Red Hat Enterprise Linux.

Procedure

  1. Mount and copy the content of downloaded DVD.

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

    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_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_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_x86_64_HTTP AppStream                                                   4,672
    BaseOS_repo_http                                                     RHEL_8_x86_64_HTTP BaseOS                                                      1,658
    [root@localhost ~]#