安装apache服务
    注:最快的办法就是yum -y install gcc-c++ apr apr-utils pcre-devel openssl
Yum remove http                                        //卸载自带的http服务
tar zxvf httpd-2.4.3.tar.gz                        //解压apache的压缩包
cd httpd-2-4.3                                                //定位到httpd目录
./configure --help | more                        //查看安装apache配置参数
./configure --prefix=/usr/local/apache --enable-so --enable-rewrite
######配置apache路径
报错,如图所示:


解决办法:
需要下载apr和apr-util并解压到/usr/local/httpd-2.4.2/srclib/目录下
#wget http://apache.etoak.com//apr/apr-util-1.4.1.tar.gz
#wget http://apache.etoak.com//apr/apr-1.4.6.tar.gz
#tar zxvf apr-1.4.6.tar.gz
#tar zxvf apr-utli-1.4.1.tar.gz
#cp -rf apr-1.4.6 httpd-2.4.1/srclib/apr
#cp -rf apr-util-1.4.6 httpd-2.4.1/srclib/apr-util
重新编译还报错


[root@localhost CentOS]# rpm -ivh pcre-devel-6.6-6.el5.i386.rpm
最后再次编译:
#./configure --prefix=/usr/local/apache --enable-so --enable-rewrite
========终于编译成功了。。。@_@
make                                                         //编译apache
make install                                                //安装apache
cd /usr/local/apache                                 //进入apache的目录
cd conf/
cp –rf  httpd.conf httpd.conf.bak         //备份apache配置文件
/usr/local/apache/bin/apachectl start        //linux启动apache命令
netstat -an | grep 80                                //查看linux80端口是否开启
ps -aux | grep httpd                                //linux下查看apache进程
cp /usr/local/apache/bin/apachectl /etc/rc.d/init.d/httpd         //拷贝apache启动脚本
chkconfig --add httpd                                //添加apache开机自启动服务
chocnfig httpd on
service apache restart                                //重新启动apache服务
#####################到这里apache服务安装到结束#######################