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.

Mod_fcgid settings v2.36 - share 'em!

Discussion in 'General Discussion' started by boonjackmedia, Jun 29, 2011.

  1. boonjackmedia

    boonjackmedia Active Member

    Joined:
    Apr 28, 2010
    Messages:
    35
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Cincinnati, OH USA
    There's a ton of info and settings floating around out there about mod_fcgid settings, and tons of frustration's with getting it too work efficiently.

    I speak from first hand experience btw... I've invented several new cuss words while dealing with mod_fcgid and fastcgi over the last few years.

    Hopefully this pain can be avoided, so let's post some settings and figure out what works best for our setups.

    As of now things are working pretty good on our server:
    Code:
    Server Version: Apache/2.2.19 (Unix) mod_ssl/2.2.19 OpenSSL/0.9.8e-fips-rhel5 [B]mod_fcgid/2.3.6[/B] mod_bwlimited/1.4 mod_perl/2.0.4 Perl/v5.8.8
    Running PHP 5.3.6 on a dedicated box with 8G ram, eAccelerator 0.9.6.1 
    Here's my mod_fcgid v2.36 settings, in WHM I add these to: Main >> Service Configuration >> Apache Configuration >> Include Editor >> Post VirtualHost Include (so they are retained when apache is rebuilt)

    Code:
    # mod_fcgid settings v2.36 post_virtualhost_global.conf
    <IfModule mod_fcgid.c>
    FcgidBusyScanInterval 90
    FcgidBusyTimeout 600
    FcgidErrorScanInterval 3
    FcgidFixPathinfo 1
    FcgidIdleScanInterval 70
    FcgidIdleTimeout 360
    FcgidIOTimeout 1000
    FcgidMaxProcesses 1000
    FcgidMaxProcessesPerClass 100
    FcgidMaxRequestInMem 268435456
    FcgidMaxRequestLen 1073741824
    FcgidMaxRequestsPerProcess 0
    FcgidMinProcessesPerClass 3
    FcgidOutputBufferSize 1048576
    FcgidPassHeader HTTP_AUTHORIZATION
    FcgidProcessLifeTime 3600
    FcgidSpawnScore 1
    FcgidSpawnScoreUpLimit 10
    FcgidTerminationScore 2
    FcgidTimeScore 2
    FcgidZombieScanInterval 3
    </IfModule>
    These settings are modified from the defaults a bit for this particular server and any clients sites/apps. Mostly tweaks that needed implemented from various software updates, issues and errors.

    Note: FcgidPassHeader HTTP_AUTHORIZATION - This setting might not be needed for your setup.

    The mod_fcgid default settings can be found on apache.org.

    In /usr/local/apache/conf/php.conf file, I have these settings (I'm also experimenting with adding these to Pre-Main Global in WHM so settings are retained on any updates):

    Code:
    # Fastcgi configuration for PHP5 - pre_main_global.conf
    LoadModule fcgid_module modules/mod_fcgid.so
    FcgidMaxRequestsPerProcess 10000
    FcgidConnectTimeout 60
    FcgidIOTimeout 1000
    AddHandler fcgid-script .php5 .php4 .php .php3 .php2 .phtml
    FCGIWrapper /usr/local/cpanel/cgi-sys/php5 .php5
    FCGIWrapper /usr/local/cpanel/cgi-sys/php5 .php4
    FCGIWrapper /usr/local/cpanel/cgi-sys/php5 .php
    FCGIWrapper /usr/local/cpanel/cgi-sys/php5 .php3
    FCGIWrapper /usr/local/cpanel/cgi-sys/php5 .php2
    FCGIWrapper /usr/local/cpanel/cgi-sys/php5 .phtml
    
    # PHP configuration pre_main_global.conf
    The majority of these settings have been working pretty well for a few weeks now, the last adds were the FcgidSpawn settings. The Apache docs, cPanel forums - staff and user feedback was where the majority of these settings were found. It's an ongoing process though like anything, looking forward to some feedback and ongoing discussions.
     
  2. ikillbill

    ikillbill Well-Known Member

    Joined:
    Feb 18, 2008
    Messages:
    119
    Likes Received:
    0
    Trophy Points:
    16
    Hello
    errors
    [Tue Aug 30 17:10:15 2011] [warn] module fcgid_module is already loaded, skipping

    will be shown when we include

    LoadModule fcgid_module modules/mod_fcgid.so

    on

    post_virtualhost_global.conf
     
  3. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    Yes, you shouldn't put the same settings in php.conf into post_virtualhost=_global.conf file.
     
  4. ChrisRHS

    ChrisRHS Well-Known Member

    Joined:
    Jul 12, 2006
    Messages:
    292
    Likes Received:
    5
    Trophy Points:
    18
    Hello there,

    Which MPM are you using for Apache?

    Chris
     
  5. ikillbill

    ikillbill Well-Known Member

    Joined:
    Feb 18, 2008
    Messages:
    119
    Likes Received:
    0
    Trophy Points:
    16
    We installed mpm worker on new machine, but prefork on current production server
     
  6. boonjackmedia

    boonjackmedia Active Member

    Joined:
    Apr 28, 2010
    Messages:
    35
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Cincinnati, OH USA
    That just means mod_fcgid is listed/loaded somewhere before post_virtual includes, probably in your php.conf file. It's not a critical error.

    I load mod_fcgid settings in pre_main_global which is before php.conf and also Worker MPM settings.

    I add other Apache modules in post_virtual like mod_deflate, expires, headers, (htaccess stuff) etc.
     
  7. luigidelgado

    luigidelgado Well-Known Member

    Joined:
    Nov 6, 2010
    Messages:
    109
    Likes Received:
    2
    Trophy Points:
    16
    Location:
    Mexico
    cPanel Access Level:
    Root Administrator
    Twitter:
    Hi Im having an issue here. I was unable to upload files greaer than 100Kb or so. Datacenter helped me checl the error and the error was:
    [Sat Oct 15 10:17:00 2011] [warn] [client xxx.xxx.xxx.xxx] mod_fcgid: HTTP request length 132751 (so far) exceeds MaxRequestLen (131072), referer:http://xxx.xxx.com/content/edit/82314/1
    [Sat Oct 15 10:17:00 2011] [warn] [client xxx.xxx.xxx.xxx] mod_fcgid: HTTP request length 133584 (so far) exceeds MaxRequestLen (131072), referer:http://xxx.xxx.com/content/edit/82314/1

    So I changed the settings as recommended here but the issue persists.

    I have already restarted Apache, what else am I missing?
     
  8. luigidelgado

    luigidelgado Well-Known Member

    Joined:
    Nov 6, 2010
    Messages:
    109
    Likes Received:
    2
    Trophy Points:
    16
    Location:
    Mexico
    cPanel Access Level:
    Root Administrator
    Twitter:
    OK found the problem was I added this to Pre Main but didnt work so I added this to post virtual host and that made the work :)
     
  9. jpmartinez78

    jpmartinez78 Registered

    Joined:
    Oct 11, 2012
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    I have a vps and i was planing to create a reseller account for my own websites, 4 of them everything works fine. cpanel accounts, ftp,mysql etc but whe i install the template for wordpress , theres no posibility to generate thumbnails automatically , even if i add manually , obviously i have another hosting provider with cpanel and everything works fine.i suspect there´s a bad configuration or non property . i would like to know what is the best configuration based on wordpress the best performance and run cgi without any problems for cpanel. thanks
     
  10. Duplika

    Duplika Well-Known Member

    Joined:
    Feb 26, 2005
    Messages:
    56
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Buenos Aires, Argentina
    cPanel Access Level:
    Root Administrator
    Twitter:
    I agree there is ton of different suggested FastCGI settings. Wished cPanel adviced FastCGI over mod_ruid2 and eventually, have a decent default setup.

    We are currently using:
    Code:
    <IfModule mod_fcgid.c>
    FcgidMinProcessesPerClass  0
    FcgidMaxProcessesPerClass 8
    FcgidMaxProcesses 150
    FcgidProcessLifeTime 120
    FcgidIdleTimeout 60
    FcgidIdleScanInterval 30
    FcgidMaxRequestLen 1073741824
    FcgidIOTimeout 2000
    </IfModule>
    Other than the Apache configuration adviced, I'd suggest adding a cron to kill old PHP processes and configuring PHP_FCGI_CHILDREN=0 as adviced here.
     
Loading...

Share This Page