Okay, so let's say I have two virtual hosts in my Apache config. One defines the directories and such for example.com, whilst the other is for second.org. The server root for apache is
/var/www/ and the document roots for the two servers are
var/www/second respectively. If a PHP script sat inside of
var/www/example, it could read the entire system files. It could also read and execute anything inside of the
/var/www/ directory. This means a script on example.com could be used to run or read a script on second.org.
I'd like to be able to lockdown each virtual host so that each PHP script can only read /var/www/virtualdomain directory. Kind of like a shared hosting server where if you attempt to run a script such as:
<?php $dir = '/var/www/otheruser'; $files1 = scandir($dir); $files2 = scandir($dir, 1); print_r($files1); print_r($files2); ?>