局域共享yum源
阿新 • • 發佈:2018-11-08
前言
如果我們管理上千臺伺服器,而不同伺服器需要不同的軟體,為了集中方便,通常只需要將yum源從主機中共享出去就可以了,這樣節省了空間,也方便了管理。
如何實行呢
1. 主機配置httpd軟體
首先httpd安裝
yum install httpd
然後開啟httpd服務
systemctl start httpd
systemctl enable httpd
再然後我們將httpd服務加到防火牆白名單中
systamctl status firewalld systemctl start firewalld firewall-cmd --permanent --add-service=http firewall-cmd --reload firewall-cmd --liast-all
從主機上在瀏覽器輸入主機IP可以看到已經成功
2. 主機共享映象
新建映象掛載目錄
mkdir /var/www/html/rhel
然後更改掛載路徑
df -h
umont /dev/loop0
mount /rhel/rhel-server-7.5-x86_64-dvd.iso /var/www/html/rhel/
df -h
3. 伺服器設定安裝源指向
在伺服器上配置yum源的配置檔案
cd /etc/yum.repo.d
ls
vim rhel_dvd.repo
新增
4. 測試
yum clean all yum repolist