复制
# yum repolist
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: mirrors.aliyun.com
* extras: mirrors.aliyun.com
* updates: mirrors.aliyun.com
repo id repo name status
base/7/x86_64 CentOS-7 - Base - mirrors.aliyun.com 9,363
epel/x86_64 Extra Packages for Enterprise Linux 7 - x86_64 11,135
extras/7/x86_64 CentOS-7 - Extras - mirrors.aliyun.com 263
openstack-mitaka/7/x86_64 OpenStack Newton Repository 1,675
openstack-newton/7/x86_64 OpenStack Newton Repository 1,486
updates/7/x86_64 CentOS-7 - Updates - mirrors.aliyun.com 807
repolist: 24,729
复制
# yum install yum-utils -y #安装同步工具
# mkdir -p /opt/yum #同步目录
# reposync -d -r openstack-newton -p /opt/yum/ #开始同步,其他参数可以查看help
复制
# yum install createrepo -y #安装工具
# createrepo -v /opt/yum/openstack-newton/
复制
# yum install httpd -y
# systemctl enable httpd.service
复制
# vim /etc/httpd/conf/httpd.conf
DocumentRoot "/opt/yum" #修改此处
#
# Relax access to content within /var/www.
#
<Directory "/opt"> #修改此处
AllowOverride None
# Allow open access:
Require all granted
# Further relax access to the default document root:
<Directory "/opt/yum/"> #修改此处
复制
# systemctl restart httpd.service