1、安装prce解决依赖关系
#yum -y install pcre-devel
2、编译安装apr-1.5.1:
#./configure --prefix=/usr/local/apr
#make && make install
3、编译安装apr-util-1.5.4
#./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr/
#make && make install
4、编译安装httpd-2.4.10(可能会提示openssl太旧,则编译安装最新版,并加上 --with-ssl=/usr/local/openssl)
#tar xf httpd-2.4.9.tar.bz2
#cd httpd-2.4.9
#./configure --prefix=/usr/local/apache --sysconfdir=/etc/httpd24 --enable-so--enable-ssl --enable-cgi --enable-rewrite --with-zlib --with-pcre--with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util/--enable-modules=most --enable-mpms-shared=all --with-mpm=event
#make && make install
5、编译后操作
1)导出头文件
#ln -sv /usr/local/apache/include /usr/include/httpd
2)导出库文件
#ldconfig
#ldconfig -p
3)导出man手册
#vim /etc/man.config
4)输出二进制程序
#vim /etc/profile.d/httpd.sh
exportPATH=/usr/local/apache/bin:$PATH
6、配置文件:
/etc/httpd24/httpd.conf ---------- 主配置文件
/etc/httpd24/extra/httpd-mpm.conf ------------- MPM配置文件(配置各MPM的参数)
更换MPM:
修改加载的模块名称,重启httpd即可