安装Apache2.4.7版本。
下载地址为:http://mirrors.sohu.com/apache/
tar zxvf httpd-2.4.7.tar.gz #解压文件
cd httpd-2.4.7 #进入目录
./configure --prefix=/usr/local/apache2/ --sysconfdir=/usr/local/apache2/etc --with-included-apr --enable-so --enable-deflate=shared --enable-expires=shared --enable-rewrite=shared #编译参数
错误
configure: error:Bundled APR requested but not found at./srclib/.
tar zxvf apr-1.4.6.tar.gz #解压apr包
tar -zxvf apr-util-1.4.1.tar.gz #解压apr-util包
cp -r /lamp/apr-1.4.6 /lamp/httpd-2.4.7/srclib/apr
cp -r /lamp/apr-util-1.4.1 /lamp/httpd-2.4.7/srclib/apr-util # 然后把两个包复制到httpd-2.4.7/srclib/ 里面并且取消版本号。
错误:
configure: error: in `/lamp/httpd-2.4.7/srclib/apr':
configure: error: no acceptable C compiler found in $PATH
See `config.log' for more details
configure failed for srclib/apr
yum -y install gcc-c++ #安装 gcc
错误:
configure: error: pcre-config for libpcre not found. PCRE is required and available from http://pcre.org/
tar zxvf pcre-8.34.tar.gz
[iyunv@localhost lamp]# cd pcre-8.34
[iyunv@localhost pcre-8.34]# ./configure && make && make install
错误
checking whether to enable mod_deflate... configure: error: mod_deflate has been requested but can not be built due to prerequisite failures
yum -y install openssl-devel #yum安装
把上面4个错误解决后。重新 ./configure 参数编译 无问题就执行
make
make install
tar zxvf libmcrypt-2.5.8.tar.gz
cd libmcrypt-2.5.8
./configure --prefix=/usr/local/related/libmcrypt
make
make install
安装 libltdl,也在libmcrypt源码包里面
cd libmcrypt-2.5.8 /libltdl
./configure --enable-ltdl-install
make
make install
下载mhash-0.9.9.9.tar.gz
tar zxvf mhash-0.9.9.9
cd mhash-0.9.9.9
./configrue --prefix
make
make install
这两个包安装完。然后在安装mcrypt包。
安装mcrypt
tar zxvf mcrypt-2.6.8.tar.gz
LD_LIBRARY_PATH=/usr/local/libmcrypt/lib:/usr/local/lib ./configure --with-libmcrypt-prefix=/usr/local/libmcrypt #编译参数
make
make install
#mcrypt 没有安装完成。这是php模块。需要等php安装完成之后。在继续安装。