doc_root or something like it
Posted: Fri Feb 08, 2008 5:46 pm
Hi
I have successfully set up a centos5 testing server but have spent the last few days trying to fix this seemingly simple problem. I would like all my virtual hosts to have the same server root because thats how it is set up on our production server (god knows how they do it).
On that server, every account has /htdocs/www as their document root. So if I want to require a file, I do require("/htdocs/www/somefile.php"). I cant seem to figure out how to set this up on my testing server while hosting several sites. No matter what I do, realpath(".") shows /var/sites/<domain>/htdocs/www/ which is the actual path. I'd like to have all my accounts, with different domains, to show /htdocs/www when I echo realpath(".") even though the actual path would be /var/sites/<domain>/htdocs/www (but php would never know that).
I was wondering if anyone had a direction for me to go in for this. I've already tried setting doc_root in php.ini but it ignores it, probably because the server api is "Apache 2 Handler". Tried chroot which jails all apache but doesn't help this problem. suPHP which runs scripts under the individual user correctly but doesnt jail them.
I'm fine with just tricking PHP into thinking the root is at "/var/sites/<domain>/". Any help would be greatly appreciated!
(how the heck does my hosting company pull this off?)
I have successfully set up a centos5 testing server but have spent the last few days trying to fix this seemingly simple problem. I would like all my virtual hosts to have the same server root because thats how it is set up on our production server (god knows how they do it).
On that server, every account has /htdocs/www as their document root. So if I want to require a file, I do require("/htdocs/www/somefile.php"). I cant seem to figure out how to set this up on my testing server while hosting several sites. No matter what I do, realpath(".") shows /var/sites/<domain>/htdocs/www/ which is the actual path. I'd like to have all my accounts, with different domains, to show /htdocs/www when I echo realpath(".") even though the actual path would be /var/sites/<domain>/htdocs/www (but php would never know that).
I was wondering if anyone had a direction for me to go in for this. I've already tried setting doc_root in php.ini but it ignores it, probably because the server api is "Apache 2 Handler". Tried chroot which jails all apache but doesn't help this problem. suPHP which runs scripts under the individual user correctly but doesnt jail them.
I'm fine with just tricking PHP into thinking the root is at "/var/sites/<domain>/". Any help would be greatly appreciated!
(how the heck does my hosting company pull this off?)