yum源服务器搭建

1、安装httpd和php

yum install -y httpd

yum install -y php

我们需要手动去配置 httpd 的相关参数,配置文件的位置: /etc/httpd/conf
参数说明见下表
参数说明当前配置
ServerName服务器的地址信息http://192.168.1.100:10009
DocumentRoothttp文件服务器的下载目录/package
Listen监听的端口10009
Directory服务器文件/package(与 DocumentRoot 文件一致)

在设定的Directory下新建test.php

加开机自自动chkconfighttpd on

service httpd start

浏览器访问http://localhost:port/test.php ---ok

2、在Directory下上传/rhel-server-6.8/Packages

浏览器访问:http://localhost:port/rhel-server-6.8/Packages  ---ok

3.安装createrepo,此程序主要用于生成创建yum仓库,创建索引信息。

yum install createrepo
createrepo /data/resource/rhel-server-6.8

到这里我们已经完成了yum源服务器的配置。

可以查看在 /data/resource/rhel-server-6.8 多了repodata文件夹

4、我们到客户端进行测试:

[root@IP70-CentOS7 ~]# >>vim /etc/yum.repos.d/Local.repo

vi redhat6.8.repo

 [RedHat6.8]

name= RedHat6.8
baseurl= http://xx.xx.xx.236:11080/rhel-server-6.8/
enabled=1
gpgcheck=0

然后执行

yum clean all 

yum makecache
yum repolist

 至此配置完成。

 

转载于:https://www.cnblogs.com/zhxiaoxiao/p/10233135.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值