How do I specify the server's document root?
Date: 02/05/08
(Apache) Keywords: php, web, apache
I work on a Macintosh running Apache 2.2.6 for a lot of website development projects in PHP. Up until now, when it was necessary to specify a document root I would just change the value of $_SERVER['DOCUMENT_ROOT'] ... but that's really not that functional, as I still cannot do something like link an image or link like /index.php.
I've been googling for a way to change Apache's document root based on folder structure but thus far my efforts have just caused apache to fail until I undo my changes. What I'm trying to do is set it so that when you go to say "127.0.0.1/Bob" that "Bob" and all its subsequent directories might have a doc root of /httpd/Documents/Bob" but if you go to "127.0.0.1/Mary" there would be a different document root.
Is this possible?
Source: http://community.livejournal.com/apache/40442.html