YUM repository 구축 – online

폐쇄망, 사내 활용 등을 위한 yum repository를 구축한다.
local repository 구축과 특별히 다른 점은 없다. 단지 웹(http, https) 을 통한 접근을 허용하는 경로를 추가하는 것으로 구축이 가능하다.
웹 서버가 구축 되어있어야 한다.

http 디렉토리를 확인하고 그곳에 리포지터리 파일을 복사한다.

[root@class14 ~]# vi /etc/httpd/conf/httpd.conf
 # 다음 내용을 찾는다.
#
# DocumentRoot: The directory out of which you will serve your
# documents. By default, all requests are taken from this directory, but
# symbolic links and aliases may be used to point to other locations.
#
DocumentRoot "/var/www/html"

#
# Relax access to content within /var/www.
#
<Directory "/var/www">
    AllowOverride None
    # Allow open access:
    Require all granted
</Directory>

생성한 repodata 디렉토리가 있는 디렉토리를 /var/www/html 에 복사한다.
이전 포스트에서 /home/repo-data/ 에 rpm 패키지를 넣고 repodata를 생성했었다.

[root@class14 ~]# cp -r /home/repo-data /var/www/html
 # 또는 심볼릭 링크를 만들어준다.
[root@class14 ~]# ln -s /home/repo-data /var/www/html/repo-data

repo 파일 생성
※ local repository에 대한 repo 파일을 만드는 것과 다르지 않다. url만 다를 뿐이다.

[centos:/home:]# vi /etc/yum.repos.d/haedongg_net.repo
 #여기부터 붙여넣기 한다.
[haedong_net-repo]
name=haedongg_net-repo
baseurl=http://www.haedongg.net/repo-data
 # createrepo 명령으로 생성된 repodata 가 있는 디렉토리를 지정한다.
 # http로 시작하는 것에 유의하자. 
enabled=1
gpgcheck=0

댓글 남기기