1.下载httpd-2.4.7.tar.gz
[root soft]# wget http://apache.dataguru.cn//httpd/httpd-2.4.7.tar.gz2.解压[root soft]# tar xvf httpd-2.4.7.tar.gz [root soft]# cd httpd-2.4.7[root httpd-2.4.7]# vim INSTALL $ ./configure --prefix=PREFIX $ make $ make install $ PREFIX/bin/apachectl start3.编译安装apr[root soft]# wget http://mirrors.cnnic.cn/apache//apr/apr-1.5.0.tar.gz[root soft]# cd apr-1.5.0[root apr-1.5.0]# ./configure --prefix=/etc/apr [root apr-1.5.0]#make && make install4.编译安装apr-util[root soft]# wget http://mirror.bit.edu.cn/apache//apr/apr-util-1.5.3.tar.gz[root soft]# cd apr-util-1.5.3[root soft]#./configure --prefix=/etc/apr-util --with-apr=/etc/apr [root soft]#make && make install5.编译安装httpd[root httpd-2.4.7]# ./configure --prefix=/usr/local/httpd --sysconfdir=/usr/local/httpd/conf/ --enable-so --enable-rewirte --enable-ssl --enable-cgi --enable-cgid --enable-modules=most --enable-mpms-shared=all --with-apr=/etc/apr --with-apr-util=/etc/apr-util[root httpd-2.4.7]#make && make install--prefix= :指定安装目标路径--sysconfdir= :指定配置文件安装位置--enable-so :支持动态共享模块,如果没有这个模块PHP将无法与apache结合工作--enable-rewirte :支持URL重写--enable-ssl :启用支持ssl--enable-cgi :启用支持cgi--enable-cgid :启用支持带线状图形的CGI脚本 MPMs--enable-modules=most :安装大多数模块--enable-modules-shared=most :安装大多数共享模块--enable-mpms-shared=all :支持全部多道处理方式--with-apr=/etc/apr :指定apr路径--with-apr-util=/etc/apr-util :指定apr-util路径6.apache自启动#cp /usr/local/httpd/bin/apachectl /etc/rc.d/init.d/httpd #把apache加入到系统启动cp /usr/local/httpd/bin/apachectl /etc/init.d/httpd vi /etc/init.d/httpd #!/bin/sh#chkconfig:2345 10 90#descrption:Activates/Deactivates Apache Web Serverchmod +x /etc/init.d/httpd chkconfig --add httpd/etc/init.d/httpd start#设置开机启动chkconfig httpd on