搭建简易网站

一、检查环境html

 getenforce      #查看selinux运行状态
 setenforce 0    #临时关闭selinux

  

 vim /etc/selinux/config    #编辑selinux配置文件
 将SELINUX=enforcing改成 SELINUX=disabled          #永久关闭

 

二、配置yum源linux

     mkdir /iso       #建立挂载点
     mount /dev/cdrom /iso     #挂载光盘到挂载点
     ls /iso      #查看挂载是否成功
     cd /etc/yum.repos.d/     #进入yum源目录
     rm -fr *.repo       #删除官方源
     vim iso.repo       #编辑源文件vim

 [iso] name=iso baseurl=file:///iso enabled=1 gpgcheck=0 

      yum clean all    #清除yum源缓存
三、安装服务浏览器

   yum -y install httpd    #安装httpd服务
   rm -rf /etc/httpd/conf.d/welcome.conf   #删除欢迎页
四、启动服务缓存

   systemctl start httpd    #启动httpd
   systemctl enable httpd   #设置httpd开机启动tcp

五、添加防火墙端口url

 firewall-cmd  --add-port=80/tcp       #临时添加
 firewall-cmd   --add-port=80/tcp  --permanent   #永久添加

       ip a 查看本机ip

六、编辑主页spa

 echo "成功" > /var/www/html/index.html

七、验证

      浏览器访问 ipcode

相关文章
相关标签/搜索