linux-基础服务

yum源转发

2021-08-10  本文已影响0人  宇晨棒棒的

1.编写新yum源:

vim   Centos-Base.repo

[base]

name=Centos-Base.repo

baseurl=http://mirror.centos.org/centos/7/os/x86_64

gpgcheck=1

gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-7

2.安装nginx服务:

安装nginx详见:https://www.jianshu.com/p/2c15c00a29f5

                           https://www.jianshu.com/p/b0643a45179f

配置nginx代理:

server {

listen 8903;

max_ranges 1;

server_tokens off;

location / {

proxy_pass http://mirror.centos.org;

}

}

启动nginx服务

3.修改yum配置文件:

vim /etc/yum.conf       

需要注意   proxy=http://ip:8903,这里是配置nginx代理的ip和端口,就是可出公网的那台服务器的nginx端口

4.测试安装软件,出现下载依赖文件,就可以了

测试截图
上一篇 下一篇

猜你喜欢

热点阅读