Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

Read php script in reseller account with suPHP

Discussion in 'General Discussion' started by reilabrador, Nov 17, 2011.

  1. reilabrador

    reilabrador Registered

    Joined:
    Nov 17, 2011
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    51
    cPanel Access Level:
    Reseller Owner
    For some years, I developed a php script that is now a Platform for Web Management.
    The script is located in main account "/home/reseller/wwww" and the customers (from other accounts) can read this script under web.
    At this moment the server has fastcgi and some configuration of virtualhost.
    The problem is that my administrator is forcing me switch to suPHP for security reason.
    I hear that this system will not allow the others accounts read the script located in reseller account.
    I would like to know if exists any solution to access the script under web?
    I have been searching all over for an answer, but nothing. I hope get some help here.
     
  2. cPanelMichael

    cPanelMichael Technical Support Community Manager
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    45,423
    Likes Received:
    1,957
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    Hello :)

    The following thread may be useful to you:

    suPHP and Symbolic links on a reseller account

    However, the more secure method would be to adjust the script configuration so that accounts do not rely on a file from another account.

    Thank you.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. reilabrador

    reilabrador Registered

    Joined:
    Nov 17, 2011
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    51
    cPanel Access Level:
    Reseller Owner
    Thanks for the help.
    I've read the article but my script does not have symlinks, just have virtualhost configuration for the other domains can read the specific folder in the reseller account.
    I do not know if it can keep the same parameters with suPHP?
     
  4. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,608
    Likes Received:
    32
    Trophy Points:
    238
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    No other users can call a script they do not own under suPHP regardless of VirtualHost entries, since that folder has to be owned by the reseller user. Under suPHP, you will end up with user and group mismatch errors when those other accounts try to call the script(s) in that folder.

    Instead of the method you are using right now, try placing the scripts into /usr/local/cpanel/htdocs to see if all users are able to utilize the scripts then. The ownership would need to be root:root for anything in /usr/local/cpanel/htdocs location and any includes or calls for the script will need to use the full path (/usr/local/cpanel/htdocs/filename.php).

    If any of the files are images, instead place them into /usr/local/cpanel/img-sys/ location and call them by the short path of /img-sys/imagename.ext where imagename.ext would be the name of the image.

    I discuss sharing images under suPHP using img-sys in this post:

    https://forums.cpanel.net/f34/referencing-images-another-cpanel-account-243381.html#post1002941

    As for using the htdocs for cPanel, this is a method being tested for calling scripts that I recently discovered and the first time I've mentioned it here. We are still looking into this being a possible solution over disabling FileProtect under suPHP for sharing scripts, so I cannot guarantee the results.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice