4.4. 리포지토리를 호스팅할 새 웹 서버 생성
리포지토리를 호스팅할 기존 웹 서버가 없는 경우 동기화된 리포지토리를 사용하여 리포지토리를 생성할 수 있습니다.
절차
사전 요구 사항 설치:
$ sudo dnf install httpd
리포지토리 디렉터리를 제공하도록 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>
apache 사용자가 디렉터리를 읽을 수 있는지 확인합니다.
$ sudo chown -R apache /path/to/repos
SELinux를 구성합니다.
$ sudo semanage fcontext -a -t httpd_sys_content_t "/path/to/repos(/.*)?" $ sudo restorecon -ir /path/to/repos
httpd를 활성화합니다.
$ sudo systemctl enable --now httpd.service
방화벽을 엽니다.
$ sudo firewall-cmd --zone=public --add-service=http –add-service=https --permanent $ sudo firewall-cmd --reload
자동화 컨트롤러 및 자동화 허브에서 리포지토리 파일을 /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