Community Forums
Connect with us on LinkedIn
+ Reply to Thread
Results 1 to 7 of 7
  1. #1
    Member
    Join Date
    Jul 2004
    Posts
    496

    Default tweak httpd.conf which include file?

    Am trying to tweak httpd.conf values like Maxservers Timeout Keepalive etc, but can't find them listed anywhere, surely the default values must be listed somewhere? I looked in the two include files and httpd.conf but can't see them. Is there another file?
    Get professional web hosting from 1uhost.com
    Advertise your site in our business directory frontiereconomy.com

  2. #2
    Member wolfy's Avatar
    Join Date
    Jul 2005
    Location
    Canada
    Posts
    45

    Default

    you can make the changes directly in your httpd.conf file.
    just run the distiller after your changes and they will not be overwritten during updates
    /usr/local/cpanel/bin/apache_conf_distiller --update

    i have included a sniplet of an httpd.conf file with these settings. hope this helps.
    Code:
    #
    # Timeout: The number of seconds before receives and sends time out.
    #
    Timeout 300
    
    #
    # KeepAlive: Whether or not to allow persistent connections (more than
    # one request per connection). Set to "Off" to deactivate.
    #
    KeepAlive On
    
    #
    # MaxKeepAliveRequests: The maximum number of requests to allow
    # during a persistent connection. Set to 0 to allow an unlimited amount.
    # We recommend you leave this number high, for maximum performance.
    #
    MaxKeepAliveRequests 200
    
    #
    # KeepAliveTimeout: Number of seconds to wait for the next request from the
    # same client on the same connection.
    #
    KeepAliveTimeout 15
    
    #
    # Server-pool size regulation.  Rather than making you guess how many
    # server processes you need, Apache dynamically adapts to the load it
    # sees --- that is, it tries to maintain enough server processes to
    # handle the current load, plus a few spare servers to handle transient
    # load spikes (e.g., multiple simultaneous requests from a single
    # Netscape browser).
    #
    # It does this by periodically checking how many servers are waiting
    # for a request.  If there are fewer than MinSpareServers, it creates
    # a new spare.  If there are more than MaxSpareServers, some of the
    # spares die off.  The default values are probably OK for most sites.
    #
    MinSpareServers 8
    MaxSpareServers 15
    
    #
    # Number of servers to start initially --- should be a reasonable ballpark
    # figure.
    #
    StartServers 8
    
    #
    # Limit on total number of servers running, i.e., limit on the number
    # of clients who can simultaneously connect --- if this limit is ever
    # reached, clients will be LOCKED OUT, so it should NOT BE SET TOO LOW.
    # It is intended mainly as a brake to keep a runaway server from taking
    # the system with it as it spirals down...
    #
    MaxClients 250
    
    #
    # MaxRequestsPerChild: the number of requests each child process is
    # allowed to process before the child dies.  The child will exit so
    # as to avoid problems after prolonged use when Apache (and maybe the
    # libraries it uses) leak memory or other resources.  On most systems, this
    # isn't really needed, but a few (such as Solaris) do have notable leaks
    # in the libraries. For these platforms, set to something like 10000
    # or so; a setting of 0 means unlimited.
    #
    # NOTE: This value does not include keepalive requests after the initial
    #       request per connection. For example, if a child process handles
    #       an initial request and 10 subsequent "keptalive" requests, it
    #       would only count as 1 request towards this limit.
    #
    MaxRequestsPerChild 0
    
    #
    # Listen: Allows you to bind Apache to specific IP addresses and/or
    # ports, instead of the default. See also the <VirtualHost>
    # directive.
    #
    note: these settings were located just before the 1st "Listen:" configuration setting

    perhaps the settings your looking for can be found in one of the following files?
    Include "/usr/local/apache/conf/includes/pre_main_global.conf"
    Include "/usr/local/apache/conf/includes/pre_main_2.conf"
    Last edited by wolfy; 09-13-2008 at 04:42 PM.

  3. #3
    Member
    Join Date
    Jul 2004
    Posts
    496

    Default

    Thanks, but both those two include files are empty. I was sure the default settings;
    Timeout 300
    KeepAlive On
    MaxKeepAliveRequests 100
    KeepAliveTimeout 15
    MinSpareServers 5
    MaxSpareServers 10
    StartServers 5
    MaxClients 150
    MaxRequestsPerChild 0

    ..........would be in one of those files but they don't seem to exist anywhere.
    Get professional web hosting from 1uhost.com
    Advertise your site in our business directory frontiereconomy.com

  4. #4
    Member wolfy's Avatar
    Join Date
    Jul 2005
    Location
    Canada
    Posts
    45

    Default

    i could be wrong, but i believe cpanel does not include these directives leaving them to be set to thier defaults by apache.

    perhaps you could try adding these custom directives to /usr/local/apache/conf/includes/pre_main_global.conf and see how it goes if it doesnt work just undo the changes and theres no harm done.
    I'm prety sure this is the case tho

  5. #5
    Member
    Join Date
    Jul 2004
    Posts
    496

    Default

    I added some tweaks in and its worked ! Would still have liked to know what file has the default values written to it though
    Thanks for your help wolfy
    Get professional web hosting from 1uhost.com
    Advertise your site in our business directory frontiereconomy.com

  6. #6
    Member
    Join Date
    Jul 2004
    Posts
    496

    Default

    In case anyone is interested, I found the two files I was originally looking for
    We compiled Apache with mpm prefork and, since Apache 2.x is now module to tweak or tune it up you need to edit these files instead of the main httpd.conf:
    /usr/local/apache/conf/extra/httpd-mpm.conf
    /usr/local/apache/conf/extra/httpd-default.conf
    NOTE, I had to add an "include" statement in the main httpd.conf to point to the above files.

  7. #7
    Member
    Join Date
    Feb 2005
    Posts
    223

    Default Lowering MaxClients for performance

    Seems like most posts here are about how to raise MaxClients to improve performance. But in most cases, you want to lower this number rather than raise it. From the Apache docs:

    1) "You can, and should, control the MaxClients setting so that your
    server does not spawn so many children it starts swapping."
    From a friend:

    Also since the size of apache all depends on the php script that is being run, it's hard to determine what the limit should be. But if you have loads of 100 and no swap left then it should be 50-100.
    So for example if a blog gets hit by massive spam comment submission/botnet activity and mysql requests are piling up, MaxClients may help prevent that by blocking additional incoming requests (of course you should also have adequate spam protection on the blog itself, but this can help prevent one misconfigured blog from taking down a server).

Similar Threads & Tags
Similar threads

  1. Account Backup to include httpd.conf Userdata
    By erikig in forum Data Protection
    Replies: 3
    Last Post: 08-19-2009, 08:17 AM
  2. httpd.conf Include Files Not Working
    By gldickens3 in forum cPanel and WHM Discussions
    Replies: 5
    Last Post: 10-08-2008, 12:46 AM
  3. Where to place httpd.conf VirtualHost include files
    By Netmaking in forum cPanel and WHM Discussions
    Replies: 0
    Last Post: 08-13-2008, 05:36 AM
  4. tweak settings changes emptied httpd.conf
    By pavemen in forum cPanel and WHM Discussions
    Replies: 2
    Last Post: 07-02-2008, 10:56 AM
  5. Where is the httpd.conf file?
    By bcw in forum cPanel and WHM Discussions
    Replies: 8
    Last Post: 07-17-2004, 07:11 AM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube