直接安装httpd, 如果没有错误提示直接可以略过一下的步骤,但是我在配置的过程中出现了很多错误,现在总结如下:
[root@kong test]# tar -zxf httpd-2.4.1.tar.gz
[root@kong httpd-2.4.1]# ./configure --prefix=/usr/local/apache2
1.出现的错误提示:apr not found
解决apr not found问题
APR和APR-UTIL的下载地址:http://apr.apache.org/download.cgi
[root@kong test]# tar -zxf apr-1.4.6.tar.gz
[root@kong apr-1.4.6]# ./configure --prefix=/usr/local/apr
[root@kong apr-1.4.6]# make
[root@kong apr-1.4.6]# make install
2.解决APR-util not found问题
[root@kong test]# tar -zxf apr-util-1.4.1.tar.gz
[root@kong apr-util-1.4.1]# ./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr/bin/apr-1-config
[root@kong apr-util-1.4.1]# make
[root@kong apr-util-1.4.1]# make install
3 ../configure仍提示APR-util not found
增加--with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util后出现
configure: error: pcre-config for libpcre not found. PCRE is required and available from http://pcre.org/
#./configure –help | grep pcre
--with-pcre=PATH Use external PCRE library
#tar –zxvf pcre-8.10.tar.gz
#cd pcre-8.10
#./configure --prefix=/usr/local/pcre
#make
4.出现:libtool: line 990: g++: command not found错误
执行:apt-get install g++
再次执行make出现:
5.出现:
make[1]: *** [libpcrecpp.la] 错误 1
make[1]: Leaving directory `/usr/local/pcre-8.10'
make: *** [all] 错误 2
执行:apt-get install buold-essential
6.执行./configure --disable-shared --with-pic
再执行:
#make
#make install
7.编译Apache
[root@kong httpd-2.4.1]# ./configure --prefix=/usr/local/apache2 --with-apr=/usr/local/apr--with-apr-util=/usr/local/apr-util/ -with-pcre=/usr/local/pcre
[root@kong httpd-2.4.1]# make
[root@kong httpd-2.4.1]# make install
[root@kong httpd-2.4.1]# /usr/local/apache2/bin/apachectl start
在IE中输入地址,显示:
It works!
Apache安装完成。