阿里云Centos 7.2 安装apache踩的坑

Apache下载:http://httpd.apache.org/download.cgi#apache24
官方安装文档:http://httpd.apache.org/docs/2.4/install.html
进行下面这个步奏会提示 APR not found

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

Centos安装 Apache2.4提示 APR not found的解决办法:
1.下载所需软件包:

wget http://archive.apache.org/dist/apr/apr-1.6.2.tar.gz

wget http://archive.apache.org/dist/apr/apr-util-1.6.0.tar.gz

wget http://jaist.dl.sourceforge.net/project/pcre/pcre/8.10/pcre-8.10.zip

具体步骤如下:

1、:解决apr not found问题

   # tar -zxf apr-1.6.2.tar.gz  
   # cd  apr-1.6.2  
   # ./configure --prefix=/usr/local/apr  
   # make && make install

2、解决APR-util not found问题

  # tar -zxf apr-util-1.6.0.tar.gz  
  # cd apr-util-1.6.0  
  # ./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr 
  # make && make install

3、解决pcre问题

 #unzip -o pcre-8.10.zip  
 #cd pcre-8.10  
 #./configure --prefix=/usr/local/pcre  
 #make && make install (可能出现g++: command not found,Centos下执行

 #yum -y update gcc
 #yum -y install gcc+ gcc-c++ ,安装完之后在执行上一步./configure...)

4、最后编译Apache时加上:

--with-apr=/usr/local/apr \

--with-apr-util=/usr/local/apr-util/ \

--with-pcre=/usr/local/pcre

./configure --prefix=/usr/local/apache2.4 --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util --with-pcre=/usr/local/pcre

你可能感兴趣的:(阿里云Centos 7.2 安装apache踩的坑)