1. local repository 구축하기
2. httpd 세팅
3. client 구축하기
4. httpd repo test하기
/home/centos
경로에 local repo를 구축# chcon -R -t httpd_user_content_t /home/centos/files_repo
# chmod 711 /home/centos/files_repo
이 때 home/
, entos/
, files_repo/
디렉터리 모두 최소 711의 권한을 가져야 한다.
[root@localhost ~]# yum repolist
repo id repo name
var_www_html_files_repo created by dnf config-manager from file:///var/www/html/files_repo
참고로 httpd repository로 사용할 것이므로, repo가 비활성 상태(enabled=0)이여도 무관하다.
# yum install httpd -y
# firewall-cmd --add-service={http,https} --permanent
# firewall-cmd --reload
또는 방화벽을 꺼두자
# systemctl stop firewalld
[root@localhost ~]# getenforce
Enforcing
[root@localhost ~]# setenforce 0
[root@localhost ~]# getenforce
Permissive
/etc/httpd/conf/httpd.conf
를 다음과 같이 수정한다.# vi /etc/httpd/conf/httpd.conf
<Directory />
AllowOverride All
Require all granted
Order deny,allow
</Directory>
DocumentRoot "/home/centos/files-repo"
<Directory "/home/centos/files-repo">
AllowOverride None
Require all granted
</Directory>
# systemctl restart httpd
httpd repo의 클라이언트가 될 서버에서 repository를 구축한다
[root@localhost ~]# cat /etc/yum.repos.d/my-repo.repo
[repo-server]
name=Repository server
baseurl=http://192.168.9.237/ #httpd가 있는 서버의 IP
enabled=1
gpgcheck=0
[root@localhost ~]# yum repolist
repo id repo name
repo-server Repository server
[root@localhost ~]# yum install sshpass
마지막 메타 데이터 만료 확인 : 0:10:41 전에 2022년 02월 13일 (일) 오후 07시 43분 21초.
Dependencies resolved.
========================================================================================================
Package Architecture Version Repository Size
========================================================================================================
Installing:
sshpass x86_64 1.06-9.el8 repo-server 27 k
Transaction Summary
========================================================================================================
설치 1 Package
Total download size: 27 k
Installed size: 40 k
Is this ok [y/N]: