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

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

  • 相关阅读:
    python中的编码问题
    CVPR2018 Tutorial 之 Visual Recognition and Beyond
    hdu 1376 Octal Fractions
    hdu 1329 Hanoi Tower Troubles Again!
    hdu 1309 Loansome Car Buyer
    hdu 1333 Smith Numbers
    hdu 1288 Hat's Tea
    hdu 1284 钱币兑换问题
    hdu 1275 两车追及或相遇问题
    hdu 1270 小希的数表
  • 原文地址:https://www.cnblogs.com/pathping/p/8635333.html
Copyright © 2011-2022 走看看