一、安装

  安装之前先将服务器的防火墙关掉。

  systemctl  stop  firewalld

  systemctl  disable  firewall

第一步:

  安装apr

    下载:

    wget -c http://mirrors.tuna.tsinghua.edu.cn/apache//apr/apr-1.6.3.tar.bz2

    解压该文件:

    tar -jvxf apr-1.6.3.tar.bz2
    检测:

    cd apr-1.6.3
    ./configure --prefix=/usr/local/apr/
    编译:

    make
    make install

第二步:

  安装apr-util

    下载:

    wget -c http://mirrors.tuna.tsinghua.edu.cn/apache//apr/apr-util-1.6.1.tar.bz2

    解压该文件:
    tar -jvxf apr-util-1.6.1.tar.bz2

    检测:
    cd apr-util-1.6.3
    ./configure --prefix=/usr/local/apr-util/ --with-apr=/usr/local/apr/

    编译:
    make
    make install

第三步:

  安装pcre

    下载:

    wget -c http://ftp.pcre.org/pub/pcre/pcre-8.42.tar.bz2

    解压该文件:
    tar -jvxf pcre-8.42.tar.bz2

    检测:
    cd pcre-8.42
    ./configure --prefix=/usr/local/pcre/

    编译:
    make
    make install

第四步:
  安装httpd

    下载:

    wget -c http://mirrors.cnnic.cn/apache/httpd/httpd-2.4.29.tar.bz2

    解压该文件:
    tar -jvxf httpd-2.4.29.tar.bz2

    检测:
    cd httpd-2.4.29
    ./configure --prefix=/usr/local/httpd/ --with-apr=/usr/local/apr/ --with-apr-util=/usr/local/apr-util/ --with-pcre=/usr/local/pcre/

    编译:
    make
    make install

第五步:

  配置/usr/local/apache2/conf/httpd.conf

      ServerName www.examda.com:80
      改为
      ServerName localhost:80

第六步:

  启动apache服务

    /usr/local/apache2/bin/apachectl start


二、检测

  使用浏览器访问本地IP

  出现It works!成功


三、报错处理

  (1)configure: error: APR not found. Please read the documentation.

    这是没有安装apr或者apr安装失败导致的,重新安装apr。

      安装请查看第一步。

  (2)configure: error: APR-util not found. Please read the documentation.

    这是没有安装apr-util或者apr-util安装失败导致的,重新安装apr-util。

      安装请查看第二步。

  (3)configure: error: no acceptable C compiler found in $PATH

    这是没有安装gcc编译器或者gcc编译器安装失败导致的,重新安装gcc。

      yum  install  -y  gcc

  (4)xml/apr_xml.c:35:19: 致命错误:expat.h:没有那个文件或目录

    这是没有安装expat-devel或者expat-devel安装失败导致的,重新安装expat-devel。

      yum  install  -y  expat-devel

  (5)configure: error: Invalid C++ compiler or C++ compiler flags

    这是没有安装gcc-c++或者gcc-c++安装失败导致的,重新安装gcc-c++

      yum  install  -y  gcc-c++

  (6)configure: error: pcre-config for libpcre not found. PCRE is required and available from http://pcre.org/

    这是没有安装pcre或者pcre安装失败导致的,重新安装pcre。

      安装请查看第三步。

