zoukankan      html  css  js  c++  java
  • Centos7用rpm方法安装Apache服务

    1.挂载镜像

    mount /dev/sr0  /dev/mnt/cdrom
    

    2.从Packages 里面找到httpd打头的rpm包

    3.逐个安装,先安装第一个httpd-2.4.6-90.el7.centos.x86_64.rpm 看一下所需的依赖包

      第一个依赖 /etc/mime.types

    http://rpmfind.net/linux/rpm2html/search.php?query=%2Fetc%2Fmime.types

    去这个网站找centos7系统需要的rpm包

    接着安装

     

    第二个依赖  httpd-tools = 2.4.6-90.el7.centos  (意思是这个包的版本必须等于2.4.6-90)

     发现还依赖了两个函数库,接着去网站查看依赖包

     安装这两个依赖包

     

     依赖搞定了就继续安装  httpd-tools-2.4.6-90.el7.centos.x86_64.rpm

     

     一切顺利!

    现在我们已经安装了  httpd-2.4.6-90.el7.centos.x86_64.rpm      httpd-tools-2.4.6-90.el7.centos.x86_64.rpm

     接下来安装剩余的包 httpd-manual-2.4.6-90.el7.centos.noarch.rpm  

     

    安装完成

    4.启动Apache

    查看防火墙状态:

    [root@centos7-1 Packages]# firewall-cmd --state
    running
    

      

    关闭防火墙

    [root@centos7-1 Packages]# systemctl stop firewalld.service

    启动服务

    [root@centos7-1 Packages]# systemctl start httpd.service
    

    禁用防火墙开机启动服务

    systemctl disable firewalld.service 
    

      

    设置服务器开机自动启动Apache

    systemctl enable httpd.service
    

    手动启动Apache

    systemctl start httpd.service 在浏览器中输入IP地址即可验证是否启动成功
    

     

    手动重启Apache

    systemctl restart httpd.service
    

      

    5.安装目录介绍

    • Apache默认将网站的根目录指向/var/www/html
    • 默认的主配置文件/etc/httpd/conf/httpd.conf
    • 配置存储在的/etc/httpd/conf.d/目录
     
  • 相关阅读:
    08:特殊日历计算
    07:玛雅历
    Vigenère密码
    openjudge 螺旋加密
    C#遍历指定文件夹中的所有文件和子文件夹
    确定两串乱序同构
    方阵原地顺时针旋转90度
    05:统计单词数【NOIP2011复赛普及组第二题】
    牛客网一道趣味题
    二分查找的平均查找长度详解【转】
  • 原文地址:https://www.cnblogs.com/hongweijiang/p/12344671.html
Copyright © 2011-2022 走看看