首页 > 代码库 > CentOS 编译安装Apache2.4.10

CentOS 编译安装Apache2.4.10

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

注意的问题:

报错信息 :
configure: error: pcre-config for libpcre not found. PCRE is required and available from http://pcre.org/    
解决办法:执行yum -y install pcre pcre-devel 即可解决该报错。
报错信息:
     
checking for APR... noconfigure: error: APR not found .  Please read the documentation.

解决办法:
  需要下载apr的最新版本的安装文件:
      
  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

      执行入下命令,重新进行编译:

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

      

 


  

CentOS 编译安装Apache2.4.10