zoukankan      html  css  js  c++  java
  • CentOS 7源码安装Apache

    一、官方安装手册http://httpd.apache.org/docs/2.4/install.html#customize

    下载最新版http://httpd.apache.org/download.cgi#apache24

      httpd-2.4.27.tar.bz2

      解压 tar xvf httpd-2.4.27.tar.bz2

      cd httpd-2.4.27

    配置 ./configure  --prefix=安装路径 --with-apr和apr-util的目录

    编译 make

    安装 make install

    二、 问题及解决

    问题a:configure: error: APR not found. Please read the documentation.

      解决:  需要安装 apr 和apr-util

        安装包地址:http://archive.apache.org/dist/apr/

        下载 apr-1.6.2.tar.bz2  和 apr-util-1.6.0.tar.bz2  

        解压 tar xvf apr-1.6.2.tar.bz2

        cd apr-1.6.2

        配置安装路径 ./configure --prefix=/usr/local/apr

        编译&安装   make && make install

        解压 tar xvf apr-util-1.6.0.tar.bz2

        cd apr-util-1.6.0

        配置安装路径 ./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr

        编译&安装   make && make install

    问题b:xml/apr_xml.c:35:19: 致命错误:expat.h:没有那个文件或目录  #include <expat.h>

      解决:缺少expat-devel包

         yum install expat-devel

    问题c:configure: error: pcre-config for libpcre not found. PCRE is required and available from http://pcre.org/

      解决:  安装pcre

        下载pcre-8.41.tar.gz

        解压 pcre-8.41.tar.gz

        cd pcre-8.41

        配置安装路径 ./configure --prefix=/usr/local/pcre

        编译&安装   make && make install

    问题d: make编译过程中出现 /usr/local/apr/-util/lib/libaprutil-1.so: undefined reference to `XML_GetErrorCode‘

      解决:  我刚开始下的是apr-util-1.6.0.tar.gz 后来换成apr-util-1.6.0.tar.bz2就好使了,可能是包的问题。

        也可能是配置时需要--with-expat=builtin,我试了但对于我的错误来说并不好使,后来换了一个包终于好使了,浪费了好长时间。

        用apr-util-1.6.0.tar.bz2重新解压安了一遍,回到httpd-2.4.27,make clean

        配置./configure --prefix=/usr/local/apache  --with-pcre=/usr/local/pcre/ --with-apr=/usr/local/apr/ --with-apr-util=/usr/local/apr-util/ 

        编译安装make && make install 完成

    转自 http://www.mamicode.com/info-detail-1950100.html

  • 相关阅读:
    LocalDate/LocalDateTime与String的互相转换示例(附DateTimeFormatter详解)
    MyBatis中的JdbcType映射介绍
    mybatis的一些特殊符号标识(大于,小于,等于,不等于)
    c++多重继承
    tensorflow 一些好的blog链接和tensorflow gpu版本安装
    java中Arraylist复制方法
    java/python中的队列
    java中的函数参数
    linux命令
    python爬某个网站的图片
  • 原文地址:https://www.cnblogs.com/yunmenzhe/p/7668391.html
Copyright © 2011-2022 走看看