Giter Site home page Giter Site logo

Comments (9)

bchr avatar bchr commented on June 11, 2024 1

Solution:

+ <IfModule mod_http2.c>
    Protocols h2 http/1.1
+ </IfModule>

πŸ˜ƒ

By the way in Debian and Ubuntu, the version_module (mod_version.c) is a static module and therefore compiled into Apache. It cannot be en/dismodded. Those can be seen by apachectl -M | grep static.

from server-configs-apache.

jamieburchell avatar jamieburchell commented on June 11, 2024 1

Solution:

+ <IfModule mod_http2.c>
    Protocols h2 http/1.1
+ </IfModule>

πŸ˜ƒ

This is what I proposed originally and what I ended up adding to my config.

Understood @LeoColomb

In an ideal world everyone would be using the latest version of Apache. In reality, there are old web servers running old websites that sit running for years for clients that have no interest in paying for maintenance or updates. Having a generic config that I can use across the fleet of old and new with Ansible is super handy. Of course, that moves the burden of maintaining old versions on this repo.

However, besides Protocols I'm not sure why h5bp requires 2.4.17+. I'm successfully using it on 2.4.6 (albeit not in its entirety) and can work around Protocols support trivially by only including the declaration when the http2 module is available 🀷🏻

from server-configs-apache.

bchr avatar bchr commented on June 11, 2024

Just a few thoughts:

From https://httpd.apache.org/docs/2.4/howto/http2.html

The protocols you configure are not checked for correctness or spelling. You can mention protocols that do not exist, so there is no need to guard Protocols with any <IfModule> checks.

Also, I guess it could be discussed whether or not to add the h2c protocol as well?

The server can be configured to allow the client to choose what it prefers via ProtocolsHonorOrder.

Maybe a seperate issue/discussion?

from server-configs-apache.

jamieburchell avatar jamieburchell commented on June 11, 2024

Just a few thoughts:

From https://httpd.apache.org/docs/2.4/howto/http2.html

The protocols you configure are not checked for correctness or spelling. You can mention protocols that do not exist, so there is no need to guard Protocols with any <IfModule> checks.

Also, I guess it could be discussed whether or not to add the h2c protocol as well?

The server can be configured to allow the client to choose what it prefers via ProtocolsHonorOrder.

Maybe a seperate issue/discussion?

Apache will fail to start if it finds the Protocols declaration at all in <2.4.17 (the claimed supported version of h5bp is 2.4.10).

Having the check for h2 support means we're 2.4.17+, which is when the module and the Protocols declaration came in.

Off-topic but I don't see why you would offer h2c (HTTP/2 over a non-TLS connection), mainly because no browsers support it.

from server-configs-apache.

bchr avatar bchr commented on June 11, 2024

I see.

It could be solved by <IfVersion >= 2.4.17>.

Apache 2.4.10 was released in 2014. In my opinion it's a shame if we can't benefit from all the development that's happened in Apache since then. A lot of new features could probably go into this project if the maintainers would go down that route :-)

EDIT: I misunderstood your post, like in that h2c support required 2.4.17. Protocols are already here in the code of course :-)

EDIT2: ProtocolsHonorOrder requires 2.4.17, so it was wrong of me to suggest it.

from server-configs-apache.

LeoColomb avatar LeoColomb commented on June 11, 2024

Thanks for opening this issue, @jamieburchell.
I believe it is safe to bump H5BP requirement to 2.4.17.

from server-configs-apache.

jamieburchell avatar jamieburchell commented on June 11, 2024

I have CentOS 7 VMs which are still supported, with stock Apache 2.4.6 which is still receiving backported fixes. For me the check is useful so that I can continue using this script even on older versions. The use of the Protocols declaration is what prevents me from doing so. Checking for the HTTP/2 module before setting up the HTTP/2 protocol makes sense to me.

I didn't know about <IfVersion> that's even better; it means you can support old and new.

from server-configs-apache.

LeoColomb avatar LeoColomb commented on June 11, 2024

While I understand your position, I'm going to reject it:

  • <IfVersion> could be handy to use indeed, but require another module to be loaded (mod_version), which implies:
    • Add the module at loading time
    • Make sure the module is available before using the block (with a <IfModule> for mod_http2)
    • Take the risk to disable http2 usage for server without mod_version even if mod_http2 is available.
  • Segregating versions inevitably makes the maintenance harder, as the configuration behavior could change depending on the version. We don't have the bandwidth for this.

CentOS 7 is in its last year(-ish) of support, and Apache http server 2.4.6 is very very old, I'm not sure enabling their usage with H5BP is something I'd like to do.

I hope you see my point! 😊

from server-configs-apache.

bchr avatar bchr commented on June 11, 2024

I created a pull request. I think it's a no-brainer to merge it πŸ˜„

from server-configs-apache.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.