使用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的情况

相关推荐
Dxy12393102166 小时前
Linux 编译安装 Python 3.12.10(多版本共存,不破坏系统Python)
linux·运维·python
技术深耕者6 小时前
AI Agent从演示到生产:企业进入“自动化层”时代
运维·人工智能·自动化
xz驱动分享7 小时前
Linux DMA 子系统学习笔记
linux·dma·rk3588·嵌入式软件
w67820078 小时前
Prisma不能优雅的支持DTO,试试Vona ORM吧
linux·运维·ubuntu
APItesterCris8 小时前
Open Claw 实战教程:5 分钟搭建京东商品自动化监控与数据分析系统
大数据·运维·数据库·数据仓库·自动化
Darkwanderor8 小时前
Linux系统编程实战项目:模拟实现shell
linux·c++
杨某不才10 小时前
如何能让Linux服务器对shell 终端 + sftp 文件传输长期保活
linux·运维·服务器
vance0410 小时前
免费Cloudflare隧道隐藏公网IP
linux·tcp/ip·github
三言老师11 小时前
文本工具组合统计服务器日志数据
linux·运维·服务器
m0_7436975911 小时前
DNS服务器
运维·服务器