SuPHP in ISPConfig3

Discussion in 'Installation/Configuration' started by Captain, Jun 7, 2012.

  1. Captain

    Captain Member

    Hello!

    I use SuPHP for all my web-sites in ISPConfig3
    But in htop I see www-data user only.

    But in my old server ISPCOnfig2 I use suphp mod too, but I see all users who use apache (not www-data).

    How to solve this thing?

    Thank you.
     
  2. till

    till Super Moderator

    ISPConfig has a better mode then suphp which was not available in ispconfig 2 which also allows your sites to run under different users but its much faster. The recommended php mode in ispconfig 3 is:

    Suexec: On
    PHP mode: fast-cgi

    If you prefer to use the slower suphp kode, then you should first check under which user php is really run. You can do that with a script like this:

    <?php
    touch('test.txt');
    ?>

    upload it to a website directory and open it in a browser. You will either get a error message that the file test.php could not be written to the directory were the php file is, this indicates that suphp is really not working. If you dont get a error message, then a test.txt file must have been created in the same directory, check on the shell or with a ftp client which user owns this file, is it www-data or is it the user of the website.
     
  3. Captain

    Captain Member

    yes. file created. and owner is web-site owner (like web1:client1)

    But what about security questions with fast-cgi?

    And how I can to see which user run script in htop or top (now I see only that is www-data)?

    Thank you Till.
     
  4. till

    till Super Moderator

    When you enable suexec as I recommended above, then fastcgi runs the php binary under the web user like suphp is doing it, so its as secure as suphp but faster.

    The processes that you have seen are most likely apache processes and apache runs always as www-data. The php cgi scripts spawned by suphp run only a very short time, so you might not see them at all.

    If you switch to fastcgi, then you can see the processes and their owners with top, as fastcgi processes run a loner time as they were reused for new php processing requests.
     

Share This Page