今日编译apache时出错:

#./configure --prefix……检查编辑环境时出现:

checking for APR... no
configure: error: APR not found .  Please read the documentation

解决办法:

1.下载所需软件包:

  1. wget http://archive.apache.org/dist/apr/apr-1.4.5.tar.gz
  2. wget http://archive.apache.org/dist/apr/apr-util-1.3.12.tar.gz
  3. wget http://jaist.dl.sourceforge.net/project/pcre/pcre/8.10/pcre-8.10.zip

2.编译安装:

  1. yum remove apr-util-devel apr apr-util-mysql apr-docs apr-devel apr-util apr-util-docs

具体步骤如下:

a:解决apr not found问题>>>>>>

  1. [root@xt test]# tar -zxf apr-1.4.5.tar.gz
  2. [root@xt test]# cd  apr-1.4.5
  3. [root@xt apr-1.4.5]# ./configure --prefix=/usr/local/apr
  4. [root@xt apr-1.4.5]# make && make install

b:解决APR-util not found问题>>>>

  1. [root@xt test]# tar -zxf apr-util-1.3.12.tar.gz
  2. [root@xt test]# cd apr-util-1.3.12
  3. [root@xt apr-util-1.3.12]# ./configure --prefix=/usr/local/apr-util -with- apr=/usr/local/apr/bin/apr-1-config
  4. [root@xt apr-util-1.3.12]# make && make install

c:解决pcre问题>>>>>>>>>

  1. [root@xt test]#unzip -o pcre-8.10.zip
  2. [root@xt test]#cd pcre-8.10
  3. [root@xt pcre-8.10]#./configure --prefix=/usr/local/pcre
  4. [root@xt pcre-8.10]#make && make install

4.最后编译Apache时加上:

--with-apr=/usr/local/apr \

--with-apr-util=/usr/local/apr-util/ \

--with-pcre=/usr/local/pcre

成功编译完成~

Note:要从零开始搭建,就不要嫌中间遇到各种eggache的问题!

一.下载apache源代码

1.下载地址:http://httpd.apache.org/download.cgi  找稳定的最新的版本(Stable Release)

得到文件 httpd-2.4.3.tar.gz

2. 上传到你的服务器目录,如:/home/tnuser/installers

解压:tar -zxvf httpd-2.4.3.tar.gz   (我们下载的是源代码,所以这一步只是把源代码解压) 

移动解压后的目录到目标地址:mv /home/tnuser/installers/httpd-2.4.3  /home/tnuser/  (这一步只是把解压后的目录放在合适的位置方便管理,可以不做)

3. 接下来我们需要编译刚才解压的源文件,这是重点

配置编译时的一些参数: 

  1. cd  /home/tnuser/installers/httpd-2.4.3  (切换到apache源代码目录下)
  2. ./configure --prefix=/home/tnuser/apache/   (设置apache安装目录,这里的 /home/tnuser/apache/ 才是apache真正的安装目录)

二. 到这里时,回车运行命令,报错:

如果你能正常执行,说明你以前安装过apache环境,请直接make & make install 并请跳过下面一段

checking for APR... no
configure: error: APR not found.  Please read the documentation.

解决方案:

Apache在安装时需要一些准备环境,这里需要安装另外一个东西 APR(Apache Portable Runtime)。

下载地址: http://archive.apache.org/dist/apr/ 同样找最新版本

得到文件:apr-1.4.6.tar.gz

解压:tar -zxvf apr-1.4.6.tar.gz

编译:

  1. cd /home/tnuser/installers/apr-1.4.6
  2. ./configure --prefix=/home/tnuser/apr/  (一堆日志信息)
  3. make (一堆日志信息)
  4. make install (一堆日志信息)

完成后在指定地址生成目录和文件

接着装apache,切换到源代码目录设置编译参数: ./configure --prefix=/home/tnuser/apache/

还是报上面的错,这是因为上面自定义了apr的安装目录,所以得把这个信息告诉apache。

正确的运行命令为:

  1. ./configure --prefix=/home/tnuser/apache/  --with-apr=/home/tnuser/apr/

三. 执行后继续报错

