1、下载createrepo、lrzsz
yum -y install createrepo lrzsz
知识兔2、下载http或者nginx
yum -y install httpd
知识兔3、配置分享网站
1 setenforce 0
2 sed -i 's/=enforcing/=disabled/g' /etc/selinux/config
3 systemctl start httpd
4 systemctl enable httpd
5 rm -rf /var/www/html/*
6 rm -rf /etc/httpd/conf.d/welcome.conf
7 firewall-cmd --add-port=81/tcp --permanent
8 firewall-cmd --add-port=82/tcp --permanent
9 firewall-cmd --reload
知识兔4、把Windows下载好的压缩包利用lrzsz放到/var/www/html并且解压:
5、进入到其中一个文件夹中
1 eg:
2 cd base
3 createrepo ./
知识兔6、yum源配置完成
配置系统yum源:
1 cat > /etc/yum.repos.d/1.repo <<EOF
2 [base]
3 name=base
4 baseurl=http://虚拟机IP/base
5 enabled=1
6 gpgcheck=0
7
8 [adv]
9 name=adv
10 baseurl=http://虚拟机IP/adv
11 enabled=1
12 gpgcheck=0
13
14 …
15 EOF
知识兔附加:
如何挖源?
(怎么把IP/base下的rpm软件放到/var/www/html下)
在/var/www/html下创建相应的文件夹
cd /var/www/html
知识兔eg:
1 mkdir base
2 vim 1.sh
3 #########
4 #!/bin/bash
5 BM=`elinks http://IP/base --dump |grep .rpm |awk '{print $2}' |grep .rpm`
6 for a in $BM
7 do
8 wget $a
9 done
10 #########
11 sh 1.sh
知识兔