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.

Pages owned by certain user-group show up as Internal Server Error

Discussion in 'General Discussion' started by Shirokumo, Apr 20, 2015.

  1. Shirokumo

    Shirokumo Member

    Joined:
    Sep 18, 2014
    Messages:
    9
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Today, one of the web designers who hosts a site on my server informed me that when he uploaded a new .php page, it was coming up with Internal Server Error.

    When I checked the attributes of the file, it was owned by user1, but the group it was owned by was cpanelusers: a group I created a while ago in order to give two users access to eachother's files. (Long story short, one user controlled the mobile domain, the other the desktop domain, however many of the images and thumbnails used for the mobile domain were generated from files owned by the desktop domain user). The fix for that issue was to create the shared group "cpanelusers" and default newly created/uploaded files to being owned by that group.

    The weird thing is, as soon as I changed the group ownership to the user1 group (along with keeping the user ownership set to the user1 user), the page loaded as expected.

    I'm willing to bet that there's just something stupid in the cpanelusers group attributes that's preventing any web visitors from loading that particular .php, but I'm such a Linux newb I'm not even sure where to start looking.

    Does anyone have any idea what might be causing this problem? Any tips on diagnostic approaches I could look into? Thank you.
     
  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,

    What's the exact error message you see in /usr/local/apache/logs/error_log when this happens? Are you using suPHP as your PHP handler?

    Thank you.
     
  3. Shirokumo

    Shirokumo Member

    Joined:
    Sep 18, 2014
    Messages:
    9
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    I apologize for how long its taken me to get back to you, and I appreciate your help. This problem has gotten a lot stranger.

    So, as I described in my initial post, pages that were being created were owned by the group 'cpanelusers' and in order to get them to load I needed to change that group ownership to the 'user1' group.

    Yesterday, that completely flipped. I could not get our website to load, the homepage was giving us that Internal Server Error. When I looked in the apache error log I saw:

    SoftException in Application.cpp:431: Mismatch between target GID (550) and GID (513) of file "/home/fu/bar/index.php".

    A brief look through group attributes showed me that GID 513 is the 'user1' group, and GID 550 is 'cpanelusers'. I ended up bringing the website back up by changing group ownership of everything in the web folder to the 'cpanelusers' group, which, if you'll recall from my first post, was the problem configuration previously.

    I've spoken to my web guys (who are the ones who write the PHP and manage the page itself) and they have not done anything to cause this sudden shift. I can not wrap my head around why one day my server would not load anything owned by the 'cpanelusers' group and the next day suddenly go down and demand that everything be owned by the 'cpanelusers' group.

    To cap it all off, now when I look through the error log I'm seeing the opposite error:

    SoftException in Application.cpp:431: Mismatch between target GID (513) and GID (550) of file "/home/fu/bar/index.php".

    So now apache is saying that it expects that file to be owned by the 'user1' group and NOT 'cpanelusers'. The only difference today is that the website is still up and seems to be functional despite this error showing up in the logs every couple of minutes.

    PS: To answer your last question, yes, we are using suPHP as our PHP handler.
     
  4. 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,

    Your files should have the same user and group ownership. Both ownership values should show the account username. EX:

    user.user file.php

    Thank you.
     
  5. Shirokumo

    Shirokumo Member

    Joined:
    Sep 18, 2014
    Messages:
    9
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Okay, I see what you're saying, but did you read the part of my story where that was the only way the web page would load? Where Apache was throwing all sorts of errors about the target GID not being the user group?
     
  6. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    676
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    What error messages were in /usr/local/apache/logs/error_log when the user/group ownership values were both set to the account username?

    Thank you.
     
  7. Shirokumo

    Shirokumo Member

    Joined:
    Sep 18, 2014
    Messages:
    9
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Target GID was 'cpanelusers', current GID was 'user1'. This is the error I was getting.
     
  8. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    676
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    That message indicates the user/group settings were not both set to the account username. What's the output of "ls -al /path/to/file.php" when you run "chown user.user /path/to/file.php"?

    Thank you.
     
  9. Shirokumo

    Shirokumo Member

    Joined:
    Sep 18, 2014
    Messages:
    9
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    That's not what that error indicates at all. The error was specifically stating that the current setup was user1:user1, and that the TARGET GID SETUP was user1:cpanelusers.

    You are right, when I run ls -al on that directory, the files are owned by user1:cpanelusers, which is contrary to the setup you are suggesting. What I'm telling you, if you actually read my description of the issue or the steps I took to fix our website downtime yesterday, was that if I use your configuration suggestion, the way it was set up BEFORE, the website GOES DOWN.

    The only way to get the pages to load right now is to chown them to user1.cpanelusers, and NOT user1.user1.
     
  10. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    676
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Would you mind opening a support ticket using the link in my signature so we can take a closer look at your specific configuration and determine why that message is occurring? Sometimes reviewing the file ownership/permissions and reproducing the error allows us to more easily determine the cause. You can post the ticket number here so we can update this thread with the outcome.

    Thank you.
     
Loading...

Share This Page