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