赞
踩
[root@localhost html]# yum install -y httpd
[root@localhost html]# systemctl start httpd
[root@localhost html]# systemctl status httpd
下载链接:https://mirrors.bfsu.edu.cn/centos/7.9.2009/isos/x86_64/
下载文件:CentOS-7-x86_64-Everything-2009.iso
创建yum目录并上传iso
[root@localhost]# mkdir /data/www/html/Centos7-base
[root@localhost centos7-base]# yum install -y lrzsz
[root@localhost centos7-base]# rz
小提示:本人用的mobaXterm工具,直接使用rz命令卡死,可按ctrl+x连按5下x强制退出。
正确上传方式鼠标右击选择“Send file using Z-modem”,然后选择上传文件
自动挂载
[root@localhost centos7-base]# mount -t auto CentOS-7-x86_64-Everything-2009.iso /data/www/html/centos7-base/
查看是否已挂载
[root@localhost html]# df -h
修改httpd默认服务目录
[root@localhost centos7-base]# vim /etc/httpd/conf/httpd.conf
[root@localhost centos7-base]# systemctl restart httpd
检查语法错误
[root@localhost centos7-base]# httpd -t
解决:
[root@localhost centos7-base]# vim /etc/httpd/conf/httpd.conf
[root@localhost centos7-base]# systemctl restart httpd
[root@localhost html]# vim /etc/yum.repos.d/CentOS-Base.repo
先注释掉原先的mirrorlist地址,再添加
baseurl=file:///data/www/html/centos7-base
[root@localhost html]# yum clean all
安装telnet
[root@localhost html]# yum install -y telnet
[root@localhost ~]# vim /etc/yum.repos.d/CentOS-Base.repo
[root@localhost ~]# yum clean all
如提示此类故障则删除yum.pid或重启服务器,由于yum强制退出会锁死。
[root@localhost run]# ll /var/run/
[root@localhost run]# rm -rf yum.pid
[root@localhost run]# yum install -y telnet
[root@localhost ~]# systemctl list-unit-files
[root@localhost ~]# systemctl enable httpd.service
方法一:需手动执行
[root@localhost ~]# echo "mount -t auto /data/www/html/centos7-base/CentOS-7-x86_64-Everything-2009.iso /data/www/html/centos7-base/" >> /etc/rc.local
[root@localhost ~]# bash /etc/rc.local
方法二:自动挂载
[root@localhost ~]# vim /etc/fstab
/data/www/html/centos7-base/CentOS-7-x86_64-Everything-2009.iso /data/www/html/centos7-base iso9660 defaults,ro,loop 0 0
# Iso9660:iso文件的文件类型
# ro 表示以只读方式,loop 表示把挂载的设备当做一个磁盘分区
重启后自动挂载
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。