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

相关推荐
筝筝ba16 分钟前
linux 查询当前登录的用户数量
linux·服务器·网络
ShiXZ21327 分钟前
网络调试四剑客:ping / telnet / nc / netstat 速查指令集
运维·开发语言·网络·php
小五传输35 分钟前
Serv-U替代方案怎么选?政务机关文件安全传输对比与迁移指南
大数据·运维·安全
woniu_buhui_fei43 分钟前
日常工作常用的命令(Linux+JDK)
linux·运维·服务器
snow@li1 小时前
Telnet 全景教程:全平台安装、命令使用、故障排查与安全规范
运维·网络
coward911 小时前
全志T507 (sun50iw9p1)sunxi pinctrl 子系统实现分析
linux·嵌入式硬件
Bruce_Liuxiaowei1 小时前
自动化渗透测试——用AI构建自动化渗透测试流程
运维·人工智能·自动化
OnlineProxy1 小时前
如何在无需手机号的情况下创建 Google 账号:高信任度代理(High Trust Score Proxy)如何取代短信验证
运维·服务器·facebook
imaol11 小时前
文件编程--标准IO
linux·运维·算法
梦想的旅途21 小时前
企业微信SCRM怎么对接API?私域自动化常用接口清单
运维·自动化·企业微信