Redhat 8.7 基于http的网络yum仓库服务搭建

Redhat 8.7 基于http的网络yum仓库服务搭建

基于file://文件服务器搭建的yum仓库,只能实现本机操作。
要实现用户跨网络的方式访问远程主机的数据,并进行相关操作,则需要搭建基于网络的服务。
例如搭建一个http服务。

安装httpd,启动httpd服务

yum -y install httpd
systemctl stop firewalld
systemctl start httpd
systemctl status httpd

在这里插入图片描述

拷贝ISO包

把ISO包中的AppStreamBaseOS拷贝到**/ISO/rhel/8.7**

[root@control-220 8.7]# pwd
/ISO/rhel/8.7
[root@control-220 8.7]# ll -h
total 0
drwxr-xr-x. 4 root root 38 Aug  9 16:22 AppStream
drwxr-xr-x. 4 root root 38 Aug  9 16:24 BaseOS

创建软链接,/var/www/html指向/ISO

ln -s  /ISO/  /var/www/html/

此时,通过浏览器访问 ip/ISO,可以链接到/ISO目录中
在这里插入图片描述

测试

在一台新Server上,配置yum配置文件,使用刚才搭建的基于http服务的yum源

[root@node1-221 ~]# cd /etc/yum.repos.d/
[root@node1-221 yum.repos.d]# ll
total 4
-rw-r--r--. 1 root root 194 Aug  9 17:05 redhat.repo
[root@node1-221 yum.repos.d]# cat redhat.repo 
[appstream]
name=appstream
baseurl=http://10.112.37.220/ISO/rhel/8.7/AppStream/
gpgcheck=0
enabled=1

[baseos]
name=baseos
baseurl=http://10.112.37.220/ISO/rhel/8.7/BaseOS/
gpgcheck=0
enabled=1

安装net-tools包,验证yum源是否正常

[root@node1-221 yum.repos.d]# yum repolist
Updating Subscription Management repositories.
Unable to read consumer identity

This system is not registered with an entitlement server. You can use subscription-manager to register.

repo id                                                                                         repo name
appstream                                                                                       appstream
baseos                                                                                          baseos
[root@node1-221 yum.repos.d]# yum -y install net-tools
Updating Subscription Management repositories.
Unable to read consumer identity

This system is not registered with an entitlement server. You can use subscription-manager to register.

appstream                                                                                                                                                       49 MB/s | 7.8 MB     00:00    
baseos                                                                                                                                                          26 MB/s | 2.4 MB     00:00    
Dependencies resolved.
===============================================================================================================================================================================================
 Package                                    Architecture                            Version                                                      Repository                               Size
===============================================================================================================================================================================================
Installing:
 net-tools                                  x86_64                                  2.0-0.52.20160912git.el8                                     baseos                                  322 k

Transaction Summary
===============================================================================================================================================================================================
Install  1 Package

Total download size: 322 k
Installed size: 942 k
Downloading Packages:
net-tools-2.0-0.52.20160912git.el8.x86_64.rpm                                                                                                                   53 MB/s | 322 kB     00:00    
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                                                                           31 MB/s | 322 kB     00:00     
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                                                                                                                                       1/1 
  Installing       : net-tools-2.0-0.52.20160912git.el8.x86_64                                                                                                                             1/1 
  Running scriptlet: net-tools-2.0-0.52.20160912git.el8.x86_64                                                                                                                             1/1 
  Verifying        : net-tools-2.0-0.52.20160912git.el8.x86_64                                                                                                                             1/1 
Installed products updated.

Installed:
  net-tools-2.0-0.52.20160912git.el8.x86_64                                                                                                                                                    

Complete!
[root@node1-221 yum.repos.d]# 

正常工作!结束!

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值