rocky9.0本地局域网克隆yum源

# 1.安装基础命令包
[root@ansible ~]#  yum install gcc gcc-c++ python3 python3-devel python3-createrepo_c python3-libdnf python3-libmodulemd libmodulemd
# 2.安装modulemd-tools-master工具
[root@ansible ~]# yum install -y modulemd-tools-master
# 3.安装nginx
[root@ansible ~]# yum install -y nginx
# 4.删除nginx发布目录下所有文件 
[root@ansible ~]# rm -rf /usr/share/nginx/html/*
[root@ansible ~]# cd /usr/share/nginx/html/
# 5.开始克隆源
[root@ansible html]# reposync --repo=baseos
# 6.生成repodata目录
# createrepo_mod ./baseos与createrepo ./baseos一样
[root@ansible html]# createrepo_mod ./baseos
# 7.生成modules.yaml文件
[root@ansible html]# cd baseos
[root@ansible baseos]# repo2module ./
[root@ansible baseos]# ls
Packages  modules.yaml  repodata
# 8.设置nginx开机自启动
[root@ansible html]# systemctl enbale --now nginx
# 9.修改nginx配置文件
[root@ansible html]# vim /etc/nginx/nginx.conf
# yum发布页
    location / {
        root /usr/share/nginx/html;
        autoindex on;
        }
# 10.启动nginx
[root@ansible html]# systemctl start nginx
# 访问浏览器即可
  • 2
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值