码迷,mamicode.com
首页 > Web开发 > 详细

源码编译安装apache

时间:2016-05-20 14:51:40      阅读:200      评论:0      收藏:0      [点我收藏+]

标签:apache

  1. 下载


    [root@localhost ~]# cd /usr/local/src

    [root@localhost src]# wget http://mirrors.sohu.com/apache/httpd-2.2.31.tar.gz

  2. 解压

    tar zxvf httpd-2.2.31.tar.gz

  3. 进入目录



    [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

  4. 配置编译参数

    --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

标签:apache

原文地址:http://loveemily.blog.51cto.com/6205266/1775247

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!