服务端:10.0.0.200
- 准备软件包(1.光盘 2.缓存 3.联网下载 4.同步)挂载光盘
[root@oldboy ~]# /dev/cdrom /mnt
通过ftp共享软件包存放的目录
[root@oldboy ~]# yum install vsftpd -y
[root@oldboy ~]# systemctl start vsftpd
[root@oldboy ~]# systemctl stop firewalld
[root@oldboy ~]# setenforce 0
将光盘中的软件包拷贝至ftp的共享目录下
[root@oldboy ~]# mkdir /var/ftp/centos7/
[root@oldboy ~]# find /mnt/ -type f -name "*.rpm" - exec cp {}/var/ftp/centos7/ \;
将共享的目录设置成yum仓库
[root@oldboy ~]# yum install createrepo -y
[root@oldboy ~]# createrepo /var/ftp/centos7/
客户端:10.0.0.199
- 关闭所有的公网yum仓库
[root@oldboy-199 yum.repos.d]# gzip /etc/yum.repos.d/*
新建一个repo文件,文件中的baseurl指向服务端
[root@oldboy-199 ~]# cat /etc/yum.repos.d/ftp- centos7.repo
[ftp-centos7]
name = This is Base Repo
baseurl = ftp://10.0.0.200/centos7/
enable = 1
gpgcheck = 0
测试是否能正常安装软件
[root@oldboy-199 ~]# yum install httpd -y
如果客户端需要通过共享的仓库安装zabbix软件? 怎么办?
1/ 服务端 需要提供zabbix软件相关的仓库 10.0.0.200
[root@oldboy ~]# mkdir /var/ftp/zabbix
获取zabbix的软件包
[root@oldboy ~]# curl https://mirrors.aliyun.com/zabbix/zabbix/4.0/rhel/7/x86_64/ > zabbix_1.txt
[root@oldboy ~]# vim zabbix_1.txt
[root@oldboy ~]# grep "<a href" zabbix_1.txt
[root@oldboy ~]# grep "<a href" zabbix_1.txt | awk -F '"' '{print $2}'
[root@oldboy ~]# grep "<a href" zabbix_1.txt | awk -F '"' '{print $2}' > zabbix_2.txt
[root@oldboy ~]# grep "<a href" zabbix_1.txt | awk -F '"' '{print "https://mirrors.aliyun.com/zabbix/zabbix/4.0/rhel/7/x86_64/"$2}'
[root@oldboy ~]# grep "<a href" zabbix_1.txt | awk -F '"' '{print "wget https://mirrors.aliyun.com/zabbix/zabbix/4.0/rhel/7/x86_64/"$2}'
[root@oldboy ~]# grep "<a href" zabbix_1.txt | awk -F '"' '{print "wget https://mirrors.aliyun.com/zabbix/zabbix/4.0/rhel/7/x86_64/"$2}' > zabbix_3.txt
[root@oldboy ~]# chmod +x zabbix_3.txt
[root@oldboy ~]# ./zabbix_3.txt
找到软件包 放到相关仓库里面
[root@oldboy ~]# find ./ -type f -name "*.rpm" -exec mv {} /var/ftp/zabbix/ \;
[root@oldboy ~]# wget http://repo.zabbix.com/non- supported/rhel/7/x86_64/fping-3.10-1.el7.x86_64.rpm
[root@oldboy ~]# wget http://repo.zabbix.com/non- supported/rhel/7/x86_64/iksemel-1.4- 2.el7.centos.x86_64.rpm
[root@oldboy ~]# wget http://repo.zabbix.com/non- supported/rhel/7/x86_64/iksemel-devel-1.4- 2.el7.centos.x86_64.rpm
[root@oldboy ~]# wget http://repo.zabbix.com/non- supported/rhel/7/x86_64/iksemel-utils-1.4- 2.el7.centos.x86_64.rpm
将zabbix目录生成为一个yum仓库
[root@oldboy ~]# createrepo /var/ftp/zabbix/
2/ 客户端新建一个repo文件指向服务端提供的zabbix仓库
[root@oldboy-199 ~]# cat /etc/yum.repos.d/ftp- zabbix.repo
[ftp-zabbix] name = ftp share zabbix repo
baseurl = ftp://10.0.0.200/zabbix/
enable = 1
gpgcheck = 0
3/客户端测试zabbix仓库是否可用
[root@oldboy-199 ~]# yum clean all
[root@oldboy-199 ~]# yum install zabbix-agent
[root@oldboy-199 ~]# yum install zabbix-get
[root@oldboy-199 ~]# yum install zabbix-server
源码包管理
congiure 生成makefile文件
[root@oldboy nginx-1.16.1]# ./configure -- prefix=/usr/local/nginx-1.16 --with-http_mp4_module
[root@oldboy nginx-1.16.1]# yum install pcre pcre- devel -y
[root@oldboy nginx-1.16.1]# yum install zlib zlib- devel -y
编译
[root@oldboy nginx-1.16.1]# make
安装
[root@oldboy nginx-1.16.1]# make install
测试
[root@oldboy nginx-1.16.1]# -s /usr/local/nginx-1.16/ /usr/local/nginx /usr/local/nginx/sbin/nginx
最后浏览器访问该服务器的ip地址即可
image.png