1.安装httpd和createrepo
安装包下载地址:https://rpmfind.net/linux/rpm2html/search.PHP
httpd正确安装顺序如下:
mailcap-2.1.41-2.el7.noarch.rpm
apr-1.4.8-3.el7.x86_64.rpm
apr-util-1.5.2-6.el7.x86_64.rpm
httpd-tools-2.4.6-45.el7.centos.x86_64.rpm
httpd-2.4.6-80.el7.centos.x86_64.rpm
createrepo正确安装顺序如下:
deltarpm-3.6-3.el7.x86_64.rpm
python-deltarpm-3.6-3.el7.x86_64.rpm
createrepo-0.9.9-28.el7.noarch.rpm
2.拷贝所有rpm到特定目录
rpm安装包下载地址:https://buildlogs.centos.org/rolling/7/isos/x86_64/?C=M;O=A
我当时下载的是这个:https://buildlogs.centos.org/rolling/7/isos/x86_64/CentOS-7-x86_64-Everything.iso
在 /var/www/html目录下建立localrepo文件夹 将ios解压出来的Packages下的rpm包全部拷贝进去
3.执行createrepo生成索引
createrepo /var/www/html/localrepo
4.配置httpd(指向repo所在目录,默认即是/var/www/html 所以不需要配置了),启动httpd
参考地址:http://www.jb51.net/article/97434.htm
systemctl start httpd
systemctl enable httpdfirewall-cmd --add-service=http --permanent
firewall-cmd --reload
5.通过浏览器访问http服务,看看结构对不对
http://ip/localrepo
参考:http://www.osetc.com/archives/1406.html