日期:2014-05-16 浏览次数:20981 次
首先需要下载apache源代码及相关软件,下载地址分别是:
apache:http://httpd.apache.org/download.cgi
apr/apr-util:http://apr.apache.org/download.cgi
pcre:http://ftp.exim.llorien.org/pcre/
apache不用说了,apr/apr-util/pcre都是安装apache所必须的软件。
首先编译安装apache
[root@localhost apache]# tar jxvf httpd-2.4.1.tar.bz2 //解压apache的压缩包
[root@localhost apache]# cd httpd-2.4.1 //定位到httpd-2.4.1 文件夹下
[root@localhost httpd-2.4.1]# ls //查看显示httpd-2.4.1 文件夹下内容
[root@localhost httpd-2.4.1]#./configure --help | more //查看安装apache配置参数
[root@localhost httpd-2.4.1]#./configure --prefix=/usr/local/apache --enable-so // 配置apache路径 ,后面跟 --enable-so 参数表示让apache核心装载DSO
[root@localhost httpd-2.4.1]# make //编译apache
到了这里会报错
configure: error: APR not found. Please read the documentation
此时,安装下载的apr
[root@localhost apache]# tar -zxf apr-1.4.6.tar.gz
[root@localhost apache]# cd apr-1.4.6
[root@localhost apr-1.4.6]# ./configure --prefix=/usr/local/apr
[root@localhost apr-1.4.6]# make
[root@localhost apr-1.4.6]# make install
重新编译apache,又报错
configure: error: APR-util not found. Please read the documentation
要安装下载的apr-util
[root@localhost apache]# tar -zxf apr-util-1.4.1.tar.gz
[root@localhost apache]# cd apr-util-1.4.1
[root@localhost apr-util-1.4.1]# ./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr/bin/apr-1-config
[root@localhost apr-util-1.4.1]# make
[root@localhost apr-util-1.4.1]# make install