Cloudlinux and custom virtualhost

rahnev

Well-Known Member
Jul 6, 2016
62
7
58
Bulgaria
cPanel Access Level
Root Administrator
We have server with Centos 6.8 + cPanel v62 + Cloudlinux + Cagefs.
We have added custom vhost to the system in /etc/apache2/conf.d/includes/post_virtualhost_global.conf with the following content:

Code:
<VirtualHost IP_ADDRESS:80>
    ServerName domain.example.com

    DocumentRoot /var/www/test

  <IfModule suphp_module>
     suPHP_UserGroup user1 user1
  </IfModule>
 
  <IfModule suexec_module>
    <IfModule !mod_ruid2.c>
      SuexecUserGroup user1 user1
    </IfModule>
  </IfModule>
 
    <Directory /var/www/test>
        AllowOverride all
        Options Indexes FollowSymlinks
        DirectoryIndex index.php index.html
        Require all granted
    </Directory>

</VirtualHost>
This vhost is executed with user1 permissions.

We need this vhost/user have access to /home/*/public_html dirs via web (read and write files there). Is this possible and how can be achieved if possible?

Thanks.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,258
463
This vhost is executed with user1 permissions.

We need this vhost/user have access to /home/*/public_html dirs via web (read and write files there). Is this possible and how can be achieved if possible?
Hello,

I believe you would have to first exclude the user from CageFS for this to work. Documentation on how to do that is documented at:

CloudLinux Documentation

However, note that it's not generally a good idea to have one user write files to multiple accounts. We could provide you with potential alternatives if you provide some information about what you are attempting to do with this user.

Thanks!
 

rahnev

Well-Known Member
Jul 6, 2016
62
7
58
Bulgaria
cPanel Access Level
Root Administrator
I know it's not a good idea to have such user but it's needed for a project that need that access. That host/user will have to write some files in customers' public_html dirs based on some requests.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,258
463
That host/user will have to write some files in customers' public_html dirs based on some requests.
How will the user write the files? For instance, will it happen through a PHP script?

Thank you.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,258
463