当前位置: 首页 > news >正文

ftp方式和http方式搭建云仓库

1.搭建阿里云仓库

国外云仓库比较慢,可以使用阿里云仓库代替

1.服务端和客户端切换到 yum.repo.d 目录 将自带的仓库移走

[root@localhost ~] cd /etc/yum.repos.d/
[root@localhost yum.repos.d] mkdir bak
[root@localhost yum.repos.d] mv *.repo bak/
[root@localhost yum.repos.d] ls
bak
vim ali.repo

2.新建aliyun仓库

[ali]
name=aliyun
#baseurl=https://mirrors.aliyun.com/centos/7/os/x86_64/                  //开启哪个都可以正常使用,这边主要解释变量的作用
baseurl=https://mirrors.aliyun.com/centos/$releasever/os/$basearch/    //变量参见主配置文件2.1小节
gpgcheck=0[epel]                                                                //epel源仓库
name=epel
baseurl=https://mirrors.aliyun.com/centos/7/extras/x86_64/
gpgcheck=0[update]                                                             //更新包仓库
name=update
baseurl=https://mirrors.aliyun.com/centos/7/updates/x86_64/
gpgcheck=0#小火车
[root@centos7 ~]#yum -y install epel-release
[root@centos7 ~]#yum -y install sl
[root@centos7 ~]#sl -a#牛
[root@localhost ~]#yum install -y install cowsay
[root@localhost ~]#cowsay hello

2.ftp方式搭建云仓库

1.服务端安装vsftp服务

systemctl stop firewalld
setenforce 0
yum install vsftpd.x86_64 -y
systemctl start vsftpd

2.服务端切换到 ftp目录下新建一个centos7目录,将光驱挂载到该目录下

cd /var/ftp/
mkdir centos7 
mount /dev/sr0 /var/ftp/centos7

3.客户端安装ftp 服务并启动关闭防火墙和selinux

 yum install ftp -ysystemctl stop firewalld.servicesetenforce 0systemctl start ftpftp 192.168.91.100#测试ftp服务是否正常

4编写yum仓库文件

vim centos7.repo[centos7]
name=centos7
baseurl=ftp://192.168.91.100/centos7
gpgcheck=0yum clean all
yum makecache

3.http方式搭建云仓库

1.服务端安装httpd服务,将光驱挂载到httpd服务文件夹下

systemctl stop firewalld
setenforce 0
yum install httpd -y
systemctl start httpd
mkdir /var/www/html/centos7
mount /dev/sr0 /var/www/html/centos7

3.客户端安装httpd服务关闭防火墙并且建立yum仓库

systemctl stop firewalld
setenforce 0
yum install httpd -y
systemctl start httpdcd /etc/yum.repos.d
mkdir bak
mv *.repo bak
vim http.repo[http]
name=http
baseurl=http://192.168.91.100/centos7
gpgcheck=0yum clean all
yum makecache
http://www.lryc.cn/news/344368.html

相关文章:

  • vue2 + antvx6 实现流程图功能
  • IDEA 中的奇技淫巧
  • LSTM-KDE的长短期记忆神经网络结合核密度估计多变量回归区间预测(Matlab)
  • CMakeLists.txt语法规则:部分常用命令说明三
  • android init进程启动流程
  • 利用爬虫解决数据采集难题
  • 智慧粮库/粮仓视频监管系统:AI视频智能监测保障储粮安全
  • 经验浅谈!伦敦银如何交易?
  • 信息系统项目管理师(高项)_习题杂记
  • CMakeLists.txt 简单的语法介绍
  • AI时代:人工智能大模型引领科技创造新时代
  • 为什么 IP 地址通常以 192.168 开头?(精简版)
  • 【HEC】HECRAS中的降雨边界
  • 搜索算法系列之三(插值查找)
  • 前端奇怪面试题总结
  • NPM--最新淘宝镜像源地址
  • vue3中实现地区下拉选择组件封装
  • 责任链模式案例
  • Android NDK开发(二)——JNIEnv、jobject与jclass关系
  • 机器学习入门:sklearn基础教程
  • 26 | 备库为什么会延迟好几个小时?
  • linux 如何解压.tar 文件
  • 盘点企业信息防泄密软件对比|揭秘企业信息防泄密软件好用榜
  • html--瀑布效果
  • vue视图不刷新强制更新数据this.$forceUpdate()
  • 2024年电工杯数学建模竞赛A题B题思路代码分享
  • leetcode 797.所有可能的路径
  • NPM 基础
  • WPF之创建无外观控件
  • MySQL利用变量进行查询操作