不知道为什么在安装apache2.2.22版本的时候没有任何问题,直接使用命令
./configure --prefix=/home/www/www_test/software/apache-2.2.22 --enable-proxy --enable-so --enable-mods-shared=most --with-mpm=worker
没有任何问题,不过在安装新版本2.4.2的时候就会报错。
解决方案如下:
#./configure --prefix……检查编辑环境时出现:
checking for APR... no
configure: error: APR not found . Please read the documentation.
可以用./configure –help | grep apr 查看帮助。
--with-included-apr Use bundled copies of APR/APR-Util
--with-apr=PATH prefix for installed APR or the full path to apr-config
--with-apr-util=PATH prefix for installed APU or the full path to
安装APR(Apache Portable Runtime )
[[email protected] ~]# cd /tmp/52lamp/ //源码存放位置
[[email protected] 52lamp]# tar -zxvf apr-1.4.2.tar.gz //unzip -o apr-1.4.2.zip
[[email protected] 52lamp]# cd apr-1.4.2
[[email protected] apr-1.4.2]# ./configure
[[email protected] apr-1.4.2]# make
[[email protected] apr-1.4.2]# make install
再次检查编译环境出现
checking for APR-util... no
configure: error: APR-util not found . Please read the documentation.
[[email protected] httpd-2.2.16]# ./configure –help | grep apr-util
--with-apr-util=PATH prefix for installed APU or the full path to
[[email protected] 52lamp]# tar -zxvf apr-util-1.3.9.tar.gz
[[email protected] 52lamp]# cd apr-util-1.3.9
[[email protected] apr-util-1.3.9]# ./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr
[[email protected] apr-util-1.3.9]# make
[[email protected] apr-util-1.3.9]# make install
./configure仍提示APR-util not found,增加--with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util后出现
configure: error: pcre-config for libpcre not found. PCRE is required and available from http://pcre.org/
[[email protected] httpd-2.2.16]# ./configure –help | grep pcre
--with-pcre=PATH Use external PCRE library
[[email protected] 52lamp]# unzip -o pcre-8.10.zip
[[email protected] 52lamp]# cd pcre-8.10
[[email protected] cd pcre-8.10]# ./configure --prefix=/usr/local/pcre
[[email protected] cd pcre-8.10]# make
[[email protected] cd pcre-8.10]# make install
继续安装Apache/httpd,./configure 时加上参数 --with-apr=/usr/local/apr/ --with-apr-util=/usr/local/apr-util/ --with-pcre=/usr/local/pcre,这个问题就解决了。
下载链接:
http://download.chinaunix.net/download/0001000/66.shtml
http://download.chinaunix.net/download/0001000/470.shtml
http://download.chinaunix.net/download/0008000/7913.shtml