标签:ref httpd 客户 htm stat 客户端 pki get prim
服务器IP地址:192.168.0.213构建本地源的步骤
1.yum源文件下载
(1)下载必要工具:
[root@oracle-2 ]# yum -y install wget
[root@oracle-2 ]# yum -y install createrepo
(2)下载yum源到本地:
[root@oracle-2 ~]# mkdir -p /wget-yum
[root@oracle-2 ~]# cd /wget-yum/
下载centos源:
[root@oracle-2 wget-yum]# wget -S -c -r -np -L http://mirrors.sohu.com/centos/7/
下载foreman源:
[root@oracle-2 wget-yum]# wget -S -c -r -np -L?http://yum.theforeman.org/plugins/1.5/el6/
下载epel源:
[root@oracle-2 wget-yum]# wget -S -c -r -np -L?http://mirrors.yun-idc.com/epel/7/
下载puppetlabs源:
[root@oracle-2 wget-yum]# wget -S -c -r -np -L?https://yum.puppetlabs.com/el/7
下载openstack源:
[root@oracle-2 wget-yum]# https://repos.fedorapeople.org/repos/openstack/openstack-ocata/
(3)删除不需要的软件包和文件:
[root@oracle-2 wget-yum]# find ./ -name index.html* | xargs rm -rf
[root@oracle-2 wget-yum]# find ./ -name i386 | xargs rm -rf
(4)调整目录结构:
[root@oracle-2 wget-yum]# mkdir foreman
[root@oracle-2 wget-yum]# mv yum.theforeman.org/plugins/ foreman/
[root@oracle-2 wget-yum]# mv yum.theforeman.org/releases/ foreman/
[root@oracle-2 wget-yum]# rm -rf yum.theforeman.org/
[root@oracle-2 wget-yum]# mv mirrors.yun-idc.com/epel/ ./
[root@oracle-2 wget-yum]# rm -rf mirrors.yun-idc.com/
[root@oracle-2 wget-yum]# mkdir puppetlabs
[root@oracle-2 wget-yum]# mv yum.puppetlabs.com/el/ puppetlabs/
[root@oracle-2 wget-yum]# rm -rf yum.puppetlabs.com/
[root@oracle-2 wget-yum]# mv repos.fedorapeople.org/repos/openstack/ ./
[root@oracle-2 wget-yum]# rm -rf repos.fedorapeople.org/
2.http安装和配置:
[root@oracle-2 ]# yum -y install httpd
[root@oracle-2 ]# /etc/init.d/httpd start
[root@oracle-2 ]# cd /var/www/html/
[root@oracle-2 html]# ln -s /wget-yum/ /var/www/html/
[root@oracle-2 html]# createrepo /var/www/html/
测试
用浏览器进行访问http://192.168.0.213/wget-yum/ 由于我这边用的内网服务器为192.168.0.213
3.编写repo文件
[root@oracle-2 html]# cd /etc/yum.repos.d/
[root@oracle-2 yum.repos.d]# vi centos.repo
[openstack]
name=CentOS-openstack
baseurl=file:///wget-yum/
gpgcheck=0
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
[root@oracle-2 yum.repos.d]# yum clean all 清除yum缓存
[root@oracle-2 yum.repos.d]# yum repolist 重新获取yum源的列表
Loaded plugins: fastestmirror, refresh-packagekit
Determining fastest mirrors
openstack | 3.0 kB 00:00 ...
openstack/primary_db | 54 MB 00:06 ...
repo id repo name status
openstack CentOS-openstack 86,519
repolist: 86,519
客户端配置yum源
1.配置repo文件
[root@controller ~]# cd /etc/yum.repos.d/
[root@controller yum.repos.d]# vi centos.repo
[openstack]
name=CentOS-openstack
baseurl=http://192.168.0.213/wget-yum/
gpgcheck=0
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
~
[root@controller yum.repos.d]# yum clean all 清除yum缓存
[root@controller yum.repos.d]# yum repolist 重新获取yum源的数据
标签:ref httpd 客户 htm stat 客户端 pki get prim
原文地址:https://blog.51cto.com/343614597/2419067