一. VMware 插入两张光盘
二. 手动触发硬盘扫描
- [[email protected] ~]#echo '- - -'> /sys/class/scsi_host/host0/scan
- [[email protected] ~]#echo '- - -'> /sys/class/scsi_host/host1/scan
- [[email protected] ~]#echo '- - -'> /sys/class/scsi_host/host2/scan
- [[email protected] ~]#lsblk
- NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
- sda 8:0 0 200G 0 disk
- ?à?¤sda1 8:1 0 2G 0 part /boot
- ???¤sda2 8:2 0 154G 0 part
- ?à?¤CentOS-root 253:0 0 100G 0 lvm /
- ?à?¤CentOS-swap 253:1 0 4G 0 lvm [SWAP]
- ???¤CentOS-data 253:2 0 50G 0 lvm /data
- sr0 11:0 1 4.2G 0 rom /run/media/root/CentOS 7 x86_
- sr1 11:1 1 3.7G 0 rom
- [[email protected] ~]#
三. yum 安装 httpd
[[email protected] ~]#yum install httpd -y
四. 创建网页目录
- [[email protected] ~]#cd /var/www/html/
- [[email protected] HTML]#mkdir CentOS{
- 7,6
- }/os/x86_64 -p
- [[email protected] HTML]#
五. 挂载光盘
[[email protected] HTML]#mount /dev/sr0 /var/www/HTML/centos7/os/x86_64/
mount: /dev/sr0 写保护, 将以只读方式挂载
[[email protected] HTML]#mount /dev/sr1 /var/www/HTML/centos6/os/x86_64/
mount: /dev/sr1 写保护, 将以只读方式挂载
[[email protected] HTML]#
六. 开启 httpd 服务, 并加入开机启动项
- [[email protected] HTML]#systemctl start httpd.service && systemctl enable httpd.service
- Created symlink from /etc/systemd/system/multi-user.target.wants/httpd.service to /usr/lib/systemd/system/httpd.service.
- [[email protected] HTML]#
七. 网页访问测试
发现访问不了, 怀疑是 selinux 和 firewalld 防火墙没关
- [[email protected] HTML]#setenforce 0
- setenforce: SELinux is disabled
- [[email protected] HTML]#systemctl stop firewalld.service
- [[email protected] HTML]#
再次访问, 可访问了
八, 在 centos6 上面配置 yum 源
- [[email protected] ~]#cd /etc/yum.repos.d/
- [[email protected] yum.repos.d]#mkdir backup -p
- # 编辑 repo 文件
- [[email protected] yum.repos.d]#mv *.repo backup/
- [[email protected] yum.repos.d]#cat> base.repo <<EOF
- > [base]
- > name=base repo
- > baseurl=http://192.168.38.131/centos6/os/x86_64/
- > enabled=1
- > gpgcheck=0
- > EOF
- # 查看 repo 仓库
- [[email protected] yum.repos.d]#yum repolist
- Loaded plugins: fastestmirror, refresh-packagekit, security
- Loading mirror speeds from cached hostfile
- base | 4.0 kB 00:00
- repo id repo name status
- base base repo 6,713
- repolist: 6,713
- [[email protected] yum.repos.d]#
- # 安装 vsftpd 测试
- [[email protected] yum.repos.d]#yum install vsftpd
- # 没问题
来源: http://www.bubuko.com/infodetail-3147608.html