红联Linux门户
Linux帮助

曲折的源码安装http2.3.6版本

发布时间:2014-12-05 15:43:38来源:linux网站作者:world77

本来想整整httpd和tomca的整合试验,在网上找了个资料,就开始试验了,本人一向比较喜欢用RPM包来安装东西的,今天不知为啥,想用源码包来安装,好吗,我下了最新的httpd的2.3.6版本的源码包,丢到了服务器上。


悲剧开始了,第一步 configure就通不过啊,下面贴出一部分报错内容:
 
[root@rep1 httpd]# ./configure --prefix=/usr/local/apache --enable-modules=so --enable-so
checking for chosen layout... Apache
Applying OS-specific hints for httpd ...
forcing SINGLE_LISTEN_UNSERIALIZED_ACCEPT to "1"
forcing AP_NONBLOCK_WHEN_MULTI_LISTEN to "1"
checking for unistd.h... yes
checking minix/config.h usability... no
checking minix/config.h presence... no
checking for minix/config.h... no
checking whether it is safe to define __EXTENSIONS__... yes
checking for library containing strerror... none required
checking for APR version 1.3.0 or later... no
configure: error: APR version 1.3.0 or later is required


报错内容说我的APR的版本太低,我看了下我的版本都是1.2.7的,好吗,没关系,我安装一个高的,我下了个     apr-1.4.2.tar.gz,安装好了,再来一次,依旧悲剧啊。


[root@rep1 httpd]# ./configure --prefix=/usr/local/apache --enable-modules=so --enable-so --with-apr=/usr/local/src/apr-1.4.2
checking for chosen layout... Apache
checking for working mkdir -p... yes
...
checking minix/config.h usability... no
checking minix/config.h presence... no
checking for minix/config.h... no
checking whether it is safe to define __EXTENSIONS__... yes
checking for library containing strerror... none required
checking for APR version 1.3.0 or later... yes
checking for APR-util version 1.3.0 or later... no
configure: error: APR-util version 1.3.0 or later is required
[root@rep1 httpd]#


呵呵,说我的APR-UTIL的版本太低,没办法,我用下了apr_1.3.8.orig.tar.gz来安装,这个时候,在make的时候老是报错:
[root@rep1 apr-util]# ./configure --with-apr=/usr/local/src/apr-1.4.2/
[root@rep1 apr-util]# make
make[1]: Entering directory `/usr/local/src/apr-util'
make[1]: *** No rule to make target `crypto/apr_md5.c', needed by `crypto/apr_md5.lo'.  Stop.
make[1]: Leaving directory `/usr/local/src/apr-util'
make: *** [all-recursive] Error 1
[root@rep1 apr-util]# make install
make: *** No rule to make target `crypto/apr_md5.c', needed by `crypto/apr_md5.lo'.  Stop.
[root@rep1 apr-util]#


问了网上的群友,说我的apr的路径不对,怎么不对了,我是奇怪了,我明明都是指向正确的,接下来的一段时间内那个纠结啊,换了N多个apr和apr-util的版本,TMD的人都快疯了,结果都是不成功,百般无奈之下到疯狂的百度,看到一篇文章也是说遇到我同样的问题,说编译httpd报错的时候,一般依赖文件都在httpd的源码里面自带的,我想,不会我下的这个源码包不全吧,打开在仔细看看,果然没有那个文章里面说的srclib这个文件夹,于是又到官网上去下包,反正又下了个我认为的源码包,下来了才看清晰,好像下错了啦-------httpd-2.3.6-deps.tar.bz2,不对,这个名字?我打开一看,果然有个SRCLIB,NND,我高兴坏了,赶紧丢到服务器上,果然安装APR和apr-util都很顺利。


最后来到http的文件夹内开始congfigure。
[root@rep1 httpd-2.3.6]# ./configure --prefix=/usr/local/apache2  --enable-modules=so  --enable-so  --with-apr=/usr/local/src/httpd-2.3.6/srclib/apr --with-apr-util=/usr/local/src/httpd-2.3.6/srclib/apr-util/
...
configure: error: mod_so can not be built as a shared DSO
 
 
眼看最后关键的最后了,还给我报错。结果我把--enable-modules=so 这个参数删除了,居然成功了。
一个上午尽在折腾安装一个httpd的了。