怎样保证保证Server loaded和Compiled using的APR版本一致

2017年12月20日 | 分类: 【技术】

编译安装Apache时,可能因APR版本产生问题。

wget http://archive.apache.org/dist/apr/apr-1.4.8.tar.gz && tar -zxvf apr-1.4.8.tar.gz && mv apr-1.4.8 apr
wget http://archive.apache.org/dist/apr/apr-util-1.5.2.tar.gz && tar -zxvf apr-util-1.5.2.tar.gz && mv apr-util-1.5.2 apr-util
[shell]

[shell]
wget http://archive.apache.org/dist/apr/apr-1.6.3.tar.gz && tar -zxvf apr-1.6.3.tar.gz && mv apr-1.6.3 apr
wget http://archive.apache.org/dist/apr/apr-util-1.6.1.tar.gz && tar -zxvf apr-util-1.6.1.tar.gz && mv apr-util-1.6.1 apr-util

输入:

/usr/local/apache2/bin/httpd -V

输出:

Server version: Apache/2.4.29 (Unix)
Server built: Dec 20 2017 11:26:18
Server’s Module Magic Number: 20120211:68
Server loaded: APR 1.4.8, APR-UTIL 1.5.2
Compiled using: APR 1.4.8, APR-UTIL 1.5.2
Architecture: 64-bit
Server MPM: worker
threaded: yes (fixed thread count)
forked: yes (variable process count)

I also encountered the same issue. The root cause of the issue is a version mismatch in the apr version
In order to fix it, download the following: apr-util-1.5.4.tar.gz and apr-1.5.1.tar.gz. These can be downloaded at : https://apr.apache.org/download.cgi
Assuming that you have http src untarred in /src/httpd, you untar the apr-1.5.1 and apr-util in the opt/src/httpd/srclib
So the unzipped structure would be opt/src/httpd/srclib/apr and opt/src/httpd/srclib/apr-util
After this is done, you can run the configure with the following command

参考:https://stackoverflow.com/questions/25231421/mod-ssl-so-not-loading
参考:https://stackoverflow.com/questions/20435151/undefined-symbol-in-apache-http-server