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.

Understanding suExec, permissions, and the account php runs under

Discussion in 'Security' started by ladydi711, Sep 25, 2013.

  1. ladydi711

    ladydi711 Well-Known Member

    Joined:
    Sep 4, 2001
    Messages:
    120
    Likes Received:
    3
    Trophy Points:
    18
    Hi,

    I have a customer using Wordpress Duplicator to install/migrate a site.

    I am using suExec, so I understood that php runs under the user account name.

    The users public_html directory pemissions is:

    drwxr-x--- accountname:nobody

    The only way I can get the Duplicator program to sucessfully test/install is by changing permissions to:
    drwxrwx---

    Which makes me believe that php is running under nobody as log files are created owned by nobody:nobody.

    EasyApache resets the public_html permissions back to drwxr-x---. So, I have been battling permissions each time I need to add a new module for the site to function.

    Do I have something not configured properly? Or am I not understanding how this should be working?

    Thanks in Advance!
    Diane
     
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,834
    Likes Received:
    672
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    suPHP is the PHP handler you should use to ensure PHP runs as the account username. This is not the same thing as "suExec".

    Thank you.
     
  3. ladydi711

    ladydi711 Well-Known Member

    Joined:
    Sep 4, 2001
    Messages:
    120
    Likes Received:
    3
    Trophy Points:
    18
    Thanks for the clarification!

    I just reviewed my EasyApache profile, and I do indeed have suPHP/mod_suphp enabled.

    What else can I do to verify this setup?

    Thanks,
    Diane
     
  4. HostingH

    HostingH Well-Known Member

    Joined:
    Jan 13, 2008
    Messages:
    73
    Likes Received:
    3
    Trophy Points:
    6
    cPanel Access Level:
    Root Administrator
    To check your current PHP configuration please use following command

    /usr/local/cpanel/bin/rebuild_phpconf --current

    To enable SuPHP, simply execute the following command:

    # /usr/local/cpanel/bin/rebuild_phpconf 5 none suphp 1
     
  5. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,834
    Likes Received:
    672
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Check to ensure suPHP is configured as your default handler for PHP in:

    "WHM Home » Service Configuration » Configure PHP and suEXEC"

    Thank you.
     
  6. ladydi711

    ladydi711 Well-Known Member

    Joined:
    Sep 4, 2001
    Messages:
    120
    Likes Received:
    3
    Trophy Points:
    18
    Thanks again for the info.

    I remember now. I changed from suPHP to dso after the migration to this server, as there were some sites using php directives in the .htaccess file. At the time, that seemed the quickest way to get the sites up and running.

    I may re-think that now, and plan for a migration back to suPHP, but at least I understand now!

    Thanks again!
    Diane
     
  7. quizknows

    quizknows Well-Known Member

    Joined:
    Oct 20, 2009
    Messages:
    942
    Likes Received:
    57
    Trophy Points:
    28
    cPanel Access Level:
    DataCenter Provider
    SuPHP is definitely easier for servers with multiple sites, as PHP runs as the user, and it avoids permissions issues.

    If you need to change PHP settings for a single site, rather than change them in .htaccess (as you did with DSO but discovered does not work with SuPHP) you can simply give the user thier own php.ini file and change their settings in that file. Simply create /home/username/public_html/php.ini (you can copy /usr/local/lib/php.ini to that location), and add this to the users main .htaccess file in public_html:

    Code:
    suPHP_ConfigPath /home/username/public_html 
    <Files php.ini> 
    order allow,deny 
    deny from all 
    </Files>
    
     
Loading...
Similar Threads - Understanding suExec permissions
  1. durangod
    Replies:
    3
    Views:
    118

Share This Page