Fedora下解决apache配置出错

[复制链接]
发表于 2008-9-8 17:17:57 | 显示全部楼层 |阅读模式

在fedora8上安装apache

 

>tar -zxvf httpd-2.2.8.tar.gz

 

>cd httpd-2.2.8

 

>./configure --prefix=/usr/local/httpd

 

>make

 

make的时候出现下面错误,以前配没遇到过这问题

 

libtool: link: `passwd/apr_getpass.lo' is not a valid libtool object

make[3]: *** [libapr-1.la] 错误 1

make[3]: Leaving directory `/root/httpd-2.2.8/srclib/apr'

make[2]: *** [all-recursive] 错误 1

make[2]: Leaving directory `/root/httpd-2.2.8/srclib/apr'

make[1]: *** [all-recursive] 错误 1

make[1]: Leaving directory `/root/httpd-2.2.8/srclib'

make: *** [all-recursive] 错误 1

 

后来发现原来是缺少 apr & apr-util.

 

去http://apr.apache.org/ 下来最新的apr-1.2.12-tar.gz和apr-util-1.2.12.tar.gz

 

>tar -zxvf apr-1.2.12-tar.gz

 

>cd apr-1.2.12

 

>./configure --prefix=/usr/local/apr-httpd/

 

>make & make install

 

>tar -zxvf apr-util-1.2.12-tar.gz

 

>cd apr-util-1.2.12

 

>./configure --prefix=/usr/local/apr-util-httpd/ --with-apr=/usr/local/apr-httpd/

 

>make & make install

 

回到apache编译目录

 

>./configure --prefix=/usr/local/httpd/ --with-apr=/usr/local/apr-httpd/ --with-apr-util=/usr/local/apr-util-httpd/

 

>make

 

>make install

回复

使用道具 举报

发表于 2026-9-28 08:03:35 | 显示全部楼层
楼主好,这个错误一般是 apr 目录里的 libtool 对象文件没生成好,或者上次编译残留造成的。

建议先清理再重编:
  1. cd /root/httpd-2.2.8
  2. make clean
  3. find srclib/apr -name "*.lo" -o -name ".libs" | xargs rm -rf
  4. ./configure --prefix=/usr/local/httpd
  5. make
复制代码


如果还报同样的错,直接删掉目录重新解压源码包,有时解压不完整或文件时间戳有问题也会这样:
  1. cd /root
  2. rm -rf httpd-2.2.8
  3. tar -zxvf httpd-2.2.8.tar.gz
  4. cd httpd-2.2.8
  5. ./configure --prefix=/usr/local/httpd
  6. make
复制代码


另外确认一下编译工具链是否完整:
  1. yum install libtool automake autoconf apr-devel apr-util-devel
复制代码


如果还是卡在 apr,可以试试用系统自带的 apr 来编译 Apache:
  1. ./configure --prefix=/usr/local/httpd --with-apr=/usr --with-apr-util=/usr
  2. make
复制代码


Fedora 8 确实比较老了,如果只是要跑 Apache,个人觉得直接 yum install httpd 会省事很多。希望这些能帮到你。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

圆梦公社,专注于为全球华人提供纯粹技术交流的地方,请勿发布任何政治及违法的言论。如有相关侵权、举报、投诉及建议等,请发 E-mail:dzh188@hotmail.com

Powered by Discuz! X5.0 © 2001-2026 Discuz! Team.

在本版发帖返回顶部