[root@ebadu tmp]# wget http://mirror.bjtu.edu.cn/apache//httpd/httpd-2.2.24.tar.gz
[root@ebadu tmp]# tar xzf httpd-2.2.24.tar.gz
[root@ebadu tmp]# cd httpd-2.2.24
先安装需要的依赖包
yum install -y gcc gcc-c++ make sudo autoconf libtool-ltdl-devel gd-devel freetype-devel libxml2-devel libjpeg-devel libpng-devel openssl-devel curl-devel patch libmcrypt-devel libmhash-devel ncurses-devel bzip2 libcap-devel ntp sysklogd
运行安装php
selinux可能会致使编译安装失败,我们先禁用它。 1、安装编译工具gcc gcc-c++make automake autoconf kernel-devel
1 sed-i 's/SELINUX=enforcing/SELINUX
=disabled/g' /etc/selinux/config //永久禁用,需要重启生效
2 setenforce 0 //临时禁用,不需要重启
yum安装必要工具
2、安装PHP所需依赖,如libxml2-devel openssl-devel curl-devel libjpeg-devel libpng-devel等
yum -y install gcc gcc-c++ make automake autoconf kernel-devel ncurses-devel libxml2-devel openssl-devel curl-devel libjpeg-devel libpng-devel pcre-devel libtool-libs freetype-devel gd zlib-devel file bison patch mlocate flex diffutils readline-devel glibc-devel glib2-devel bzip2-devel gettext-devel libcap-devel libmcrypt-devel
安装apache
编译参数解释:
–prefix=/usr/local/apache:指定安装目录
–with-included-apr:在编译时强制使用当前源代码中绑定的APR版本
–enable-so:允许运行时加载DSO模块
–enable-deflate=shared:将deflate模块编译为DSO
–enable-expires=shared:将expires模块编译为DSO
–enable-headers=shared:将headers模块编译为DSO
–enable-rewrite=shared:将rewrite模块编译为DSO
–enable-static-support:使用静态连接(默认为动态连接)编译所有二进制支持程序
更详细的编译参数解释:http://lamp.linux.gov.cn/Apache/ApacheMenu/programs/configure.html\
##到这一步,会卡,配置好的会卡一会,不好的会卡10几分钟,等待即可。