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

相关推荐
jarreyer2 小时前
【AI Agent】大模型自动化载体
运维·自动化
xixingzhe22 小时前
SpringBoot + Nginx 免鉴权接口安全防护方案
运维·nginx·安全
翼龙云_cloud3 小时前
阿里云国际代理商:阿里云 ECS 全维度监控配置教程
运维·阿里云·云计算·监控
笑锝没心没肺3 小时前
fail2ban工具安装配置及使用
linux·运维·服务器
zt1985q5 小时前
本地部署开源智能家居集成平台 ioBroker 并实现外部访问( Windows 版本)
运维·服务器·智能家居
大卡片5 小时前
linux内核驱动开发
linux·运维·驱动开发
心心喵6 小时前
[linux] nohup和pm2的区别 进程保活
linux·运维·服务器
NGINX开源社区7 小时前
F5 NGINX Ingress Controller 5.3.0 新增功能
运维
醉熏的石头7 小时前
Ubuntu 中的编程语言(中)
linux·ubuntu·scala
SelectDB8 小时前
Apache Doris 在 AgentLogsBench 中领先,支撑 Agent 可观测性生产负载
运维·数据库·agent