<一日一学之创建实时更新yum源>
需要环境 :
1.一台linux服务器(通外网)
2.rsync 命令 yum -y install rsync
3.nginx
清华源: https://mirrors.tuna.tsinghua.edu.cn/epel/7/x86_64/
本地路径: /var/www/html/centos
nginx配置文件
server {
listen 80;
server_name localhost;
location / {
autoindex on;
root /var/www/html/centos;#配置本地存储路径
index index.html index.htm;
}
启动nginx
在linux服务器上执行
rsync -avH --delete --bwlimit=$BW_limit rsync:mirrors.tuna.tsinghua.edu.cn/epel/7/x86_64/ /var/www/html/centos
同步完成后
在客户端配置repo
[centos]
name=centos
baseurl=http://192.168.200.147
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7