zoukankan      html  css  js  c++  java
  • Linux之Apache服务

    centos6 部署Apache服务的步骤

    1、准备环境

      查看防火墙有没有关:service iptables status

      关闭防火墙:service iptables stop (chkconfig iptables off)

      修改启动项:chkconfig iptables off

      关闭selinux:setenforce 0 (SELINUX=disabled)

      修改配置文件:vim /etc/sysconfig/selinux 修改 “SELINUX=disabled”

      配置IP地址

    2、安装软件包

      yum install httpd -y

    3、修改配置文件

      vim /etc/httpd/conf/httpd.conf  #配置文件

        ServerRoot "/etc/httpd"   #服务根目录  

        Listen 80 #服务侦听端口

        DocumentRoot "/var/www/html"  #网站文件所在目录

      创建html文件测试

        

    4、重启服务

      service httpd restart

    5、测试

      打开浏览器在地址栏中输入网站服务器地址:端口/路径

    centos7 部署Apache服务的步骤

    1、准备环境

      查看防火墙有没有关:service firewalld status

      关闭防火墙:service firewalld stop (chkconfig iptables off)

        开启防火墙中的端口: firewall-cmd --permanent --add-port=80/tcp

        加载防火墙配置:firewall-cma --reload

      修改启动项:chkconfig firewalld off

      关闭selinux:setenforce 0 (SELINUX=disabled)

        修改配置文件:vim /etc/sysconfig/selinux 修改 “SELINUX=disabled”

      配置IP地址

    2、安装软件包

      yum install httpd -y

    3、修改配置文件

      vim /etc/httpd/conf/httpd.conf  #配置文件

        ServerRoot "/etc/httpd"   #用于指定守护进程httpd的运行目录  

        Listen 80 #服务侦听端口

        DocumentRoot "/var/www/html"  #服务器对外发布的超文本文档存放的路径

      创建html文件测试

        

    4、重启服务

      service httpd restart

    5、测试

      打开浏览器在地址栏中输入网站服务器地址:端口/路径

  • 相关阅读:
    Spring Cloud Hystrix Dashboard的使用 5.1.3
    Spring Cloud Hystrix 服务容错保护 5.1
    Spring Cloud Ribbon 客户端负载均衡 4.3
    Spring Cloud 如何实现服务间的调用 4.2.3
    hadoop3.1集成yarn ha
    hadoop3.1 hdfs的api使用
    hadoop3.1 ha高可用部署
    hadoop3.1 分布式集群部署
    hadoop3.1伪分布式部署
    KVM(八)使用 libvirt 迁移 QEMU/KVM 虚机和 Nova 虚机
  • 原文地址:https://www.cnblogs.com/pathping/p/8635333.html
Copyright © 2011-2022 走看看