现在的位置: 首页 > 综合 > 正文

SUSE EL 9 下编译Apache2

2013年05月29日 ⁄ 综合 ⁄ 共 1323字 ⁄ 字号 评论关闭
SUSE EL 9
httpd-2.2.4

1
先将系统安装时安装的APACHE2卸载掉
rpm -e apache2
然后会提示很多依赖需要先卸载,再一一先卸载后即可卸载完
出现两个相互依赖的则需要使用
rpm -e apache2 --nodeps

2
#tar -zxvf httpd-2.2.4.tar.gz
#cd httpd-2.2.4
#./configure --prefix=/opt/app/apache-2.2.2 \
--enable-ssl --enable-so --disable-info \
--enable-shared=max --enable-module=most \
--enable-expires --enable-headers \
--enable-rewrite
配置时报错:“cannot use an external APR with the bundled APR-util”
解决方法:

APR了,这个东西是Apache可移植运行库,源自为了服务器代码的多
平台性, 尝试将不同的操作系统特定字节与操作系统无关代码隔离。结果就提供了一
个基础API的接口。具体作用大家可参考

http://fanqiang.chinaunix.net/app/web/2006-02-21/4012.shtml文章。

apache-2.2.0提供了apr以及apr-util的源代码 
要使用发行源代码中自带的apr/apr-util源代码进行安装,你必须手动完成:  
我们先编译和安装 apr 1.2 
# tar xzvf httpd -2.2.0.tar.gz 
# cd httpd-2.2.0 
# cd srclib/apr 
# ./configure --prefix=/usr/local/apr 
# make 
# make install 
现在编译和安装 apr-util 1.2 
# cd ../apr-util 
# ./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr/ 
# make 
# make install  

重复上面的./configure 报错:
exports.c:1653: error: redefinition of 'ap_hack_apr_version_string'
exports
.c:1022: error: previous definition of 'ap_hack_apr_version_string' was here
make[
2]: *** [exports.lo] Error 1
make[
2]: Leaving directory `/usr/local/src/httpd-2.2.4/server'
make[
1]: *** [all-recursive] Error 1
make[
1]: Leaving directory `/usr/local/src/httpd-2.2.4/server'
make: *** [all-recursive] Error 
1
解决办法:
在configure后加上 “--with-included-apr”即可

编译通过

抱歉!评论已关闭.