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

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

  • 相关阅读:
    struts2 和 js 标签取值
    使用jQuery 取文本
    a 标签 name 属性 页面定位 (一)
    a 标签 name 属性 页面定位 (二)
    GitHub 出现这样的问题怎么办
    金融政策
    基金基础知识
    bitcoinj学习记录
    金融电影
    黑客
  • 原文地址:https://www.cnblogs.com/pathping/p/8635333.html
Copyright © 2011-2022 走看看