【问题标题】:How to upgrade apache 2.2.15 to apache 2.4.12 on CentOS 6.6?如何在 CentOS 6.6 上将 apache 2.2.15 升级到 apache 2.4.12?
【发布时间】:2015-08-10 14:19:16
【问题描述】:

我试过了,但对我没用。

CentOS 6.6 上的 Apache 2.4:

第 1 步:

cd /etc/yum.repos.d/
wget http://repos.fedorapeople.org/repos/jkaluza/httpd24/epel-httpd24.repo

第 2 步:

yum install httpd24.x86_64

第 3 步:

$ /opt/rh/httpd24/root/usr/sbin/httpd -version
Server version: Apache/2.4.6 (Red Hat)
Server built:   Sep 25 2013 05:25:46
NOTE: config files are in: /opt/rh/httpd24/root/etc/httpd

$ ls
conf  conf.d  conf.modules.d  logs  modules  run
EDIT: in case you want to switch off Apache 2.2

$ chkconfig httpd off
$ chkconfig --list | grep httpd
httpd           0:off   1:off   2:off   3:off   4:off   5:off   6:off
httpd24-httpd   0:off   1:off   2:off   3:off   4:off   5:off   6:off
EDIT 2: http://wiki.apache.org/httpd/PHP-FPM

yum install php-fpm
/etc/init.d/php-fpm start

有人知道解决办法吗,请告诉我。

【问题讨论】:

    标签: apache centos


    【解决方案1】:

    最好是在 CentOS 6.6 系统上使用 Apache 源代码自己构建。

    编译和安装 Apache 2.4:

    http://httpd.apache.org/docs/current/install.html

    在构建过程中记下配置行,以便确保它包含您想要的所有模块(如 mod_ssl...等)。有关configure 线路可用内容的详细信息,请点击此处http://httpd.apache.org/docs/current/programs/configure.html

    $ CC="pgcc" CFLAGS="-O2" \
    ./configure --prefix=/sw/pkg/apache \
    --enable-ldap=shared \
    --enable-lua=shared
    

    如果您想要自己的 RPM,请使用您自己的自定义创建一个 SPEC 文件。

    【讨论】:

      【解决方案2】:

      最简单的方法是安装 SCL 版本,如下所述:

      https://unix.stackexchange.com/questions/412122/how-to-update-apache-to-2-4-29-using-scl

      【讨论】:

      • 我不知道为什么这被否决了。从头开始编译 apache 是非常有问题的,特别是如果您想保留现有配置。使用 SCL 对我来说非常有效,而且非常简单。
      猜你喜欢
      • 1970-01-01
      • 2017-09-11
      • 2016-05-18
      • 2015-10-01
      • 2015-09-01
      • 2015-07-22
      • 2023-03-25
      • 2015-10-25
      • 2015-09-24
      相关资源
      最近更新 更多