环境:yum服务器publicserver,yum客户端tomcat1、tomcat2
一、在publicserver服务器上配置yum源
1、在安装了CentOS 7服务器publicserver安装saltstack
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光盘文件
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/)
yum install -y createrepo createrepo --update /mnt/cdrom
4、配置nginx添加一个server,配置yum源
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
[base]
name=base
enabled=1
baseurl=http://yum.discuz.com
gpgcheck=0
2、更新yum
yum clean all yum makecache
转载于:https://blog.51cto.com/linux10000/1893586