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.

suphp and fast-cgi

Discussion in 'General Discussion' started by serversolutions, Apr 11, 2007.

  1. serversolutions

    serversolutions Registered

    Joined:
    Jan 31, 2007
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    Hi,

    I want to enable suphp and fast-cgi for my cpanel server, can I do it ?
    Also, is this a good idea to have suphp and fast-cgi to secure php on our server.

    Best Regards,
    Rik
     
  2. Spiral

    Spiral BANNED

    Joined:
    Jun 24, 2005
    Messages:
    2,023
    Likes Received:
    7
    Trophy Points:
    0
    Nope ... Doesn't Work! I've tried it on many servers before giving up!

    For some reason, SuPHP only likes running with PHP compiled as a regular CGI
    but it really is not necessary to run fast-cgi as suPHP is extremely efficient and
    surprisingly gives faster performance than both phpSuExec and module based PHP.

    As for how to enable it ....

    You currently would need to upgrade to Apache 2.0 (recommended) or 2.2
    if you want Cpanel to actually support SuPHP

    For now, that means you will have to go to EDGE in order to be able to do that.

    /scripts/easyapache is the script you would need to make that upgrade but
    you should be warned that script is riddled with problems and unless you know
    precisely what you are doing to get around it's shortcomings, you may find
    yourself with a non-working server that takes hours to fix for most average
    people instead of an upgraded server.

    With that said, SuPHP works AWESOME on Apache 2 with Cpanel 11.1 and I recommend
    it to everyone out there who is willing to stomach the upgrade process.
     
  3. intel352

    intel352 Well-Known Member

    Joined:
    Nov 25, 2003
    Messages:
    55
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    NC, USA
    Actually, the previous post was incorrect. It's possible to get PHP 4, PHP 5, FastCGI, and SuPHP all installed, with Apache 1.3.x & Cpanel, and still function happily :)

    I'm trying to find the how-to links, I'll post back shortly
     
  4. Spiral

    Spiral BANNED

    Joined:
    Jun 24, 2005
    Messages:
    2,023
    Likes Received:
    7
    Trophy Points:
    0
    Not without causing very serious stability problems ...

    I can install it no problem. Whether it works well is another story entirely.

    The problem lies in technical incompatibilities between FastCGI and SuPHP
    and will drastically degrade performance of your scripts and cause a number
    of false error issues when both FastCGI and SuPHP are installed.

    On other subjects, if you install SuPHP on Apache 1.3.x, it won't be supported
    by Cpanel which doesn't mean it won't work but rather that you are in extreme
    danger of Cpanel later overwriting your configuration and messing you up.
    You need to be on Apache 2 or above for Cpanel to formally recognize the
    extra SuPHP commands and configuration and not overwrite your configuration.
     
  5. intel352

    intel352 Well-Known Member

    Joined:
    Nov 25, 2003
    Messages:
    55
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    NC, USA
    CPanel 11, Apache 1.3x, SuPHP, FastCGI, PHP 4, PHP 5, works great for me. I've had this setup (except Cpanel 10 previously) for 6 months now, no issues.
     
  6. orty

    orty Well-Known Member

    Joined:
    Jun 29, 2004
    Messages:
    110
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Bend, Oregon
    cPanel Access Level:
    Root Administrator
    And I'll repeat somebody else's suggestions: How-to links or guidance would be really helpful. I'm primarily interested in FastCGI myself, especially in an implementation that won't get hosed on cPanel updates.
     
  7. intel352

    intel352 Well-Known Member

    Joined:
    Nov 25, 2003
    Messages:
    55
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    NC, USA
    I'm working on putting together a good how-to, along with a pre-patched version of SuPHP (since the patches don't work with the newest version of SuPHP, there's no point in describing what the patches were for). I've built a script that will compile PHP 4 & 5 (tho it could use some improvement) with Suhosin, and I've got a postwwwacct script for cpanel that modifies httpd.conf for suphp for new accts. [EDIT] nevermind about the postwwwacct script, CPanel actually does the change on it's own, apparently it detects suphp properly in CPanel 11[/EDIT]

    i'll have it done soon
     
    #7 intel352, May 27, 2007
    Last edited: May 27, 2007
  8. mblendinger

    mblendinger Member

    Joined:
    Apr 27, 2004
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    1
    Hello dears, I have the following problem, maybe you have a solutions for me :)

    My problem is than the .fcgi scripts are runned as "nobody", not with the username of the account like .cgi and .php

    Do you know what the problem is ?

    thank you!!!
     
  9. MACscr

    MACscr Well-Known Member

    Joined:
    Sep 30, 2003
    Messages:
    190
    Likes Received:
    1
    Trophy Points:
    18
    cPanel Access Level:
    Root Administrator
    How can i get suPHP and FastCGI to work at the same time with the same php version with EA3? Is this even possible? Maybe i dont even know what im doing, but i swear that i read that running FGI and suPHP was one of the best conbinations for security, but still being fast.
     
  10. intel352

    intel352 Well-Known Member

    Joined:
    Nov 25, 2003
    Messages:
    55
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    NC, USA
    macscr, latest easyapache (edge) supports suphp, fastcgi, and more. in WHM, just select the options that you want to have compiled. (select suphp, then fastcgi, fastcgi redirect, and might also need the regular cgi option as well)
     
  11. MACscr

    MACscr Well-Known Member

    Joined:
    Sep 30, 2003
    Messages:
    190
    Likes Received:
    1
    Trophy Points:
    18
    cPanel Access Level:
    Root Administrator
    Right, but when doing the configuration at the end after the build, you select the handler and fcgi and suphp are two different options. You cant select both.
     
  12. MACscr

    MACscr Well-Known Member

    Joined:
    Sep 30, 2003
    Messages:
    190
    Likes Received:
    1
    Trophy Points:
    18
    cPanel Access Level:
    Root Administrator
    Any other ideas?
     
  13. 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
    FastCGI is a communication protocol like CGI. When you compile PHP with FastCGI support that gives it the capability to speak FastCGI in addition to regular CGI. PHP4 does this rather poorly and sometimes tries to communicate using the FastCGI protocol when the other side of the connection is trying to speak CGI. PHP5 seems to be a little better at telling the two apart.

    Mod_suphp talks to the PHP binary in CGI. If you compile PHP with FastCGI support and run it through mod_suphp, PHP should be talking to mod_suphp in CGI. If it gets confused for one reason or another and tries to communicate using the FastCGI protocol, mod_suphp isn't going to understand it and you'll end up with some interesting and uninformative error messages.

    Mod_fcgid does communicate using the FastCGI protocol and it also handles starting and stopping PHP processes running as FastCGI servers. There are lots of caveats involved, and the fastcgi setup cPanel creates is very basic, so this is really not a recommended way of running PHP if you're not sure of how it works. It would be better to run PHP as a DSO for best performance or through mod_suphp for better security.
     
Loading...

Share This Page