不过这次错误信息变成了:(不要紧,这说明你的apr安装好了,只是又发现少了另外一个环境,慢慢来)

checking for APR-util... no
configure: error: APR-util not found.  Please read the documentation.

解决方案: 下载 APR-util

下载地址:http://archive.apache.org/dist/apr/ 找最新版本

得到文件:apr-util-1.5.1.tar.gz

解压: tar -zxvf apr-util-1.5.1.tar.gz

编译:

  1. cd /home/tnuser/installers/apr-util-1.5.1
  2. ./configure --prefix=/home/tnuser/apr-util/

这次运行会报错:

checking for APR... no
configure: error: APR could not be located. Please use the --with-apr option.
看到提示你就懂了,不多说:

  1. ./configure --prefix=/home/tnuser/apr-util/ --with-apr=/home/tnuser/apr/
  2. make
  3. make install

在你指定的安装地址生成目录就说明安装成功了

四. 再转回去继续安装apache

有了上回的经验,这次就知道运行什么命令了。切到apache源代码目录下运行:

  1. ./configure --prefix=/home/tnuser/apache/  --with-apr=/home/tnuser/apr/  --with-apr-util=/home/tnuser/apr-util/

照旧报错:

checking for pcre-config... false
configure: error: pcre-config for libpcre not found. PCRE is required and available from http://pcre.org/
解决方案:发现还是少环境,不多说,下载 PCRE

下载地址: http://jaist.dl.sourceforge.net/project/pcre/pcre/ 找最新版下

得到文件: pcre-8.32.tar.gz

解压:tar -zxvf pcre-8.32.tar.gz

编译:

  1. cd /home/tnuser/hunter/installers/pcre-8.32
  2. ./configure --prefix=/home/tnuser/pcre/

这次错误信息如下:

checking for windows.h... no
configure: error: You need a C++ compiler for C++ support.

