Apache 编译安装

httpd-2.4.2.tar.gz
apr-1.4.6.tar.gz
apr-util-1.4.1.tar.gz
pcre-8.30.tar.gz

参考:http://hi.baidu.com/ziiip/blog/item/107d760d7cdac1a22fddd4f4.html  

[root@shenq58 httpd-2.4.2]# ./configure --prefix=/usr/local/apache
checking for chosen layout... Apache
checking for working mkdir -p... yes
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking build system type... i686-pc-linux-gnu
checking host system type... i686-pc-linux-gnu
checking target system type... i686-pc-linux-gnu

Configuring Apache Portable Runtime library ...

checking for APR... no
configure: error: APR not found.  Please read the documentation.
[root@shenq58 httpd-2.4.2]# 
 
yum install gcc cc
 
报错1:configure: error: APR not found. Please read the documentation.
安装apr软件
APR 1.4.6
 
报错2:configure: error: APR-util not found. Please read the documentation
APR-util 1.4.1
 
报错3:configure: error: pcre-config for libpcre not found. PCRE is required and available from http://pcre.org/ 
安装pcre
 
安装pcre报错:
libtool: ignoring unknown tag CXX
libtool: unrecognized option `-DHAVE_CONFIG_H'
Try `libtool --help' for more information.
make[1]: *** [pcrecpp.lo] Error 1
make[1]: Leaving directory `/usr/local/directadmin/custombuild/pcre-7.8'
make: *** [all] Error 2
 
yum install gcc-c++   解决pcre安装问题。


安装apache
[root@shenq58 httpd-2.4.2]# ./configure --prefix=/usr/local/apache2 --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util/ --with-pcre=/usr/local/pcre
[root@shenq58 httpd-2.4.2]# make
[root@shenq58 httpd-2.4.2]# make install
 
[root@shenq58 conf]# /usr/local/apache2/bin/apachectl -k start
AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1. Set the 'ServerName' directive globally to suppress this message
[root@shenq58 conf]#
 
 
配置文件注释掉这一行
nano httpd.conf
访问