zoukankan      html  css  js  c++  java
  • 搭建简易网站

    1、检查环境

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

      

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

    2、配置yum源

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

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

          yum clean all    #清除yum源缓存
    3、安装服务

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

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

    5、添加防火墙端口

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

           ip a 查看本机ip

    6、编辑主页

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

    7、验证

          浏览器访问 ip

  • 相关阅读:
    进度条功能
    网络编程
    并发编程
    UUID
    serverless 近期热度
    力扣 98. 验证二叉搜索树
    循环中多线程参数为空bug
    从头解决PKIX path building failed
    国内jenkins搭建不再龟速的方式
    CoachAI 2019年12月~2020年3月实习总结
  • 原文地址:https://www.cnblogs.com/t-ym/p/11617335.html
Copyright © 2011-2022 走看看