Show Table of Contents
28.3. Preparing a Repository Mirror for Composer
For technical reasons, Composer cannot directly use the Red Hat content delivery network (CDN). This procedure describes how to prepare a mirror of such content on a system different from the one running Composer.
Prerequisites
- The file system containing the
/var/wwwdirectory must have at least 50 GiB of free space available. To check this:$
df -h /var/www/ - The system must use the same version of Red Hat Enterprise Linux as the system using Composer and be fully subscribed.
Procedure
- Install the tools for handling packages and repositories, and the Apache web server:
#
yum install yum-utils createrepo httpd - List the repositories enabled on this machine and note their identifiers:
#
yum repolist - Create local mirrors of the repositories that you want to use in Composer. For each of these repositories, run:
#
mkdir -p /var/www/html#reposync --gpgcheck -l --download_path=/var/www/html --repoid REPO-ID --downloadcomps --download-metadata$cd /var/www/html/REPO-ID$createrepo -v /var/www/html/REPO-ID -g comps.xmlReplace REPO-ID with the identifier you noted in the previous step. - Make sure that the repositories have the correct SELinux context so that the
httpdApache web server can access the repository mirrors:#
chcon -vR -t httpd_sys_content_t /var/www/html/ - Enable the web server to start after each reboot, configure the system firewall, and start the server for the first time:
#
systemctl enable httpd#firewall-cmd --add-service=http --permanent#firewall-cmd --add-service=http#systemctl start httpd

Where did the comment section go?
Red Hat's documentation publication system recently went through an upgrade to enable speedier, more mobile-friendly content. We decided to re-evaluate our commenting platform to ensure that it meets your expectations and serves as an optimal feedback mechanism. During this redesign, we invite your input on providing feedback on Red Hat documentation via the discussion platform.