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.

Changing VirtualHost User and Group?

Discussion in 'General Discussion' started by java_dude, Jun 22, 2011.

  1. java_dude

    java_dude Active Member

    Joined:
    Apr 23, 2004
    Messages:
    37
    Likes Received:
    0
    Trophy Points:
    6
    cPanel Access Level:
    Root Administrator
    Hey guys, I'm currently running PHP as a DSO, which is working well performance-wise, but I've run into some permission issues... for example, the CMS on my site needs to create/update/unpack files during upgrades, and later I need to update them via FTP. Obviously this causes an issue because the files are owned by the default Apache user and not the Cpanel/FTP user.

    I've been considering installing FastCGI, but it seems like overkill in my situation - this is a dedicated box which only hosts my site, and I don't host other people's websites. I do have multiple subdomains, but they're all under the same Cpanel account.

    I was reading up on some Apache directives and immediately the "User" and "Group" directives stand out and seem like they might do the trick. Can I simply set these directives in each vhost in httpd.conf (or use an include file) to use the Cpanel account owner's username to simplify the permission/ownership issues?

    Thanks!
     
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    676
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Hello :)

    FCGI is only recommended for advanced administrators who understand how to tune the performance of mod_fcgid.

    Have you considered using suPHP as the default handler for PHP? PHP scripts will be executed by the user who owns the VirtualHost serving the request when suPHP is enabled. More information on this can be found at:

    Apache PHP Request Handling

    Thank you.
     
  3. java_dude

    java_dude Active Member

    Joined:
    Apr 23, 2004
    Messages:
    37
    Likes Received:
    0
    Trophy Points:
    6
    cPanel Access Level:
    Root Administrator
    Hi Michael, the problem with SuPHP is the performance - I run a high traffic site, and I need to use the most efficient method of doing this. I'd much prefer to run PHP as a DSO, if it's possible to simply change the "User" and "Group" directives in my vhosts. But if that's not possible, it seems like the second best way to do this is with FastCGI.

    Is it possible to just change the user and group per vhost to get the desired effect, or is it really necessary to run SuPHP/FCGI?

    Thanks!
     
Loading...

Share This Page