I've set up all of my sites in different /var/www
subdirectories.
Let's say I have 5 sites based in a CMS like WordPress in /var/www/a.com
, /var/www/b.com
, /var/www/c.com
, /var/www/d.com
and /var/www/e.com
.
But I've found out that if I give admin permissions to someone in a.com
, with certain plugins, they can get access to crawl down to /var/www
, and access a different directory, lets say /var/www/c.com
, therefore they can gain access by reading for example the config file (wp-config.php
) in case of WordPress, because ultimately the directory listings plugins do it via the web server, which may have group access permissions.
The only solution I find is to restrict full access both to guest and group just in this file, so technically it will be only accessible via SSH with root access, but this may lead to errors since web server won't be able to access unless the web server user is the owner.
This leads me to the conclusion that there is an inherent risk if you host multiple sites in the same host, and they run the same web server daemon. But there should be a solution, because this is done by hundreds of web hostings all around the world.
Can anyone recommend me a solution given this scenario?