一、下载
#cd /usr/local/src/
#wget http://mirrors.sohu.com/apache/httpd-2.2.31.tar.bz2
#tar jvxf http-2.2.31.tar.bz2
二、配置编译参数
#cd httpd-2.2.31
#./configure \
--prefix=/usr/local/apache2 \ //指定安装到哪里
--with-included-apr \
--enable-so \ //表示启用DSO
--enable-deflate=shared \ //表示动态共享方式编译deflate模块
--enable-expires=shared \
--enable-rewrite=shared \
--with-pcre
#yum install –y zlib-devel //提示错误则安装
#yum install –y pcre pcre-devel apr apr-devel //避免make时候出现错误,提前安装库文件
三、编译和安装
#make
#make install
#echo $? //输出0则安装正确
#/usr/local/apache2/bin/apachectl start //启动Apache系统
#ps aux |grep httpd //查看是否启动起来
#netstat –lnp
#/usr/local/apache2/bin/apachectl – M //列出模块,static静态加载模块,shared动态加载模块
#/usr/local/apache2/bin/apachectl –l //列出静态加载模块
#/usr/local/apache2/bin/apachectl –t //检查是否有错误
#/usr/local/apache2/bin/apachectl restart //杀死进程,重启
#/usr/local/apache2/bin/apachectl graceful //保留进程,重启