1、检查环境
getenforce #查看seLinux运行状态
Enforcing #强行执行
setenforce 0 #临时关闭selinux
vim /etc/selinux/config #编辑selinux配置文件
###########
将SELINUX=enforcing改为
SELINUX=disabled
###########
知识兔2、临时关闭防火墙
(因为在实际应用时不能关闭防火墙,因此此时暂时关闭防火墙)
systemctl stop firewalld #临时关闭防火墙
systemctl disable firewalld #禁止防火墙开机启动
知识兔3、配置yum源
mkdir /iso #创建挂载点
mount /dev/cdrom /iso #挂载光盘到挂载点
df -h #查看挂载是否成功
知识兔cd /etc/yum.repos.d/ #进入yum源目录
rm -rf *.repo #删除官方源
vim iso.repo #编辑源文件
##############
[iso] #源标示
name=iso #源名称
baseurl=file:///iso #源地址 file:// + /iso
enabled=1 #开启源
gpgcheck=0 #关闭验证
##############
yum clean all #清理Yum源缓存
知识兔4.安装服务
yum -y install httpd #安装httpd服务
rm -rf /etc/httpd/conf.d/welcome.conf #删除欢迎页
知识兔5.启动服务
rm -rf /etc/httpd/conf.d/welcome.conf #删除欢迎页
systemctl start httpd #启动httpd
systemctl enable httpd #设置httpd开机启动
ip a #查看本机IP
知识兔浏览器画面:
6.编辑主页
curl www.XXX.com > /var/www/html/index.html #把某个网站的内容加入到index页面
vim /var/www/html/index.html #修改里边的内容
知识兔