服务端:10.0.0.200
1.准备软件包
挂载光盘
mount /dev/cdrom /mnt
2.通过ftp共享软件包存放的目录
[root@oldboy ~]# yum install vsftpd -y
[root@oldboy ~]# systemctl start vsftpd
[root@oldboy ~]# systemctl stop firewalld
[root@oldboy ~]# setenforce 0
3.将光盘中的软件包都拷贝至ftp的共享目录下
[root@oldboy ~]# mkdir /var/ftp/centos7/
[root@oldboy ~]# find /mnt/ -type f -name "*.rpm" exec cp {} /var/ftp/centos7/ \;
4.将共享的目录设置成yum仓库
[root@oldboy ~]# yum install createrepo -y
[root@oldboy ~]# createrepo /var/ftp/centos7/
客户端 10.0.0.201
1.关闭所有的公网yum仓库
[root@oldgirl ~]# gzip /etc/yum.repos.d/
2.新建一个repo文件,文件中的baseurl指向服务端
[root@oldgirl ~]# cat /etc/yum.repos.d/ftpcentos7.repo
[ftp-centos7]
name = This is Base Repo
baseurl = ftp://10.0.0.200/centos7/
enable = 1
gpgcheck = 0
3.测试是否能正常安装软件
[root@oldgirl ~]# yum install httpd -y
如果客户端需要通过共享的仓库安装zabbix软件? 怎么办?
1.服务端需要提供zabbix软件相关的仓库 10.0.0.200
[root@oldboy ~]# mkdir /var/ftp/zabbix -------------获取zabbix的软件包--->
[root@oldboy ~]# find ./ -type f -name "*.rpm" -exec mv {} /var/ftp/zabbix/ \;
将zabbix目录生成为一个yum仓库
[root@oldboy ~]# createrepo /var/ftp/zabbix/
zabbix还缺少的四个软件包
wget http://repo.zabbix.com/nonsupported/rhel/7/x86_64/fping-3.10-1.el7.x86_64.rpm
wget http://repo.zabbix.com/nonsupported/rhel/7/x86_64/iksemel-1.42.el7.centos.x86_64.rpm
wget http://repo.zabbix.com/nonsupported/rhel/7/x86_64/iksemel-devel-1.42.el7.centos.x86_64.rpm
wget http://repo.zabbix.com/nonsupported/rhel/7/x86_64/iksemel-utils-1.42.el7.centos.x86_64.rpm
2.客户端新建一个repo文件指向服务端提供的zabbix仓库 10.0.0.201
[root@oldgirl ~]# cat /etc/yum.repos.d/ftpzabbix.repo
[ftp-zabbix]
name = ftp share zabbix repo
baseurl = ftp://10.0.0.200/zabbix/
enable = 1
gpgcheck = 0
3.客户端测试zabbix仓库是否可用
[root@oldgirl ~]# yum clean all
[root@oldgirl ~]# yum install zabbix-agent
[root@oldgirl ~]# yum install zabbix-get
[root@oldgirl ~]# 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 pcredevel -y
[root@oldboy nginx-1.16.1]# yum install zlib zlibdevel -y
编译
[root@oldboy nginx-1.16.1]# make
安装
[root@oldboy nginx-1.16.1]# make install
测试
ln -s /usr/local/nginx-1.16/ /usr/local/nginx /usr/local/nginx/sbin/nginx