Ubuntu 下配置apache和APR

软件环境:ubuntu14.04  虚拟机Vmware  软件:http://httpd.apache.org/  httpd-2.2.29.tar.gz  不需要单独下载APR。

1.解压apache源码
# tar xvzf httpd-2.2.29.gz
# cd httpd-2.2.29
2.安装apr
# cd srclib/apr
# ./configure --prefix=/usr/local/apr //配置到指定目录
# make
# make install //需要再root模式下运行 前面加sudo
3.安装apr-util
# cd ../apr-util/
# ./configure --prefix=/usr/local/apr-util 
    --with-apr=/usr/local/apr
# make
# make install //需要root权限 前面加sudo
# cd ../../
4.安装apache

#./configure --prefix=/usr/local/apache2 --enable-modules=so --enable-mods-shared=all --enable-proxy --enable-proxy-connect --enable-proxy-ftp --enable-proxy-http --enable-proxy-ajp --enable-proxy-balancer --enable-rewrite--enable-status --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util/ 
//如果有错误
mod_deflate has been requested but can not be built due to prerequisite failures(ubuntu centent) 那是没有安装zlib包。centos下可以采用yum install zlib-devel, ubuntu下可以采用apt-get install zlib1g-dev.

# make
# make install 同上

5. 安装tomcat-native.tar.gz  //暂时没配
# cd /opt/tomcat/bin
# tar zxvf tomcat-native.tar.gz
# cd tomcat-native-src/jni/native
# ./configure --with-apr=/usr/local/apr

 6. 添加环境变量

# vim /etc/profile
添加:export LD_LIBRARY_PATH=/usr/local/apr/lib

 

郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。