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.

How can I edit httpd.conf and keep the modifications for good ?

Discussion in 'General Discussion' started by SecondSight, Mar 23, 2010.

  1. SecondSight

    SecondSight Well-Known Member

    Joined:
    Jun 30, 2004
    Messages:
    66
    Likes Received:
    0
    Trophy Points:
    6
    Hello ! :)

    I would like to make modifications to the httpd.conf file in order to make a few tests and find the best configuration.

    In order to make the modifications I used SSH. But then I made changes in WHM, and the modifications I had made through SSH were not kept.

    The values I want to modify are :
    MaxKeepAliveRequests
    KeepAliveTimeout

    Is there a way to modify these values in WHM ?
    I looked in Main >> Service Configuration >> Apache Configuration >> Global Configuration but didn't find MaxKeepAliveRequests and KeepAliveTimeout.

    If I edit httpd.conf through SSH, how can I make sur the modifications will be kept in the future ?...

    Thank you ! :)

    Regards,

    AJ PAYET
     
  2. ChrisRHS

    ChrisRHS Well-Known Member

    Joined:
    Jul 12, 2006
    Messages:
    292
    Likes Received:
    5
    Trophy Points:
    18
    I would suggest for changes like that, that you use the Include Editors and place your setting within them. Those should be placed in the pre_virtual host, or, post_virtual host files. They can be accessed through WHM via:

    Main >> Service Configuration >> Apache Configuration >> Include Editor

    You can also access them via command line, the files are located:

    /usr/local/apache/conf/includes/

    Alternatively, you can use the distiller to update the httpd.conf:

    /usr/local/cpanel/bin/apache_conf_distiller --update

    I do suggest using the Include files though.
     
  3. cPanelKenneth

    cPanelKenneth cPanel Development
    Staff Member

    Joined:
    Apr 7, 2006
    Messages:
    4,458
    Likes Received:
    22
    Trophy Points:
    38
    cPanel Access Level:
    Root Administrator
    The Include files is the preferred method for making and preserving the types of changes being discussed.
     
  4. SecondSight

    SecondSight Well-Known Member

    Joined:
    Jun 30, 2004
    Messages:
    66
    Likes Received:
    0
    Trophy Points:
    6
    Hello ! :)

    In fact, I'm making tests and I'm trying to find the best possible configuration for httpd.conf.

    I've used the distiller to update the httpd.conf.

    Why is the include files a better way ? :)

    Thank you ! :)
     
  5. cPanelKenneth

    cPanelKenneth cPanel Development
    Staff Member

    Joined:
    Apr 7, 2006
    Messages:
    4,458
    Likes Received:
    22
    Trophy Points:
    38
    cPanel Access Level:
    Root Administrator
    We make no guarantees that configuration directives distilled from httpd.conf by apache_conf_distiller will be used for future regenerations of httpd.conf. Most of the time the distilled values are used, but not always.

    The safest option is to use an Include file as we purposely leave the Include files alone.
     
  6. SecondSight

    SecondSight Well-Known Member

    Joined:
    Jun 30, 2004
    Messages:
    66
    Likes Received:
    0
    Trophy Points:
    6
    Thank you for the explanations.

    I don't know how to use include files.

    I need to have these values in httpd.conf :
    MaxKeepAliveRequests 50
    KeepAliveTimeout 10

    So, I go to : Main >> Service Configuration >> Apache Configuration >> Include Editor

    I click on "Post VirtualHost Include", I select "All versions" in the list box, and I simply paste these two lines :
    MaxKeepAliveRequests 50
    KeepAliveTimeout 10

    Then I click on the "Update" button, and that's all ?

    Should I remove MaxKeepAliveRequests and KeepAliveTimeout from httpd.conf also ?

    Thank you ! :)
     
  7. ChrisRHS

    ChrisRHS Well-Known Member

    Joined:
    Jul 12, 2006
    Messages:
    292
    Likes Received:
    5
    Trophy Points:
    18
    You are correct, that is how you would use those. Because that is one of the last files used, it will take what ever value's you have in there and use them when starting the server.
     
  8. SecondSight

    SecondSight Well-Known Member

    Joined:
    Jun 30, 2004
    Messages:
    66
    Likes Received:
    0
    Trophy Points:
    6
    Thank you for the explanations. I'm now using the Post VirtualHost Include file. :)
     
Loading...

Share This Page