day17-搭建网络仓库

搭建网络仓库

服务端 10.0.0.200

1.准备软件包
#1.挂载光盘
mount /dev/cdrom /mnt
2.通过ftp共享软件包存放的目录
[root@localhost ~]# yum install vsftpd -y 
[root@localhost ~]# systemctl start vsftpd 
[root@localhost ~]# systemctl stop firewalld 
[root@localhost ~]# setenforce 0
3.将光盘中的软件包都拷贝至ftp的共享目录下
[root@localhost ~]# mkdir /var/ftp/centos7/ 
[root@localhost ~]# find /mnt/ -type f -name "*.rpm" - exec cp {} /var/ftp/centos7/ \;
4.将共享的目录设置成yum仓库
[root@localhsot ~]# yum install createrepo -y
[root@localhost ~]# createrepo /var/ftp/centos7/

5.客户端 10.0.0.201

1.关闭所有的公网yum仓库
[root@test1]# gzip /etc/yum.repos.d/*
2.新建一个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
3.测试是否能正常安装软件
[root@test1 ~]# yum install httpd -y
4.添加zabbix仓库
[root@localhosts ~]# mkdir /var/ftp/zabbix

[root@localhosts ~]# wget -i https://mirrors.aliyun.com/zabbix/zabbix/4.0/rhel/7/x86_64

# 将zabbix目录生成为一个yum仓库 
[root@oldboy ~]# createrepo /var/ftp/zabbix/

# zabbix还缺少的四个软件包 
wget http://repo.zabbix.com/non- supported/rhel/7/x86_64/fping-3.10-1.el7.x86_64.rpm 
wget http://repo.zabbix.com/non- supported/rhel/7/x86_64/iksemel-1.4- 2.el7.centos.x86_64.rpm 
wget http://repo.zabbix.com/non- supported/rhel/7/x86_64/iksemel-devel-1.4- 2.el7.centos.x86_64.rpm 
wget http://repo.zabbix.com/non- supported/rhel/7/x86_64/iksemel-utils-1.4- 2.el7.centos.x86_64.rpm
5.客户端新建一个repo文件指向服务端提供的zabbix仓库 10.0.0.201
[root@test1 ~]# 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
6.客户端测试zabbix仓库是否可用
[root@test1 ~]# yum clean all 
[root@test1 ~]# yum install zabbix-agent 
[root@test1 ~]# yum install zabbix-get 
[root@test1 ~]# yum install zabbix-server

源码安装软件

[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

#测试
ln -s /usr/local/nginx-1.16/ /usr/local/nginx /usr/local/nginx/sbin/nginx

你可能感兴趣的:(day17-搭建网络仓库)