使用centos搭建内网的yum源

1.安装httpd服务

2.启动服务,设置开机自启

复制代码
#启动服务
systemctl start httpd
# 设置开机自动启动
systemctl enable httpd
systemctl status httpd

3.新建一个目录,将rpm文件放到该目录下

4.将/etc/httpd/conf/httpd.conf文件中的DocumentRoot "/var/www/html"和<Directory "/var/www/html">修改成数据盘的目录位置,并执行命令chmod -R 755 "新路径"

5.安装createrepo命令

6.切换到对应目录下,执行命令createrepo .

注:centos5执行:createrepo -s sha1 .

centos6、7执行:createrepo .

centos6、7使用sha256 作为hash 算法 ,在centos5中 默认使用的是sha 作为hash 算法。

7.查看此时多了个repodata的文件,说明执行成功

8.网页端访问

注意:永久关闭selinux和防火墙

复制代码
#systemctl stop firewalld
#systemctl disable firewalld

9.在需要升级内核的机器上制作本地yum源

复制代码
cat >>CentOS-kernel.repo<<EOF

[kernel]
name=CentOS-7 - Kernel
baseurl=http://10.0.131.38/CentOS7/
gpgcheck=0
enabled=1
EOF

10.生成yum源

11.查看repolist的情况

相关推荐
caicai_xiaobai几秒前
Ubuntu上Git安装步骤
linux·git·ubuntu
平行云11 分钟前
实时云渲染平台数据通道,支持3D应用文件上传下载分享无缝交互
linux·unity·云原生·ue5·gpu算力·实时云渲染·像素流送
谪星·阿凯24 分钟前
Linux提权全攻略博客
linux·运维·服务器·网络安全
风度前端25 分钟前
阿里云宝塔面板部署https证书
linux·后端·https
Yeats_Liao27 分钟前
物联网接入层技术剖析(二):epoll到底是怎么工作的
java·linux·网络·物联网·信息与通信
Donk_6735 分钟前
什么是虚拟化
linux·运维
Shadow(⊙o⊙)36 分钟前
Shell进程替换,自定义Shell解释器——字符串库函数灵活操作!
linux·运维·服务器·开发语言·c++·学习
IT大白鼠37 分钟前
2019年Cloudflare全球宕机事件技术分析:正则表达式回溯失控与互联网基础设施脆弱性研究
运维·正则表达式·去中心化
funnycoffee12337 分钟前
华为S5736交换机3层ECMP负载方式
linux·服务器·数据库
SparkleN.1 小时前
/tmp/cargo/env:No such file or directory
运维·服务器