Is it possible to share a directory across WHM accounts?

0

1

I'm trying to install a single instance Matomo across multiple WHM accounts. I've done this before just by changing the DocumentRoot within httpd VirtualHost configurations, however with the WHM/cPanel EasyApache the best I've gotten is creating symlinks which then cause issues because they are expecting the WHM account username to match the owner of the shared directory on the machine.

Is there a way around this? I've also tried VirtualHost overrides for EasyApache as outlined in the link below, however they don't appear to include the DocumentRoot configuration line:

https://documentation.cpanel.net/display/EA4/Modify+Apache+Virtual+Hosts+with+Include+Files

CoryG

Posted 2019-05-18T08:46:20.860

Reputation: 304

Answers

0

documentroot is set in /var/cpanel/userdata/$user/ in the files:

$the_domain
$the_domain_SSL
$the_domain.cache
$the_domain_SSL.cache

After which you need to run:

/scripts/updateuserdatacache
/scripts/rebuildhttpdconf
/usr/sbin/httpd -k restart 
/scripts/php_fpm_config --rebuild --domain=$the_domain

You should be able to work with the limitations of "security" by running this from root:

for user in memberA1 memberA2 memberA3 memberA4 memberA5 memberA6 memberA7 memberA8; do sudo(^) usermod -a -G userA "$user"; done

(^) Sudo with wheel membership, or run from root user.

And altering the standard perms of SUPHP in /etc/suphp.conf to be as follows:

allow_file_group_writable        true;
allow_directory_group_writable   true;
paranoid_uid_check               false;
See docs [here][1] for more configuration.

That is what has been working for me, although some hosts have an annoying puppet that "cleans" settings of your customizations, so you may have to speak with your hosting provider and ask them to turn off any janitorial/maintenance puppets that revert altered settings back to out of the box. If you have any questions just gimme shout, as this is a very custom fix that many providers don't like because it reduces your overhead and cuts into their profit margin. Consult with your provider about whether they will terminate your service for this edit, and send me a note for more specific feedback, as it might also be tweaked with symlinks depending upon your setup.

I'm on Twatter,
@HenryHardCase

HenryHardCase

Posted 2019-05-18T08:46:20.860

Reputation: 1