apache需要 apr, 安装apr需要C compiler[
下载安装apr 和 apr-util
其中的apr-util是对apr存在依赖关系的。(这个在安装的过程中会有体现。)

问题

//一开始的时候的配置
tar zxvf httpd-2.4.3.tar.gz

cd httpd-2.4.3
CFLAGS=”-I/usr/kerberos/include”
./configure –prefix=/usr/local/apache –with-mpm=prefork –enable-so –enable-ssl=static –enable-rewrite=static –enable-proxy=static –enable-deflate=static –enable-headers=static –enable-userdir=static –enable-negotiation=static –disable-auth –disable-autoindex –disable-imap –disable-access –enable-mods-static=few –with-pcre –with-apr=/usr/local/apr –with-apr-util=/usr/local/apr-util

若提示缺少软件包,则手动安装,使用‘./configure –help | grep 模块名’ 查看安装格式。
注意:从apache 2.4版本以后,请用 –with-mpm=prefork 指定使用 apache 的 进程模式,否则,其默认模式是 event 模式
从apache 2.4版本以后,要进行静态编译时,需要使用 =static 选项

make
make install

//这个问题是我在安装make的时候产生的一直难以解决
//在这个问题之前还产生了另一个的问题,具体的错误提示我这便已经忘记了,但是是由于apr 和 apr-util 的版本太高的问题所产生的。所以可以说一下这个问题就是我换了较低的版本之后仍然存在的问题。
/usr/local/apr-util/lib/libaprutil-1.la -lexpat -liconv /usr/local/apr/lib/libapr-1.la -lrt -lcrypt -lpthread
server/.libs/libmain.a(exports.o):(.data+0x1000): undefined reference to `apr_cstr_split’
server/.libs/libmain.a(exports.o):(.data+0x1008): undefined reference to `apr_cstr_split_append’
server/.libs/libmain.a(exports.o):(.data+0x1010): undefined reference to `apr_cstr_match_glob_list’
server/.libs/libmain.a(exports.o):(.data+0x1018): undefined reference to `apr_cstr_match_list’
server/.libs/libmain.a(exports.o):(.data+0x1020): undefined reference to `apr_cstr_tokenize’
server/.libs/libmain.a(exports.o):(.data+0x1028): undefined reference to `apr_cstr_count_newlines’
server/.libs/libmain.a(exports.o):(.data+0x1030): undefined reference to `apr_cstr_casecmp’
server/.libs/libmain.a(exports.o):(.data+0x1038): undefined reference to `apr_cstr_casecmpn’
server/.libs/libmain.a(exports.o):(.data+0x1040): undefined reference to `apr_cstr_strtoi64′
server/.libs/libmain.a(exports.o):(.data+0x1048): undefined reference to `apr_cstr_atoi64′
server/.libs/libmain.a(exports.o):(.data+0x1050): undefined reference to `apr_cstr_atoi’
server/.libs/libmain.a(exports.o):(.data+0x1058): undefined reference to `apr_cstr_strtoui64′
server/.libs/libmain.a(exports.o):(.data+0x1060): undefined reference to `apr_cstr_atoui64′
server/.libs/libmain.a(exports.o):(.data+0x1068): undefined reference to `apr_cstr_atoui’
server/.libs/libmain.a(exports.o):(.data+0x1070): undefined reference to `apr_cstr_skip_prefix’
server/.libs/libmain.a(exports.o):(.data+0x23d8): undefined reference to `apr_redis_hash’
server/.libs/libmain.a(exports.o):(.data+0x23e0): undefined reference to `apr_redis_hash_crc32′
server/.libs/libmain.a(exports.o):(.data+0x23e8): undefined reference to `apr_redis_hash_default’
server/.libs/libmain.a(exports.o):(.data+0x23f0): undefined reference to `apr_redis_find_server_hash’
server/.libs/libmain.a(exports.o):(.data+0x23f8): undefined reference to `apr_redis_find_server_hash_default’
server/.libs/libmain.a(exports.o):(.data+0x2400): undefined reference to `apr_redis_add_server’
server/.libs/libmain.a(exports.o):(.data+0x2408): undefined reference to `apr_redis_find_server’
server/.libs/libmain.a(exports.o):(.data+0x2410): undefined reference to `apr_redis_enable_server’
server/.libs/libmain.a(exports.o):(.data+0x2418): undefined reference to `apr_redis_disable_server’
server/.libs/libmain.a(exports.o):(.data+0x2420): undefined reference to `apr_redis_server_create’
server/.libs/libmain.a(exports.o):(.data+0x2428): undefined reference to `apr_redis_create’
server/.libs/libmain.a(exports.o):(.data+0x2430): undefined reference to `apr_redis_getp’
server/.libs/libmain.a(exports.o):(.data+0x2438): undefined reference to `apr_redis_set’
server/.libs/libmain.a(exports.o):(.data+0x2440): undefined reference to `apr_redis_setex’
server/.libs/libmain.a(exports.o):(.data+0x2448): undefined reference to `apr_redis_delete’
server/.libs/libmain.a(exports.o):(.data+0x2450): undefined reference to `apr_redis_version’
server/.libs/libmain.a(exports.o):(.data+0x2458): undefined reference to `apr_redis_info’
server/.libs/libmain.a(exports.o):(.data+0x2460): undefined reference to `apr_redis_incr’
server/.libs/libmain.a(exports.o):(.data+0x2468): undefined reference to `apr_redis_decr’
server/.libs/libmain.a(exports.o):(.data+0x2470): undefined reference to `apr_redis_ping’
server/.libs/libmain.a(exports.o):(.data+0x2478): undefined reference to `apr_redis_multgetp’
server/.libs/libmain.a(exports.o):(.data+0x2480): undefined reference to `apr_redis_stats’
server/.libs/libmain.a(exports.o):(.data+0x25a0): undefined reference to `apr_siphash’
server/.libs/libmain.a(exports.o):(.data+0x25a8): undefined reference to `apr_siphash_auth’
server/.libs/libmain.a(exports.o):(.data+0x25b0): undefined reference to `apr_siphash24′
server/.libs/libmain.a(exports.o):(.data+0x25b8): undefined reference to `apr_siphash24_auth’
server/.libs/libmain.a(exports.o):(.data+0x25c0): undefined reference to `apr_siphash48′
server/.libs/libmain.a(exports.o):(.data+0x25c8): undefined reference to `apr_siphash48_auth’
collect2: ld returned 1 exit status
make[1]: *** [httpd] 错误 1
make[1]: Leaving directory `/root/桌面/httpd-2.3.8′
make: *** [all-recursive] 错误 1

最后我终于发现了问题在哪里,我通过一篇文章发现需要把apr 和 apr-util 放在http的srclib目录之下,放了之后发现并不能解决问题
所以我修改了配置,添加了一句话–with-included-apr
最后终于设置成功

2018-3-30

经过这几天对Linux 的了解之后发现这种方法只是权宜之计,原本的是将apr安装好之后进行安装然后指定路径,但是现在的问题就是因为指定了路径之后还是找不到文件目录的位置,所以我们应该想办法解决这个路径找不到的问题。还在更新中。。。(发现这样是最快的方法)