①安裝httpd并啟動
yum -y install httpd
chkconfig httpd on
service httpd start
②關閉防火牆或端口放行
service iptables stop
③挂載centos安裝鏡像并将鏡像中檔案拷貝至指定目錄(或将其挂載在指定目錄/軟連接配接)
mount /iso/CentOS-6.9-x86_64-bin-DVD1.iso /mnt/cdron
mkdir/var/www/html/centos6.9-yum
cp -r /mnt/cdrom/* /var/www/html/centos6.9-yum
④ 将區域網路下其他伺服器更改yum源配置檔案
更改/etc/yum.repos.d下檔案
name=CentOS-$releasever - LAN
baseurl=http://node02/centos6.9-yum/
gpgcheck=0
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
⑤yum測試
yum clean all
yum repolist