且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

创建saltstack内网yum源

更新时间:2022-08-12 23:26:31

环境:yum服务器publicserver,yum客户端tomcat1、tomcat2


一、在publicserver服务器上配置yum源

1、在安装了CentOS 7服务器publicserver安装saltstack

1
2
3
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
yum install epel-release -y
yum install salt-master salt-minion salt-ssh salt-syndic salt-cloud

2、rpm包下载完后,拷贝到/mnt/cdrom/Packages目录下,/mnt/cdrom目录保存的为CentOS 7光盘文件

1
2
3
cp /var/cache/yum/x86_64/7/base/packages//mnt/cdrom/Packages
cp /var/cache/yum/x86_64/7/epel/packages//mnt/cdrom/Packages
cp /var/cache/yum/x86_64/7/updates/packages//mnt/cdrom/Packages

3、更新repodata(创建命令:createrepo /mnt/cdrom/)

1
2
yum install -y createrepo
createrepo --update /mnt/cdrom

4、配置nginx添加一个server,配置yum源

1
2
3
4
5
6
7
8
9
10
11
12
server {
        listen 80;
        server_name yum.discuz.com;
        index index.html index.html;
  
        autoindex on;
        autoindex_exact_size off;
        autoindex_localtime on;
  
    location / {
        root /mnt/cdrom;
    }

二、修改tomcat1、tomcat2的yum配置文件

1、修改文件/etc/yum.repos.d/CentOS-Base.repo

1
2
3
4
5
[base]
name=base
enabled=1
baseurl=http://yum.discuz.com
gpgcheck=0

2、更新yum

1
2
yum clean all
yum makecache




     本文转自1321385590 51CTO博客,原文链接:http://blog.51cto.com/linux10000/1893586,如需转载请自行联系原作者