linux 搭建epel本地库,并定时同步

1、安装rsync
yum -y install rsync.x86_64

2、同步epel至本地
#http://mirrors.ustc.edu.cn/status/ 获取镜像库rsync路径
mkdir -p /data/yum/epel/
#将这个同步命令定时执行,可以同步epel库信息至本地
/usr/bin/rsync -avrt rsync://dl.fedoraproject.org/fedora-epel/ /data/yum/epel/

 

3、搭建http,并提供服务
yum -y install httpd
sed -i 's/^#ServerName www.example.com:80/ServerName 0.0.0.0:80/g' /etc/httpd/conf/httpd.conf

#将/data/yum/epel/ 软连至/var/www/html目录
ln -s /data/yum/epel/ /var/www/html

chkconfig httpd on
/etc/init.d/httpd start

posted @ 2017-01-25 18:23  hufangrui  阅读(1574)  评论(0编辑  收藏  举报