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 context changes

Discussion in 'General Discussion' started by fasdush, Jun 4, 2008.

  1. fasdush

    fasdush Member

    Joined:
    Oct 29, 2005
    Messages:
    13
    Likes Received:
    0
    Trophy Points:
    1
    ----------------------------------------
    Easyapache 4199
    2008-05-14 12:28:01 Fixes
    Fixed various typos and grammatical errors
    Prevent use of FCGIWrapper directive in htaccess files
    Make PHP built by makecpphp use the php.ini in
    /usr/local/cpanel/3rdparty/etc
    ----------------------------------------

    We actually use FCGIWrapper directive in .htaccess files.

    I've already removed patch & recompiled/reinstalled mod_fcgid.so manually, but it seems that this need to be done after every Apache update.

    Is it possible to make this fix optional (and is this forum a right place to ask for something like this)?
     
  2. jdlightsey

    jdlightsey Perl Developer III
    Staff Member

    Joined:
    Mar 6, 2007
    Messages:
    126
    Likes Received:
    2
    Trophy Points:
    18
    Location:
    Houston Texas
    cPanel Access Level:
    Root Administrator
    When FCGIWrapper is used in a .htaccess file each request causes a new FastCGI server process to be created because the share_grp_id is incremented each time the .htaccess file is processed. This means the context of the current FCGIWrapper will never match the existing FCGIWrapper processes from mod_fcgid's perspective. The problem is detailed here:

    http://sourceforge.net/tracker/index.php?func=detail&aid=1962681&group_id=174879&atid=870991

    Are PHP FastCGI processes filling up your machine after your revert that patch or are you doing something else to prevent that from happening? (Like setting the minimum process count to 0 and letting them timeout..)
     
  3. fasdush

    fasdush Member

    Joined:
    Oct 29, 2005
    Messages:
    13
    Likes Received:
    0
    Trophy Points:
    1
    I was not aware of this problem, but we never get any serious performance hit or get OOM while using it.

    We use FCGIWrapper in .htaccess to specify custom php binaries on per-domain basis, for users that have multiple domains, and few of them still require php 4, while others running on php 5. It seems like easiest way to do so without manually editing httpd.conf. Well, seems like that should use per-domain includes instead until mod_fcgid developers fix this.

    Thanks.

    And one more question. To easy provide user-specific PHP binaries & ini files I've replaced /usr/local/cpanel/cgi-sys/php5 with this script:
    --------------------------
    #!/bin/bash

    if [ -e ~/php-fcgi/php ]; then
    if [ -e ~/php-fcgi/php.ini ]; then exec ~/php-fcgi/php -c ~/php-fcgi/php.ini
    else exec ~/php-fcgi/php
    fi
    elif [ -e ~/php-fcgi/php.ini ]; then exec /usr/local/cpanel/cgi-sys/php -c ~/php-fcgi/php.ini
    else exec /usr/local/cpanel/cgi-sys/php
    fi
    --------------------------

    This setup is working and we have no problems with it so far, but maybe there is some kind of potential problem.

    Are there any problems with that? Does mod_fcgid handle this well?
     
    #3 fasdush, Jun 6, 2008
    Last edited: Jun 6, 2008
  4. jdlightsey

    jdlightsey Perl Developer III
    Staff Member

    Joined:
    Mar 6, 2007
    Messages:
    126
    Likes Received:
    2
    Trophy Points:
    18
    Location:
    Houston Texas
    cPanel Access Level:
    Root Administrator
    I wouldn't trust that the -c argument to PHP will get parsed every time. There are some circumstances where the CGI binary will disregard all of the comand line options passed to it. Use the PHPRC environmental variable instead to be safe.

    Other than that, you should be fine. Each FastCGI wrapper context includes the UID, so it should be safe to specify a php.ini based on the UID. You may find that if you update the php.ini file the change will not take effect until existing PHP FastCGI servers expire.
     
  5. fasdush

    fasdush Member

    Joined:
    Oct 29, 2005
    Messages:
    13
    Likes Received:
    0
    Trophy Points:
    1
    Thank you.
     
Loading...

Share This Page