服务器配置
yum repository: yum repo,存储了众多rpm包,以及包的相关的元数据文件(放置于特定目录repodata下)
文件服务器:主要讨论http:// 建立
https:// ftp:// file://
1.配置selinux并关闭,手动更改/etc/selinux/config 文件。将SELINUX=enforcing改为SELINUX=premissve,使用命令进行更换:
sed -i.bak 's/SELINUX=enforcing/SELINUX=permissve/' /etc/selinux/config
并输入setenforce 0
2.关闭防火墙
systemctl stop firewalld (systemctl disable firewalld )建议开机启动
使用iptables -vnL查询是否关闭防火墙
3.启动httpd服务:
systemctl start httpd
systemctl enable httpd 开机自启动
这里有些不能启动httpd的,可以尝试service httpd start
4.建立仓库:
cd /var/www/html #来到httpd仓库目录
mkdir centos/{7,6}/os/x86_64/ -pv #建立分仓centos6&7
mount /dev/sr0 centos/6/os/x86_64/
mount /dev/sr1 centos/7/os/x86_64/ #挂载光盘到repodata父目录
#sr0为挂载的centos6的光盘
#sr1为挂载cenos7的光盘
手动添加光盘,挂载centos7.4,
默认服务器光盘为centos6.9
至此,yum仓库基本建立完毕。
客户端配置
- yum客户端配置文件: /etc/yum.conf:为所有仓库提供公共配置 /etc/yum.repos.d/.repo:为仓库的指向提供配置 仓库指向的定义: [repositoryID] name=Some name for this repository baseurl=url://path/to/repository/* enabled={1|0} gpgcheck={1|0} gpgkey=URL enablegroups={1|0} failovermethod={roundrobin|priority} roundrobin:意为随机挑选,默认值 priority:按顺序访问 cost= 默认为1000 简单配置如图: *[base] name=http centos baseurl=file:///var/www/html/centos/$releasever/os/$basearch gpgcheck=0 上图的url,$releasever为centos版本号6&7,$basearch为基础平台:x86_64 gpgcheck检测yum源。 baseurl=file:///var/www/html/centos/$releasever/os/$basearch, 若配置环境不是和服务器同台设备,则baseurl配置如下: baseurl=http://服务器IP/centos/$releasever/os/$basearch 接引道人于20180419 介于水平有限,会根据相关所学知识慢慢修正。