1、配倉庫?
[root@localhost yum.repos.d]# vi rpm.repo
##本地倉庫標準寫法
[baseos]
name=miaoshubaseos
baseurl=/mnt/BaseOS
gpgcheck=0
[appstream]
name=miaoshuappstream
baseurl=file:///mnt/AppStream
gpgcheck=0
2、掛載
[root@localhost ~]mount? /dev/sr0?? /mnt
mount: /mnt: WARNING: source write-protected, mounted read-only.
[root@localhost ~]# ll /mnt
total 44
dr-xr-xr-x. 1 root root? 2048 Apr 20? 2022 AppStream
dr-xr-xr-x. 1 root root? 2048 Apr 20? 2022 BaseOS
dr-xr-xr-x. 1 root root? 2048 Apr 19? 2022 EFI
-r--r--r--. 1 root root? 8154 Apr 20? 2022 EULA
-r--r--r--. 1 root root? 1455 Apr 20? 2022 extra_files.json
-r--r--r--. 1 root root 18092 Apr 20? 2022 GPL
dr-xr-xr-x. 1 root root? 2048 Apr 19? 2022 images
dr-xr-xr-x. 1 root root? 2048 Apr 19? 2022 isolinux
-r--r--r--. 1 root root?? 103 Apr 20? 2022 media.repo
-r--r--r--. 1 root root? 1669 Apr 20? 2022 RPM-GPG-KEY-redhat-beta
-r--r--r--. 1 root root? 3682 Apr 20? 2022 RPM-GPG-KEY-redhat-release
3、安裝服務
[root@localhost ~]# dnf install httpd??? 安裝httpd服務
[root@localhost ~]# dnf install vim bash-com* net-tools??? 安裝vim工具
dnf install vim bash-com* net-tools? lrz*
bash-com? ---起到自動補齊的作用
lrz軟件包--用作上傳和下載
rz ----從本機電腦傳文件到虛擬機
4、關閉防火墻
[root@localhost ~]# echo "welcome to China" > /var/www/html/index.html
[root@localhost ~]# systemctl stop firewalld???? 關閉防火墻
[root@localhost ~]#
[root@localhost ~]# systemctl start httpd???? 開啟服務
[root@localhost ~]# ls /var
adm??? crash? empty? games???? lib??? lock? mail? opt?????? run??? tmp? yp
cache? db???? ftp??? kerberos? local? log?? nis?? preserve? spool? www
5、測試
[root@localhost ~]# curl http://192.168.175.146?? 測試
welcome to China