- 虛擬機環境:
- node1:192.168.1.10
- 利用鏡像搭建本地軟件倉庫
- 安裝共享軟件
- 共享方式:http:// 超文本傳輸協議
- 提供此協議的軟件: Apache
- 軟件包名稱: httpd
- 共享位置:
/var/www/html
- 安裝命令 在node1:
dnf install httpd -y
- 啓用共享軟件Apache
systemctl stop firewalld
systemctl disable firewalld
systemctl enable --now httpd
4. 建立共享目錄
- rhel_8是自己建立的目錄,名字可以隨意
mkdir /var/www/html/rhel_8
- 掛載鏡像到共享目錄
- 當鏡像在系統中存在
mount /xxxxxxx.iso /var/www/html/rhel_8
- 當使用光驅讀取鏡像
mount /dev/cdrom /var/www/html/rhel_8
- 在開機時自動掛載
vim /etc/rc.d/rc.local
mount /dev/cdrom /var/www/html/rhel_8
chmod 755 /etc/rc.d/rc.local
- 在遠程主機node2中訪問資源並書寫repo文件
vim /etc/yum.repos.d/westos.repo
[AppStream]
name=AppStream
baseurl=http://192.168.1.10/rhel_8/AppStream/
gpgcheck=0
[BaseOS]
name=BaseOS
baseurl=http://192.168.1.10/rhel_8/BaseOS/
gpgcheck=0