centos7编译安装Apache的更多相关文章

  1. linux中编译安装Apache、PHP、MySQL(上)

    1.简介 在阿里云买了个云服务器,一直没时间折腾.过了近十天了吧,才有时间好好玩玩这个云服务器.自己是做Web开发的,所以我需要的开发环境是LAMP.之前打算是采用yum安装,不过yum安装apach ...

  2. centos7 编译安装新版LNMP环境

    centos7 编译安装新版LNMP环境 环境版本如下: 1.系统环境:Centos 7 x86_64 2.NGINX:nginx-1.11.3.tar.gz 3.数据库:mariadb-10.0.2 ...

  3. centos手动编译安装apache、php、mysql

    64位centos 5.5手动安装lamp,要求curl.json.pdo_mysql.gd,记录如下. centos 5.4.5.5.5.6的内核都是2.6.18,都可以安装php 5.3. 卸载旧 ...

  4. Linux下编译安装Apache Http Server

    Linux下编译安装Apache Http Server [TOC] 1.下载httpd-2.4.12.tar.bz2 wget http://mirror.bit.edu.cn/apache/htt ...

  5. CentOS7编译安装Nginx-1.8.1和编译参数

    CentOS7编译安装Nginx-1.8.1和编译参数 Web服务器Nginx    LNMP是一组众所周知的Web网站服务器架构环境,即由Linux+Nginx+MySQL+PHP(MySQL有时也 ...

  6. centos7编译安装MySQL5.7.9

    title: centos7编译安装MySQL5.7.9 date: 2016-05-12 16:20:17 tags: --- Centos7编译安装mysql5.7.9 mysql5.7有更好的性 ...

  7. Linux 通过编译安装apache服务以及配置

    Linux 编译安装apache服务 一.安装 1.通过编译安装,首先需要下载源代码安装包 apache下载链接:http://httpd.apache.org/download.cgi 2.解开源代 ...

  8. Linux学习之编译安装apache

    疯狂吐槽腾某云..编译安装apache折腾了一下午..还是我不太熟练. 首先要先准备好安装apache的三个依赖包以及apache包.(一定要准备好!!折腾了一下午的小白握拳!!) -rw-r--r- ...

  9. 编译安装Apache httpd和php搭建KodExplorer网盘

    编译安装Apache httpd和php搭建KodExplorer网盘 环境说明: 系统版本    CentOS 6.9 x86_64 软件版本    httpd-2.2.31        php- ...

随机推荐

  1. 01常用<meta>总结

    meta标签提供关于HTML文档的元数据.元数据不会显示在页面上,但是对于机器是可读的,它可以用于浏览器(显示内容/重新加载页面),搜索引擎(关键字),或者其他web服务. 一.页面设置 <!- ...

  2. .NET开源工作流RoadFlow-表单设计-单选按钮组

    单选按钮组即:<input type='checkbox'/>控件: 绑定字段:与数据表的某个字段绑定. 数据源: 1.数据字典:在下面字段项中选择对应在数据字典项. 2.自定义:自己输入 ...

  3. 解决Tensorflow源码安装的之后TensorBoard 无法使用的问题

    作者  cnblog 修雨轩陈 我是按照 Tensorflow 下 https://github.com/tensorflow/tensorflow/blob/master/tensorflow/g3 ...

  4. 动态获取Drawable图片资源

    比如Drawable中有一系列连续的图片,img_0.png, img_1.png, img_2.png ... 如果要动态获取这些图片,通过"R.drawable.img_x"的 ...

  5. day3-基础 列表,元组,字典,模块

    1.列表 列表是我们最以后最常用的数据类型之一,通过列表可以对数据实现最方便的存储.修改等操作 定义列表 Country = ['China','England','America'] 通过下标访问列 ...

  6. Oracle权限相关查询

    Oracle权限相关查询着实视图有点多,记录下常用的语句,方便查询:1.查看所有用户:  select * from dba_users;  select * from all_users;  sel ...

  7. 时间序列算法理论及python实现(2-python实现)

    如果你在寻找时间序列是什么?如何实现时间序列?那么请看这篇博客,将以通俗易懂的语言,全面的阐述时间序列及其python实现. 时间序列算法理论详见我的另一篇博客:时间序列算法理论及python实现 - ...

  8. 密钥导出函数(Key derivation function)

    在密码学中,密钥导出函数(KDF)使用伪随机函数从秘密值(eg.主密钥)导出一个或多个密钥.KDF可用于将密钥扩展到更长的密钥或获得所需格式的密钥(eg.将作为Diffie-Hellman密钥交换的结 ...

  9. NYOJ298 点的变换 【矩阵乘法经典】

    任意门:http://acm.nyist.edu.cn/JudgeOnline/problem.php?pid=298 点的变换 时间限制:2000 ms  |  内存限制:65535 KB 难度:5 ...

  10. Playrix Codescapes Cup (Codeforces Round #413, rated, Div. 1 + Div. 2) C. Fountains 【树状数组维护区间最大值】

    题目传送门:http://codeforces.com/contest/799/problem/C C. Fountains time limit per test 2 seconds memory ...