原来pcre需要用C++编译(我只想说:Why I need C++ while I'm a java programmer? Eggache! Holy Shit!)

解决方案:

首先,区分你的系统是Debian还是Fedora。

我的系统是Fedora,所以配置步骤如下:(Debian系统使用命令apt-get,对应工具包为build-essential,命令使用方法:apt-get install build-essential)

sudo yum groupinstall "Development Tools"

这里会花费很长时间安装东西,中间会让你选择是否安装,输入 y 就行了。

下载过程完成后会自动安装,最终见到  Complete! 就结束了。

返回来还得继续安装PCRE啊,Go:

  1. ./configure --prefix=/home/tnuser/pcre/
  2. make
  3. make install

安装成功,以最终在目标位置生成相应目录为准。

至此,令人eggache的apache准备环境就算搞定了。

五. 继续apache的安装,一定要在参数中带上以上3种环境配置:

 

  1. ./configure --prefix=/home/tnuser/apache/  --with-apr=/home/tnuser/apr/  --with-apr-util=/home/tnuser/apr-util/  --with-pcre=/home/tnuser/pcre/

大块的log,终于没报错(唯有泪千行啊。。。泪千行。。。)

make

make install

六. 最后测试apache:

cd /home/tnuser/apache/bin

apachectl -k start

如果不能启动,查下端口冲突之类的问题(一般会与系统自带的httpd服务端口冲突)。

启动后报错:

报错很多我们一个一个来解决

首先是第一个报错函数,

解决方法:

编辑httpd.conf文件然后修改ServerName www.example.com:80 为 ServerName localhost:80

注意那个名字很难找

在看第二个报错解决办法:

启动好后,访问你的apache,看到经典

It works!

关闭时用:apachectl -k stop

七.附录:

http://apache.jz123.cn/install.html   中文版官方编译与安装教程

码完收功!!!

 

centos在安装apache2.4版本的时候遇到ARP not found解决办法的更多相关文章

  1. Scrapy安装报错 Microsoft Visual C++ 14.0 is required 解决办法

    Scrapy安装报错 Microsoft Visual C++ 14.0 is required 解决办法原因:Scrapy需要的组 twisted 需要 C++环境编译. 方法一:根据错误提示去对应 ...

  2. Wincap安装出现“error opening file for writing wpcap.dll”之解决办法

    Wincap安装出现"error opening file for writing wpcap.dll"之解决办法 安装Wireshark时,一直出现下面的错误,选择忽略这个错误, ...

  3. Win8.1安装VirtualSVN Server发生service visualSVN Server failed to start解决办法

    Service 'VisualSVN Server' failed to start. Please check VisualSVN Server log in Event Viewer for mo ...

  4. pycharm(社区版2019.1版本)打开README.md文件卡死解决办法

    现象:pycharm(社区版2019.1版本)打开README.md文件卡死 解决办法: 将插件Markdown support前的勾选√去掉,保存修改后重启pycharm即可

  5. Linux安装php-mysql提示需要:libmysqlclient.so.18()(64bit)的解决办法

    Linux安装php-mysql提示需要:libmysqlclient.so.18()(64bit)的解决办法 在LNMP编译环境下安装zabbix会出现 执行:yum -y install net- ...

  6. CentOS 编译安装Apache2.4.10

    1.准备编译环境 yum -y install gcc make cmake autoconf libtool libevent 安装apache必须的依赖包 yum -y install apr-u ...

  7. Win7系统64位环境下使用Apache——安装Apache2.4时报错“Invalid command Order”问题的解决

    之前在文章Win7系统64位环境下使用Apache--Apache2.4整合Tomcat与mod_jk提到了安装Apache2.4时有可能报错: Invalid command 'Order', pe ...

  8. 【linux】CentOS安装mysql*.rpm提示conflicts with file from package的解决办法

    使用以下命令安装: rpm -ivh MySQL-server-5.6.19-1.linux_glibc2.5.x86_64.rpm 错误提示如下: Preparing...              ...

  9. CentOS安装mysql*.rpm提示conflicts with file from package的解决办法

    看到“conflicts”,是产生冲突了,文件“/usr/share/mysql/charsets/*”需要MySQL-server-5.6.19-1.linux_glibc2.5.x86_64版本的 ...

随机推荐

  1. 把zlog封装成模块,隐藏zlog

    mylog.h #ifndef _MY_LOG_H #define _MY_LOG_H int init(char *filename); void *get_category(char * cate ...

  2. QuickTime 专业版 pro 注册码

    打开QuickTime Player下拉编辑菜单--选偏好设置--注册 Name: Dawn M Fredette Key: 4UJ2-5NLF-HFFA-9JW3-X2KV 重新启动 QuickTi ...

  3. 从现在开始使用nodejs开发的几点答疑

    1.为什么要开始用nodejs, 而不是php 理由有三点: 因为我是前端程序员出身,nodejs都是用javascript写的,这样相当于前端和后端都使用javascript,开发更加有效率.当然很 ...

  4. 同时处理html+js+jquery+css的插件安装(Spket&Aptana插件安装)

    Spket 在线安装方法:Help->Software Updates(或者Install New Software)->Add site Location:http://www.spke ...

  5. 转:linux执行shell脚本的方式及一些区别

    假设shell脚本文件为hello.sh放在/root目录下.下面介绍几种在终端执行shell脚本的方法: [root@localhost home]# cd /root/ [root@localho ...

  6. POJ1159 Palindrome(数位DP)

    Palindrome Time Limit: 3000MS   Memory Limit: 65536K Total Submissions: 58277   Accepted: 20221 Desc ...

  7. 使用layer显示弹出框笔记

    $.layer({     area : ['200px','auto'], //控制层宽高.当设置为auto时,意味着采用自适应, 当然,对于宽度,并不推荐这样做.例如:area : ['310px ...

  8. (poj 1475) Pushing Boxes

    Imagine you are standing inside a two-dimensional maze composed of square cells which may or may not ...

  9. Android中各种onTouch事件

    Android里有两个类 android.view.GestureDetector android.view.GestureDetector.SimpleOnGestureListener 1) 新建 ...

  10. 关于hibernate中对象的三种状态分析

    一,首先hibernate中对象的状态有三种:瞬态.游离态和持久态,三种状态转化的方法都是通过session来调用,瞬态到持久态的方法有save().saveOrUpdate().get().load ...