参考:http://blog.chinaunix.net/uid-26986973-id-3246235.html
在Apache安装前需要先安装好这样四个东西,要不然有可能会报错
【安装Apache提示APR not found的解决办法】
==========================================================
apr
apr-util
pcre //这个一定要是pcre而不能是pcre2
zlib
===========================================================
#注:如果发生安装过程中报错的情况,可以先检查一下是不是目标文件夹是不是已经存在,如果是先清空,然后尝试 #make clean然后重新make
tar -zxvf apr-1.4.2.tar.gz
cd apr-1.4.2
./configure --prefix=/usr/local/apr
make
make install
tar -zxvf apr-util-1.3.9.tar.gz
cd apr-util-1.3.9
./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr
make
make install
unzip -o pcre-8.10.zip
cd pcre-8.10
./configure --prefix=/usr/local/pcre
make
make install
cd http-xxx ./configure --prefix=/usr/local/apache2 --enable-module=shared --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util ======================================================================================================
./configure --prefix=/usr/local/apache2 --enable-so -enable-proxy -enable-proxy_http=shared --enable-module=so --enable-mods-shared=all --enable-proxy-ajp=shared --enable-proxy-balancer -with-mpm=worker --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util --with-z=/usr/local/zlib --with-pcre=/usr/local/pcre ======================================================================================================
make make install
错误列表
1.报错apache Did not find pcre-config script at /usr/local/pcre那么有可能就是你安装的pcre不对,重新下载注意是pcre而不是pcre2-xxx
2.error: Size of "void *" is less than size of "long"
那么添加上一个参数:
(1)、移除--with-pcre=/xxx/xxx/pcre选项,未尝试,
(2)、增加 ap_cv_void_ptr_lt_long=no ,可行
3.报错
checking whether to enable mod_deflate...
checking dependencies
checking for zlib location... not found
checking whether to enable mod_deflate...
configure: error: mod_deflate has been requested but can not be built due to prerequisite failures
当在红帽子里边使用指令rpm -qa|grep zlib,发现系统的确安装了,只是找不到正确的路径,尝试添加参数 --withz=/usr/lib64/或 --with-z=/usr/lib/。发现还是不可行,干脆在/usr/local/zlib安装了一个,然后--with-z=/usr/local/zlib问题得以解决。