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!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Cloudlinux and custom virtualhost

Discussion in 'CloudLinux' started by rahnev, Mar 14, 2017.

Tags:
  1. rahnev

    rahnev Active Member

    Joined:
    Jul 6, 2016
    Messages:
    33
    Likes Received:
    2
    Trophy Points:
    8
    Location:
    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.
     
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    38,658
    Likes Received:
    1,427
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    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!
     
  3. rahnev

    rahnev Active Member

    Joined:
    Jul 6, 2016
    Messages:
    33
    Likes Received:
    2
    Trophy Points:
    8
    Location:
    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.
     
  4. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    38,658
    Likes Received:
    1,427
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    How will the user write the files? For instance, will it happen through a PHP script?

    Thank you.
     
  5. rahnev

    rahnev Active Member

    Joined:
    Jul 6, 2016
    Messages:
    33
    Likes Received:
    2
    Trophy Points:
    8
    Location:
    Bulgaria
    cPanel Access Level:
    Root Administrator
    Yes it will happen through a PHP script.
    What alternative can you offer?
     
    #5 rahnev, Mar 15, 2017
    Last edited: Mar 15, 2017
  6. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    38,658
    Likes Received:
    1,427
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
Loading...

Share This Page