[Linux] createrepo 을 활용한 yum repository 서버 구축
yum install -y createrepo 수행
설치 되어 있다면 아래와 같은 메시지 출력
[root@test ~]# yum install -y createrepo
Failed to set locale, defaulting to C
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
* base: centos.mirror.cdnetworks.com
* extras: centos.mirror.cdnetworks.com
* updates: ftp.iij.ad.jp
Package createrepo-0.9.9-28.el7.noarch already installed and latest version
Nothing to do
[root@test ~]#repository 로 사용할 directory 생성 후 createrepo <directory> 수
정상 실행되었다면 /yumrepo/repodata/repomd.xml 파일이 생성 됨
/yumrepo/내 directory를 Client 에서 repolist 로 추가하여 사용 가능
root@test ~]# mkdir /yumrepo
root@test ~]# createrepo /yumrepo
Saving Primary metadata
Saving file lists metadata
Saving other metadata
Generating sqlite DBs
Sqlite DBs complete
[root@test ~]#외부에서 repolist 접속을 위한 Apache httpd 설치
yum install -y httpd
/etc/httpd/conf.d/httpd.conf 파일을 내 "/var/www/html" 구문 삭제
DocumentRoot "/var/www/html"
#
# Relax access to content within /var/www.
#
<Directory "/var/www">
AllowOverride None
# Allow open access:
Require all granted
</Directory>
/etc/httpd/conf.d/httpd.conf 파일을 내 아래 문구 추가
DocumentRoot "/yumrepo"
<Directory "/yumrepo">
AllowOverride None
Require all granted
</Directory>
httpd daemon 재기동
systemctl restart httpd
curl http://localhost/repodata/repomd.xml 로 웹서버 상태 확인
[root@test conf]# curl http://localhost/repodata/repomd.xml
<?xml version="1.0" encoding="UTF-8"?>
<repomd xmlns="http://linux.duke.edu/metadata/repo" xmlns:rpm="http://linux.duke.edu/metadata/rpm">
<revision>1539673159</revision>
<data type="filelists">
<checksum type="sha256">401dc19bda88c82c403423fb835844d64345f7e95f5b9835888189c03834cc93</checksum>
<open-checksum type="sha256">bf9808b81cb2dbc54b4b8e35adc584ddcaa73bd81f7088d73bf7dbbada961310</open-checksum>
<location href="repodata/401dc19bda88c82c403423fb835844d64345f7e95f5b9835888189c03834cc93-filelists.xml.gz"/>
<timestamp>1539673159</timestamp>
... 생략 ...
'Linux' 카테고리의 다른 글
[Linux]VM에 Disk 추가 시 재부팅 없이 추가된 Disk 를 인식 시키는 방법 (0) | 2018.11.03 |
---|---|
[Linux] Disk 관련 RAID 및 JBOD 정리 (0) | 2018.10.18 |
[Linux] systemctl status 실행 시 state : degraded 경우 해결법 (0) | 2018.07.19 |
[Linux] HPE 스마트 스토리지 관리자(HPE SSA) CLI 를 활용한 서버 Disk 상태 확인 (0) | 2018.07.19 |
[Linux]sudo 명령어 수행 시 sudo: sorry, you must have a tty to run do Error가 발생할 때 해결 방안 (0) | 2018.07.09 |