1,下载apache(httpd)源码;
https://httpd.apache.org/
2,检查当前系统中是否已安装过apache,如安装过,则需要先卸载;
3,需要依赖APR,所以要先安装APR库支持和PCRE;
APR下载:http://apr.apache.org/download.cgi
PCRE下载:http://www.pcre.org/
注:编译pcre时报错要求安装c++编译器:
configure: error: You need a C++ compiler for C++ support.
安装编译器即可:
[iyunv@localhost pcre-8.38]# yum install gcc-c++
[iyunv@localhost pcre-8.38]# yum install gcc
------------以下安装APR+PCRE----------------
[iyunv@localhost apr-1.4.5]# pwd
/usr/local/apr-1.4.5
[iyunv@localhost apr-1.4.5]# ./configure --prefix=/usr/local/apr
[iyunv@localhost apr-1.4.5]#make
[iyunv@localhost apr-1.4.5]#make install
[iyunv@localhost apr-util-1.5.4]# pwd
/usr/local/apr-util-1.5.4
[iyunv@localhost apr-util-1.5.4]# ./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr/
[iyunv@localhost apr-util-1.5.4]#make
[iyunv@localhost apr-util-1.5.4]#make install
[iyunv@localhost pcre-8.38]# pwd /usr/local/pcre-8.38 [iyunv@localhost pcre-8.38]#./configure --prefix=/usr/local/pcre [iyunv@localhost pcre-8.38]# make [iyunv@localhost pcre-8.38]# make install
4,解压apache,进行安装即可。
1)进入当前apache目录:#./configure --prefix=/usr/local/apache --with-apr-util=/usr/local/apr-util/ --with-pcre=/usr/local/pcre/
2)make
3) make install
5,完成安装后进行相关配置。
|