4.4. リポジトリーをホストする新しい Web サーバーの作成
リポジトリーをホストする既存の Web サーバーがない場合は、同期されたリポジトリーを使用して Web サーバーを作成できます。
手順
前提条件をインストールします。
sudo dnf install httpd
$ sudo dnf install httpd
Copy to Clipboard Copied! リポジトリーディレクトリーを提供するように 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>
/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>
Copy to Clipboard Copied! ディレクトリーが apache ユーザーによって読み取り可能であることを確認してください。
sudo chown -R apache /path/to/repos
$ sudo chown -R apache /path/to/repos
Copy to Clipboard Copied! SELinux を設定します。
sudo semanage fcontext -a -t httpd_sys_content_t "/path/to/repos(/.*)?" sudo restorecon -ir /path/to/repos
$ sudo semanage fcontext -a -t httpd_sys_content_t "/path/to/repos(/.*)?" $ sudo restorecon -ir /path/to/repos
Copy to Clipboard Copied! httpd を有効にします。
sudo systemctl enable --now httpd.service
$ sudo systemctl enable --now httpd.service
Copy to Clipboard Copied! ファイアウォールを開きます。
sudo firewall-cmd --zone=public --add-service=http –add-service=https --permanent sudo firewall-cmd --reload
$ sudo firewall-cmd --zone=public --add-service=http –add-service=https --permanent $ sudo firewall-cmd --reload
Copy to Clipboard Copied! 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
[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
Copy to Clipboard Copied!