[root@localhost mypackagers]# tar xvf apr-1.5.2
[root@localhost mypackagers]# cd apr-1.5.2
[root@localhost mypackagers]#./configure --prefix=/usr/local/apr
[root@localhost mypackagers]#make && install 2.3安装apr-util
[root@localhost mypackagers]# tar xvf apr-util-1.5.4.tar.gz
[root@localhost mypackagers]# cd apr-util-1.5.4
[root@localhost mypackagers]#./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr
[root@localhost mypackagers]#make && install 2.3安装pcre
[root@localhost mypackagers]# tar xvf pcre-8.39.tar.gz
[root@localhost mypackagers]# cd pcre-8.39
[root@localhost pcre-8.39]# ./configure --prefix=/usr/local/pcre
[root@localhost pcre-8.39]# make && make install 2.4安装httpd
[root@localhost mypackagers]#tar xvf httpd-2.4.23.tar.gz
[root@localhost mypackagers]# cd httpd-2.4.23
[root@localhost httpd-2.4.23]# ./configure --prefix=/usr/local/apache --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util --with-pcre=/usr/local/pcre/
[root@localhosthttpd-2.4.23]#make && make install 五、启动和设置开机自启
1、configure:error: APR / APR-util not found. Pleaseread the documentation.表示apr/apr-util没有安装,先安装apr,再安装apr-util,因为apr-util依赖apr,安装apr和apr-util之前需安装gcc工具,否则会提示configure: error: no acceptable C compiler found in $PATH.
2、configure: error: pcre-config forlibpcre not found. PCRE is required and available from http://pcre.org/,是因为pcre没有安装,安装pcre之前需要先安装gcc-c++,否则会提示configure: error: You need aC++ compiler for C++ support.
3、ServerName服务器域名
[root@localhost~]# /usr/local/apache/bin/apachectl start
AH00558:httpd: Could not reliably determine the server's fully qualified domain name,using::1. Set the 'ServerName' directive globally to suppress this message
[root@localhost conf]# cd /usr/local/apache/conf/
[root@localhost conf]# vi httpd.conf 在#ServerName www.example.com:80下增加一条 ServerName localhost:80