The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

SOLVED Keep Alive is enabled, but it's not working

Discussion in 'Workarounds and Optimization' started by PumpinIron, Dec 4, 2016.

  1. PumpinIron

    PumpinIron Member

    Joined:
    Mar 8, 2013
    Messages:
    20
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    According to my WHM Apache configuration, keep alive is enabled.

    However, according to this check tool, it's not:
    giftofspeed.com/check-keep-alive/index.php

    Also, testing my site on GTMetrix shows it isn't enabled either:
    gtmetrix.com

    I've rebooted the server, reconfigured Apache, etc., but it's still telling me it's not enabled, even though it shows it is via WHM.

    Any thoughts on what this is? HostGator refuses to help even though I'm paying them for a "managed" dedicated server.
     
  2. NOC_Serverpoint

    NOC_Serverpoint Well-Known Member

    Joined:
    Jul 3, 2016
    Messages:
    102
    Likes Received:
    6
    Trophy Points:
    18
    cPanel Access Level:
    Website Owner
    Hi,

    After logging into WHM, find the section called “Service Configuration” and choose “Apache Configuration” from the list below. This will present you with a number of configuration sections. The one we are interested in is called “Global Configuration".

    This will bring us to a screen with a lot of options that control various aspects of Apache. Scroll down until you .

    find the WHM “Keep-Alive” parameter:

    Even though the default is “On”, you may find it turned off occasionally.

    Also, under this “Keep-Alive Timeout” needs to be set.
    This controls the number of seconds a server must wait before automatically closing a connection. A higher value means that a browser has more time to request stuff over the same connection, but consequently it means that a greater strain is being placed on the server as it locks up resources.

    The default value of five seconds may need to be tweaked depending on the power of your server as, the traffic it gets, as well as the kind of webpages you have. After saving your changes, the WHM GUI will present you with a list of saved settings where you can confirm that your changes have taken effect.

    After saving changes, you need to restart Apache.

    Thanks
     
  3. PumpinIron

    PumpinIron Member

    Joined:
    Mar 8, 2013
    Messages:
    20
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Unfortunately I've done all of this from the start, but Keep-Alive still doesn't work. That's what I am so confused about.
     
  4. rpvw

    rpvw Well-Known Member

    Joined:
    Jul 18, 2013
    Messages:
    261
    Likes Received:
    77
    Trophy Points:
    28
    Location:
    Spain
    cPanel Access Level:
    Root Administrator
    I am not sure the site you are using is reading the server response headers correctly.

    I tried it on a number of my sites and they all failed - BUT the response headers all said something like
    Perhaps you should try another tool like WebPagetest - Website Performance and Optimization Test
     
  5. PumpinIron

    PumpinIron Member

    Joined:
    Mar 8, 2013
    Messages:
    20
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Well, that page says Keep Alive is enabled, but gives me a B score, and then says this:

    Screen Shot 2016-12-06 at 9.15.05 AM.png

    I'm so lost... Some of these sites are telling me Keep-Alive is enabled (even though they say it failed), while others are just telling me flat out that it isn't enabled.

    Another one is http://gtmetrix.com, which tells me Keep-Alive is enabled, but that it doesn't work on any of my URLs.
     
  6. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    37,171
    Likes Received:
    1,295
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hello,

    Feel free to open a support ticket using the link in my signature so we can take a closer look. You can post the ticket number here and we will update this thread with the outcome.

    Thank you.
     
  7. PumpinIron

    PumpinIron Member

    Joined:
    Mar 8, 2013
    Messages:
    20
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Thanks! I opened a support request. Hopefully you guys can see something that I am missing.
     
  8. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    37,171
    Likes Received:
    1,295
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hello,

    To update, the issue was addressed by removing the following entry from /usr/local/apache/conf/includes/pre_virtualhost_global.conf:

    KeepAlive Off

    Note that a KeepAlive session is only initiated if the client requests a KeepAlive session. The following entries must be added to the .htaccess file to enable this setting by default:

    Code:
    <ifModule mod_headers.c>
    Header set Connection keep-alive
    </ifModule>
    Thank you.
     
Loading...

Share This Page