Read php script in reseller account with suPHP

reilabrador

Registered
Nov 17, 2011
2
0
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.
 

reilabrador

Registered
Nov 17, 2011
2
0
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?
 

cPanelTristan

Quality Assurance Analyst
Staff member
Oct 2, 2010
7,607
42
348
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.