标签:apache
下载
[root@localhost ~]# cd /usr/local/src
[root@localhost src]# wget http://mirrors.sohu.com/apache/httpd-2.2.31.tar.gz
解压
tar zxvf httpd-2.2.31.tar.gz
进入目录
[root@localhost src]# ls
httpd-2.2.31 httpd-2.2.31.tar.bz2 httpd-2.2.31.tar.gz
[root@localhost src]# cd /usr/local/src/httpd-2.2.31
[root@localhost httpd-2.2.31]# ls
ABOUT_APACHE config.layout httpd.spec LICENSE README.platforms
acinclude.m4 configure include Makefile.in README-win32.txt
Apache.dsw configure.in INSTALL Makefile.win ROADMAP
build docs InstallBin.dsp modules server
BuildAll.dsp emacs-style LAYOUT NOTICE srclib
BuildBin.dsp httpd.dep libhttpd.dep NWGNUmakefile support
buildconf httpd.dsp libhttpd.dsp os test
CHANGES httpd.mak libhttpd.mak README VERSIONING
配置编译参数
--prefix
指定安装到哪里, --enable-so
表示启用DSO --enable-deflate=shared
表示共享的方式编译deflate,后面的参数同理。如果这一步你出现了这样的错误:
error:mod_deflate has been repuested but can not be built due to preerquisite falures
解决办法是:
[root@localhost httpd-2.2.31]# yum install -y zlib-devel
为了避免在make的时候出现错误,所以最好是提前先安装好一些库文件
yum install -y pcre pcre-devel apr ape-devel
[root@localhost httpd-2.2.31]# ./configure \
> --prefix=/usr/local/apache2 \
> --with-included-apr \
> --enable-so \
> --enable-deflate=shared \
> --enable-expires=shared \
> --enable-rewrite=shared \
> --with-pcre
5.编译
[root@localhost httpd-2.2.31]# make
6.安装
make install
本文出自 “不尽黄沙滚滚来” 博客,请务必保留此出处http://loveemily.blog.51cto.com/6205266/1775247
标签:apache
原文地址:http://loveemily.blog.51cto.com/6205266/1775247