Skip to main content

HTTP/1.0 Connection: keep-alive, but Apache replies with HTTP/1.1 Connection: close?

Comments

5 comments

  • cPRex Jurassic Moderator
    Hey there! Is your server busy at all? I'm wondering if it needs those resources as outlined here, as this is a good explanation of that value on a busy system:
    0
  • Benjamin D.
    Hi, answers to your questions: It's a busy server, but not to the point of being slow. The response header and the first few kilobytes from this WHM server are pretty much instantaneous. The server is not overloaded at all. If I disable Keep-Alive under WHM > Apache Configuration > Global Configuration, I'll have to rebuild Apache, on a production server. Are you sure DISABLING Keep-Alive would make it work? I forgot to tell, but this WHM server also runs CSF Firewall, but I've tried to disable it for a minute and run tests and the outcome is exactly the same. Though, I have tried getting a static file instead of a PHP script (e.g. a .PDF file) and Apache correctly issues a "Connection: keep-alive" style of response header and this reliably downloads in full before the connection is closed. So it seems to only issue a "Connection: close" response header and abruptly shut down the connection near the end, before the last few KB, when it's a PHP script. For static files it works fine. Weird?
    0
  • cPRex Jurassic Moderator
    No, I'm not sure disabling keep-alive would make it work, but it was just another idea I had. Apache wouldn't need a full rebuild for that change, just a restart.
    0
  • Benjamin D.
    Sorry, I misread earlier, it says "Apache configuration must be rebuilt and Apache restarted." but given that having it ON works for static files, I don't think turning it OFF would fix the issue that PHP scripts are not served on a Keep-Alive connection, at least I don't see the logic in this change. I wonder if it could have anything to do with a setting in suphp? The server is on suphp 7.4 at the moment, built of course with WHM's EasyApache 4.
    0
  • cPRex Jurassic Moderator
    I don't think there's anything in cPanel that would change the behavior. If you'd like to make a ticket we can check it out on our end and see if we have any official recommendations.
    0

Please sign in to leave a comment.