【问题标题】:Apache2.4 configuration files with backward compatability for apache2.2Apache2.4 配置文件向后兼容 apache2.2
【发布时间】:2015-09-22 15:35:53
【问题描述】:

我有一些 apache 配置文件需要在 apache2.4 服务器和 apache2.2 上运行。一些指令发生了变化,最突出的是:

(2.2)

Order deny,allow
Deny from all

(2.4)

Require all denied

但是,我想在 2.2 和 2.4 上运行相同的 conf 文件。

【问题讨论】:

    标签: apache apache2.2 apache2.4


    【解决方案1】:

    解决方法是使用IfVersion>,可以根据运行的apache服务器版本来分隔conf文件部分:

    <IfVersion >= 2.4>
         Require all granted
    </IfVersion>
    <IfVersion <= 2.2>
        Order allow,deny 
        Allow from all 
    </IfVersion>
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2011-10-13
      • 2011-10-05
      • 1970-01-01
      • 2012-03-13
      • 2013-03-23
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多