doc_root or something like it

Need help installing PHP, configuring a script, or configuring a server? Then come on in and post your questions! We'll try to help the best we can!

Moderator: General Moderators

Post Reply
nolanpro
Forum Newbie
Posts: 17
Joined: Fri May 12, 2006 5:17 pm

doc_root or something like it

Post by nolanpro »

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?)
Post Reply