目录
本地仓库挂载
[root@servera ~]# cd /etc/yum.repos.d/
[root@servera yum.repos.d]# ls
redhat.repo rpm.repo
[root@servera yum.repos.d]# vim rpm.repo
[baseos]
name=baseos
baseurl=/mnt/BaseOS
gpgcheck=0
[baseos2]
name=baseos2
baseurl=/mnt/AppStream
gpgcheck=0
[root@servera yum.repos.d]# mount /dev/sr0 /mnt
mount: /mnt: /dev/sr0 已挂载于 /mnt.
网络仓库的挂载
[root@servera ~]# cd /etc/yum.repos.d/
[root@servera yum.repos.d]# ll
总用量 8
-rw-r--r--. 1 root root 358 7月 20 18:32 redhat.repo
-rw-r--r--. 1 root root 151 7月 19 16:45 rpm.repo
[root@servera yum.repos.d]# vim rpm.repo
[baseos]
name=baseos
baseurl=http://172.25.250.101/yum/BaseOS
gpgcheck=0
[baseos2]
name=baseos2
baseurl=http://172.25.250.101/yum/AppStream
gpgcheck=0
[root@servera yum.repos.d]# cd
[root@servera ~]# cd /www
[root@servera www]# mkdir exam
[root@servera www]# cd exam
[root@servera exam]# mkdir yum
[root@servera ~]# mount /dev/sr0 /www/exam/yum/
mount: /www/exam/yum: /dev/sr0 已挂载于 /mnt.
必须在创建 /www/exam/yum 才能进行挂在载,挂在点必须是docuemntroot 路径下的,见下面代码documentroot
[root@servera ~]# vim /etc/httpd/conf.d/vhost.conf
<directory /www>
allowoverride none
require all granted
</directory>
<virtualhost 172.25.250.101:80>
documentroot /www/exam
servername www.exam.com
</virtualhost>
注意这是手动挂载,存在不会长久