4.3. リポジトリーをホストする新しい Web サーバーの作成

リポジトリーをホストする既存の Web サーバーがない場合は、同期されたリポジトリーを使用して作成します。

手順

新しい Web サーバーを作成する場合は、次の手順を使用します。

  1. 前提条件をインストールします。

    $ sudo dnf install httpd
  2. リポジトリーディレクトリーを提供するように httpd を設定します。

    /etc/httpd/conf.d/repository.conf
    
    DocumentRoot '/path/to/repos'
    
    <LocationMatch "^/+$">
        Options -Indexes
        ErrorDocument 403 /.noindex.html
    </LocationMatch>
    
    <Directory '/path/to/repos'>
        Options All Indexes FollowSymLinks
        AllowOverride None
        Require all granted
    </Directory>
  3. ディレクトリーが apache ユーザーによって読み取り可能であることを確認してください。

    $ sudo chown -R apache /path/to/repos
  4. SELinux を設定します。

    $ sudo semanage fcontext -a -t httpd_sys_content_t "/path/to/repos(/.*)?"
    $ sudo restorecon -ir /path/to/repos
  5. httpd を有効にします。

    $ sudo systemctl enable --now httpd.service
  6. ファイアウォールを開きます。

    $ sudo firewall-cmd --zone=public --add-service=http –add-service=https
    --permanent
    $ sudo firewall-cmd --reload
  7. Automation Controller と Automation Hub で、/etc/yum.repos.d/local.repo にリポジトリーファイルを追加し、必要に応じてオプションのリポジトリーを追加します。

    [Local-BaseOS]
    name=Local BaseOS
    baseurl=http://<webserver_fqdn>/rhel-8-for-x86_64-baseos-rpms
    enabled=1
    gpgcheck=1
    gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
    
    [Local-AppStream]
    name=Local AppStream
    baseurl=http://<webserver_fqdn>/rhel-8-for-x86_64-appstream-rpms
    enabled=1
    gpgcheck=1
    gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release