Am 21.02.2017 um 23:24 schrieb Eric Covener:
On Tue, Feb 21, 2017 at 5:20 PM, Reindl Harald <h.rei...@thelounge.net> wrote:


Am 21.02.2017 um 22:58 schrieb Joe Orton:

For cases like HttpProtocolOptions where a new directive is introduced
to multiple active branches simultaneously, it gets awkward to use
<IfVersion> to write conf files which use the new directive but are
compatible across multiple versions.

Triggered by a conversation with a user, but also e.g. see current test
suite t/conf/extra.conf.in which breaks for 2.4 releases older than
2.4.25 with:

  <IfVersion >= 2.2.32>
    <VirtualHost _default_:http_strict>
      DocumentRoot @SERVERROOT@/htdocs/
      HttpProtocolOptions Strict Require1.0 RegisteredMethods

Any reason <IfDirective> is a bad idea, so we can do that more cleanly
(... in a couple of decades time)?


you need to wrap that at least in <IfModule> since mod_version is not
mandatory and httpd if unforgiving for unknown options

for the same reason the dance below is needed

<IfModule !mod_version.c>
 <IfModule mod_authz_core.c>
  Require all denied
 </IfModule>
 <IfModule !mod_authz_core.c>
  Order deny,allow
  Deny from All
 </IfModule>
</IfModule>
<IfModule mod_version.c>
 <IfVersion < 2.4>
  Order deny,allow
  Deny from all
 </IfVersion>
 <IfVersion >= 2.4>
  Require all denied
 </IfVersion>
</IfModule>

Kind of weird to keep the <IfVersion-dependent branch in this example

in *this* example maybe, in general the "<IfVersion >= 2.4>" can be more specific like "<IfVersion >= 2.4>" because there where options added in 2.4.x releases which would stop httpd on older minor versions and especially in conext of LTS distributions you don't always know which features are really in the 2.4.x-distr

SSLCompression
Available in httpd 2.4.3 and later

so you can write a config which is safe for any httpd but chain it to recent features if available and *if* mod_version is available

Reply via email to