1. Forums
  2. CloudLinux and Control Panels
  3. CloudLinux and cPanel
  1. rahnev
  2. Tuesday, 14 March 2017
  3.  Subscribe via email
Hello all,

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:


<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.
Rate this post:
  1. 14.03.2017 14:03:25
  2. # 1
Bogdan Accepted Answer
Posts: 709
Joined: 26.06.2013
0
Votes
Undo
Hello,

Do you mean you would like to have a virtualhost that can browse all other users public_html directories? Why you need it?
  1. 14.03.2017 15:03:33
  2. # 2
rahnev Accepted Answer
Posts: 11
Joined: 06.07.2016
0
Votes
Undo
Yes, something like this. It'a project that need access to them.
  1. 14.03.2017 15:03:27
  2. # 3
Bogdan Accepted Answer
Posts: 709
Joined: 26.06.2013
0
Votes
Undo
It's not possible to do so by means of apache vhosts. I even do not think it is possible at all without some additiona --bind mounts.. But you are making great security hole which overall goes in a contrast to what CageFS was designed for.

If I were you, I would try finding other solution to match what project need.
  1. 15.03.2017 07:03:39
  2. # 4
rahnev Accepted Answer
Posts: 11
Joined: 06.07.2016
0
Votes
Undo
Can you offer some alternative? This particular user/vhost have to read and write files somewhere where all other vhosts/users can read and use them.
  1. 15.03.2017 12:03:27
  2. # 5
Bogdan Accepted Answer
Posts: 709
Joined: 26.06.2013
0
Votes
Undo
There is no nice solution for this, you will still need to disable some security part of CloudLinux like symlic owner protection.

If other users just need to read files I see a way to do it with:
1. Create vhost for that user, with document root like /var/www/test/ . With this a test vhost will be able to write/read files into it.

2. Mount that directory to each user with /etc/cagefs/cagefs.mp , just add /var/www/test/ in it and run 'cagefsctl --rmeount-all'. http://docs.cloudlinux.com/index.html?mount_points.html

3. Create a symbolic link inside every virtualhost like:

ln -s /var/www/test /home/user/public_html/shared_content


This have to be done automatically with some cPanel hooks.
  1. 17.03.2017 07:03:15
  2. # 6
rahnev Accepted Answer
Posts: 11
Joined: 06.07.2016
0
Votes
Undo
Thanks Bogdan. I managed to do this the same way as you suggested. Thanks.
  • Page :
  • 1


There are no replies made for this post yet.
Be one of the first to reply to this post!
Guest
Submit Your Response
Upload files or images for this discussion by clicking on the upload button below. Supports gif,jpg,png,zip,rar,pdf
• Insert • Remove Upload Files (Maximum File Size: 2 MB)
Captcha
To protect the site from bots and unauthorized scripts, we require that you enter the captcha codes below before posting your question.