zoukankan      html  css  js  c++  java
  • 源码包安装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 完成

    如果按上面步骤安装,那么安装路径是在/usr/local/apache2

    启动: /usr/local/apache2/bin/apachectl start

    重启:/usr/local/apache2/bin/apachectl restart

    停用:/usr/local/apache2/bin/apachectl stop

  • 相关阅读:
    Maven学习总结(二)——Maven项目构建过程练习
    使用Maven搭建Struts2框架的开发环境
    使用Maven编译项目遇到——“maven编码gbk的不可映射字符”解决办法
    MyEclipse10安装Log4E插件
    大数据以及Hadoop相关概念介绍
    Servlet3.0学习总结(四)——使用注解标注监听器(Listener)
    Servlet3.0学习总结(三)——基于Servlet3.0的文件上传
    Servlet3.0学习总结(二)——使用注解标注过滤器(Filter)
    Servlet3.0学习总结(一)——使用注解标注Servlet
    使用kaptcha生成验证码
  • 原文地址:https://www.cnblogs.com/zhou2019/p/11119701.html
Copyright © 2011-2022 走看看