通过httpd和ftp方式配置企业私有yum源

配置centos8本地yum源

yum的一切配置信息都存储在一个叫yum.repos.d的配置文件中,通常位于/etc/yum.repos.d目录下,在centos8光盘镜像中把yum源分成了两部分,一个是BaseOS,一个是AppStream,在centos8中,统一的ISO自动加载BaseOS和AppStream安装源存储库,已经存在于光盘链接中,只不过要分别去配置.repo文件。
首先进入yum.repos.d路径
[root@centos8 ~]# cd /etc/yum.repos.d
创建备份文件夹
[root@centos8 ~]# mkdir /bak
将系统自带的官方yum源移动到备份文件夹
[root@centos8 yum.repos.d]# mv /etc/yum.repos.d/* /bak
然后编辑本地yum源文件
[root@centos8 yum.repos.d]# vi centos8.repo
[root@centos8 yum.repos.d]# cat centos8.repo
内容如下

[c8-BaseOs]
name=centos-BasOS
baseurl=file:///mnt/BaseOS
gpgcheck=0
enabled=1

[c8-AppStream]
name=centos=-AppStream
baseurl=file:///mnt/AppStream
gpgcheck=0
enabled=1

在根目录创建挂载目录并将光盘挂载到该目录
[root@centos8 /]# mkdir mnt
[root@centos8 /]# mount /dev/sr2 /mnt
mount: /mnt: WARNING: device write-protected, mounted read-only.

通过http方式配置软件仓库

选择三台不同版本的镜像文件布置的操作系统,将其中一台服务器作为公共软件仓库,其它两台服务器可以访问当前服务器下载所需软件包,本次将centos8服务器作为共有yum源。
centos8 192.168.221.138
centos7 192.168.221.137
centos6 192.168.221.136
将centos7和centos6镜像都挂载到centos8中,如下图
在这里插入图片描述

centos8服务器配置

下载httpd软件包
[root@centos8 ~]# yum install -y httpd
启动httpd服务
[root@centos8 ~]# systemctl enable --now httpd

禁用防火墙
systemctl stop firewalld(暂时关闭)
systemctl disable firewalld(永久关闭,重启后生效)
systemctl status firewalld(查看防火墙状态

禁用selinux
setenforce 0 (临时关闭)
vi /etc/sysconfig/selinux(将selinux=e

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值