zoukankan      html  css  js  c++  java
  • centos6 / centos7 安装apache

         =================centos6.1 安装apache=====================
       
        安装: yum -y install httpd
       
       
        启动
            /etc/init.d/httpd start
            /etc/init.d/httpd status
            /etc/init.d/httpd stop
       
       
       
       
       
       
       
       
         查看端口号是否被占用
         netstat  -anp  |grep   端口号
       
       
      
         =================centos7 安装apache==============================================================================================================================================================
        Apache在默认的CentOS仓库中可用,安装非常简单。 在CentOS和RHEL上,Apache软件包和服务称为httpd。 要安装软件包,请运行以下命令:
    
        sudo yum install httpd
    
        安装完成后,启用并启动Apache服务:
    
        sudo systemctl enable httpd
        sudo systemctl start httpd
    
        如果您正在运行防火墙,则还需要打开HTTP和HTTPS端口80和443:
    
        sudo firewall-cmd --permanent --zone=public --add-service=http
        sudo firewall-cmd --permanent --zone=public --add-service=https
        sudo firewall-cmd --reload
       
       =================apache 常用命令==============================================================================================================================================================
       
       默认目录是/var/www/html下。修改方法: 打开/etc/httpd/conf/httpd.conf文件,找到下面这行 DocumentRoot "/var/www/html" 可以改成你想要的目录。
       
        sudo systemctl status httpd
        要停止Apache服务,请运行:
        sudo systemctl stop httpd
        要再次启动,请键入:
        sudo systemctl start httpd
        重新启动Apache服务:
        $sudo systemctl restart httpd
        在进行一些配置更改后重新加载Apache服务:
        $sudo systemctl reload httpd
        如果您想禁用Apache服务以在启动时启动:
        $sudo systemctl disable httpd
        并重新启用它:
        $sudo systemctl enable httpd
  • 相关阅读:
    微信小程序支付完整示例
    二分查找,冒泡排序, 快速排序
    JQuery放大镜效果
    js瀑布流
    linux安装字体
    使用phantomjs截图【php】
    安装supervisor
    mysql报错:BIGINT UNSIGNED value is out of range
    curl https报错: curl: (35) SSL connect error
    给www用户添加登录权限
  • 原文地址:https://www.cnblogs.com/scode2/p/11662466.html
Copyright © 2011-2022 走看看