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、测试

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

  • 相关阅读:
    viso图插入Word中大片空白解决办法
    面向对象设计模式中的单例模式和工厂模式
    面向对象知识整理
    require和include的区别及自动加载的定义
    面向对象的三大特性及定义
    重写和重载的区别 (部分内容转自竹木人)
    面向对象的基本概念
    PHP json_encode( ) 函数介绍
    js页面跳转常用的几种方式
    js中页面刷新和页面跳转的方法总结 [ 转自欢醉同学 ]
  • 原文地址:https://www.cnblogs.com/pathping/p/8635333.html
Copyright © 2011-2022 走看看