环境: Red Hat Enterprise Linux Server release 6.2 (Santiago)

内核: 2.6.32-220.el6.x86_64

Apache版本:httpd-2.4.1

安装文件存放路径:/home/software/lamp/

编译参数:

[root@A12 lamp]# cd httpd-2.4.1

[root@A12 httpd-2.4.1]# ./configure --prefix=/lamp/apache/  \  

--enable-deflate  \

--enable-expire  \

--enable-headers  \

--enable-modules=most  \

--enable-so  \

--with-mpm=worker  \

--enable-rewrite

 

Configuring Apache Portable Runtime library ...

checking for APR... no

configure: error: APR not found.  Please read the documentation.

 提示少了APR依赖;安装APR:

[root@A12 httpd-2.4.1]# ls ../apr-

apr-1.4.6/             apr-util-1.4.1/

apr-1.4.6.tar.gz       apr-util-1.4.1.tar.gz

[root@A12 apr-1.4.6]# ./configure --prefix=/usr/local/apr

[root@A12 apr-1.4.6]#make

[root@A12 apr-1.4.6]#make install

 

[root@A12 lamp]# cd apr-util-1.4.1

[root@A12 apr-util-1.4.1]# ./configure --with-apr=/usr/local/apr

[root@A12 apr-util-1.4.1]# make

[root@A12 apr-util-1.4.1]# make install

 

编译httpd-2.4.1

[root@A12 lamp]# cd httpd-2.4.1

[root@A12 httpd-2.4.1]# ./configure --prefix=/lamp/apache/  \

--enable-deflate  \

--enable-expire  \

--enable-headers  \

--enable-modules=most  \

--enable-so  \

--with-mpm=worker  \

--enable-rewrite

 

[root@A12 httpd-2.4.1]# make

[root@A12 httpd-2.4.1]# make install


[root@A12 lamp]# cd /lamp/apache/bin/

[root@A12 bin]# ./apachectl -t

AH00557: httpd: apr_sockaddr_info_get() failed for A12.loading.com

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

Syntax OK


[root@A12 bin]# ./apachectl start

AH00557: httpd: apr_sockaddr_info_get() failed for A12.loading.com

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

 

再使用浏览器登陆,如果看到下述显示,表示apache安装成功了:

 http://IP

Linux-apache的编译安装1_安装