在安装或者升级成Apache2.4版本时可能会一些错误,我们在实际生产环境中Apache是需要定制编译参数的,以实现生产环境的服务定制,但是用旧的编译参数时一般会报这样的错误,如下:
…略…
checking for APR... configure: WARNING: APR version 1.4.0 or later is required, found 1.3.9
configure: WARNING: skipped APR at apr-1-config, version not acceptable
no
configure: error: APR not found. Please read the documentation.
报这个错是因为我们原先在Apache2.2或者以下的版本中Apache依赖包apr、apr-util、pcre的版本使用yum或者是apt-get上的rpm包版本太低了,而Apache2.4中里这3种依赖包就需要用新的,在这里建议使用源码编译包安装,先用links看一下最新的包,当然用links也可以直接用links下载文件,当然尽量使用最新的包
[root@localhost src]# links http://archive.apache.org/dist/apr/
[root@localhost src]# links http://jaist.dl.sourceforge.net/project/pcre/pcre/
#找一下最新的编译包
[root@localhost src]# wget http://archive.apache.org/dist/apr/apr-1.5.2.tar.bz2
[root@localhost src]# wget http://archive.apache.org/dist/apr/apr-util-1.5.4.tar.bz2
[root@localhost src]# wget http://jaist.dl.sourceforge.net/project/pcre/pcre/8.10/pcre-8.10.zip
[root@localhost src]# tar -jxf apr-1.5.2.tar.bz2 && tar -jxf apr-util-1.5.4.tar.bz2 && unzip pcre-8.10.zip
[root@localhost src]# cd apr-1.5.2
[root@localhost apr-1.5.2]# ./configure --prefix=/usr/local/apr
[root@localhost apr-1.5.2]# make && make install
[root@localhost apr-1.5.2]# cd ../apr-util-1.5.4
[root@localhost apr-util-1.5.4]# ./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr/bin/apr-1-config
[root@localhost apr-util-1.5.4]# make && make install
[root@localhost apr-util-1.5.4]# cd ../pcre-8.10
[root@localhost pcre-8.10]# ./configure --prefix=/usr/local/pcre
[root@localhost pcre-8.10]# make && make install
这样编译安装好3个最新的依赖包后,再在原来的Apache的编译参数后添加以下3条编译参数:
"--with-apr=/usr/local/apr" "--with-apr-util=/usr/local/apr-util/" "--with-pcre=/usr/local/pcre"
这样编译Apache2.4的版本的时候就不会报错了,除此之外Apache在2.4的版本后也做了大量的改动,比较常见的就是Allow Deny Order指令和以前是不一样了,如果还是用旧的配置文件会有403的错误,如下:
2.2中:
AllowOverride all
RewriteEngine on
Order allow,deny
Allow from all
2.4中:
AllowOverride all
RewriteEngine on
Require all granted
######################
2.2中:
<Directory />
Options FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
</Directory>
2.4中:
<Directory />
AllowOverride none
Require all denied
</Directory>
当然在2.4的版本中除了以上的一些改动修改了一些bug外,还有很多的改动,如果想知道更多可以参看官方的document文档http://httpd.apache.org/docs/2.4/
下面关于LAMP相关的内容你可能也喜欢:
LAMP平台安装Xcache和Memcached加速网站运行 http://www.linuxidc.com/Linux/2015-06/118835.htm
CentOS 7下搭建LAMP平台环境 http://www.linuxidc.com/Linux/2015-06/118818.htm
CentOS 6.5系统安装配置LAMP(Apache+PHP5+MySQL)服务器环境 http://www.linuxidc.com/Linux/2014-12/111030.htm
CentOS 7.2 yum安装LAMP环境 http://www.linuxidc.com/Linux/2016-11/136766.htm
Ubuntu 14.04 配置 LAMP+phpMyAdmin PHP(5.5.9)开发环境 http://www.linuxidc.com/Linux/2014-10/107924.htm
Ubuntu 14.10 下安装 LAMP 服务图文详解 http://www.linuxidc.com/Linux/2014-12/110082.htm
LAMP结合NFS构建小型博客站点 http://www.linuxidc.com/Linux/2015-08/121029.htm
CentOS7下安装部署LAMP环境 http://www.linuxidc.com/Linux/2016-04/130653.htm
Ubuntu Server 14.04 LTS下搭建LAMP环境图文详解 http://www.linuxidc.com/Linux/2016-12/138758.htm
Ubuntu Server 16.04下配置LAMP环境 http://www.linuxidc.com/Linux/2016-12/138757.htm
Ubuntu 16.04搭建LAMP开发环境 http://www.linuxidc.com/Linux/2016-10/136327.htm
Ubuntu 16.04 LTS安装Apache2+PHP7.0+MySQL+phpMyAdmin图文详解 http://www.linuxidc.com/Linux/2017-02/140098.htm
本文永久更新链接地址:http://www.linuxidc.com/Linux/2017-02/140254.htm
