1. 下载apr apr-util 包
http://apr.apache.org/download.cgi
2. 安装apr 和 apr-util 包
tar -vxzf apr-1.5.2.tar.gz
cd apr-1.5.2
./configure --prefix=/usr/local/apr
make
make install
=========
tar -vxzf apr-util-1.5.4.tar.gz
cd apr-util-1.5.4
./configure --prefix=/usr/local/apr-util -with-apr=/usr/local/apr/bin/apr-1-config
make
make install
3. 安装pcre
下载pcre源码包 :http://sourceforge.net/projects/pcre/files/latest/download
tar vxzf pcre-8.31.tar.gz
cd prce-8.31
./configure --prefix=/usr/local/pcre
make
make install
4. 安装apache
下载http的源码包
http://httpd.apache.org/download.cgi
tar -vxzf httpd-2.4.3.tar.gz
cd httpd-2.4.3
./configure --prefix=/usr/local/apache2 --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util --with-pcre=/usr/local/pcre
make
make install
5. 启动apache
•启动Apache:/usr/local/apache2/bin/apachectl start
•停止Apache:/usr/local/apache2/bin/apachectl stop
•重启Apache:/usr/local/apache2/bin/apachectl restart
6. init.d service
cp /usr/local/apache2/bin/apachectl /etc/init.d/httpd
7.错误解决
AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using localhost.localdomain. Set the 'ServerName' directive globally to suppress this message
修改httpd.conf文件
将#ServerName 前面的注释去掉。