1

I am using an Alias directory to use a content management system for multiple websites. It's like an application pool in IIS (for the Windows guys here).

While every website has its own user (I am using a VDS with DirectAdmin), and the CMS also has of course its own user, I now have permission issues because the CMS user needs read permissions in every website (= homedir).

How do I do that?

My situation:
/home/myapp/cms with user 'myapp' <- is attached to every website by an Alias directive

/home/site1/public_html with user 'site1'
/home/site2/public_html with user 'site2'

I have tried chmod o+rX /home/myapp/cms, but that didn't do the trick. Also chown is no solution, because it can handle only one single user.

Update: To illustrate this better, my site is showing the following error:

Warning: require(/home/site1/public_html/includes/config.php) [function.require]: failed to open stream: Permission denied in /home/myapp/cms/index.php on line 2

What means the 'shared application' hasn't have the sufficient right.

In this case I have also have done

chmod o+rwX /home/site1/public_html/includes/config.php

Of course 'myapp' and 'site1' is different in the real case. This is just an simplification.

Dirk Luijk
  • 55
  • 6

1 Answers1

0

You probably need to change the permissions of the files inside /home/myapp/cms too. e.g. chmod -R o+rX /home/myapp/cms

tumbleweed
  • 293
  • 1
  • 4
  • Thanks for responding, but that didn't work. PHP displays the following error: `Warning: require(/home/site1/public_html/includes/config.php) [function.require]: failed to open stream: Permission denied in /home/myapp/cms/index.php on line 2`. What means the 'shared application' hasn't have the sufficient right. I also have done `chmod o+rwX /home/site1/public_html/includes/config.php`.. – Dirk Luijk Dec 26 '11 at 13:05
  • Look at what line2 of index.php is trying to do – tumbleweed Dec 26 '11 at 13:16
  • My shared application is just requiring (including) the config file from the site (read). But it hasn't the needed rights. I think this is because the file owner is different, but that must be so (for FTP/DirectAdmin/etc). – Dirk Luijk Dec 26 '11 at 13:27
  • If "other" has a read permission, and an execute permission on every parent directory of that directory, then it should be able to read it. – tumbleweed Dec 26 '11 at 13:28
  • Thank you tumbleweed! I didn't consider that all parent directories do need the right permissions. So instead of `chmod -R o+rwX /home/somesite/public_html` I now tried `chmod -R o+rwX /home/somesite` and that did the trick. But my second question now is: has all other 'website users' read/write permissions in this dir? Because that is not secure I guess.. – Dirk Luijk Dec 26 '11 at 18:54
  • Yes, you've given everyone write permissions. That's probably not a good idea :P – tumbleweed Dec 27 '11 at 09:47