安装apache时checking for APR... no错误的解决方法

发布时间:2020-02-09编辑:脚本学堂
#./configure --prefix……检查编辑环境时出现:
checking for APR... no
configure: error: APR not found . Please read the documentation.

安装apache时checking for APR... no错误的解决方法

#./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 )
下载:http://apr.apache.org/download.cgi
 

复制代码 代码如下:
#tar -zxvf apr-1.4.6.tar.gz
# cd /apr-1.4.6
#./configure --prefix=/usr/local/apr
#make
#make install

再次检查编译环境出现
 

复制代码 代码如下:
checking for APR-util... no
configure: error: APR-util not found . Please read the documentation.
#./configure –help | grep apr-util
--with-apr-util=PATH prefix for installed APU or the full path to

下载:http://download.chinaunix.net/download/0001000/472.shtml
#tar -zxvf apr-util-1.4.1.tar.gz
#cd /apr-util-1.4.1
#./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/usr
#make
#make install

之后到/oracle/http-2.4.2路径下
 

复制代码 代码如下:
./configure --prefix=/usr/local/apache --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util
#make
make install

注意:Apache在安装时不会检查参数是否正确,错误的参数会直接被丢弃,不会报告给用户。但可以使用echo $?命令检查是否有错误,当输出结果为0时表示没有错误。
#echo $?
0

设置 apache 开机时自动启动
cp /usr/local/apache/httpd/bin/apachectl /sbin/

在#vi /etc/rc.d/rc.local
增加一行 /sbin/apachectl start

可以在本地输入127.0.0.1来测试apache是否已经启动。