您的位置:首页 > 运维架构 > Apache

CentOS 编译安装Apache2.4.10

2014-09-30 17:43 411 查看
1、准备编译环境

  yum -y install gcc make cmake autoconf libtool libevent

  安装apache必须的依赖包

  yum -y install apr-util apr pcre pcre-devel

2、下载软件包

  wget http://mirror.bit.edu.cn/apache//httpd/httpd-2.4.10.tar.gz
  解压软件包:

  tar -xzf httpd-2.4.10.tar.gz

3、编译安装(Apache 版本低于2.X的按照以下步骤操作)

  ./configure --prefix=/usr/local/httpd

  make

  make install


注意的问题:

报错信息 :
[/code]

configure: error: pcre-config for libpcre not found. PCRE is required and available from 
    ' target='_blank'>http://pcre.org/
    [/code]

解决办法
:执行yum -y install pcre pcre-devel 即可解决该报错。
报错信息:
     [/code]

checking for APR... no
configure: error: APR not found .  Please read the documentation.


解决办法:
  需要下载apr的最新版本的安装文件:
      
[/code]

  wget http://mirror.atlanticmetro.net/apache//apr/apr-1.4.6.tar.gz   wget http://mirror.atlanticmetro.net/apache//apr/apr-util-1.4.1.tar.gz   tar xvfz apr-1.4.6.tar.gz
  tar xvfz apr-util-1.4.1.tar.gz
  mv apr-1.4.6 httpd-2.4.2/srclib/apr (注意此目录为你自己的apache的安装文件的目录)
  mv apr-util-1.4.1 httpd-2.4.2/srclib/apr-uti


[/code]
      执行入下命令,重新进行编译:

  ./configure --prefix=/usr/local/httpd --with-included-apr
  make
  make install


      


[/code]
  
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: