Daniel Von Fange

Life, Code, and Cool Stuff

Document Root Problems With Dynamic Vhosting

I discovered ”Dynamically configured mass virtual hosting” today. It will save me quite a bit of grief - since I won’t have to edit a mysql database, and have my own shell scripts building configuation files and restarting apache. I just point the DNS at my server, and then create a directory with the name of the domain. It’s a good way to do things.

But it has a bug. The DOCUMENT_ROOT environment variable is not being set to the document root being used. This throw errors into PHP scripts and cgi programs that use DOCUMENT_ROOT. (Someone with the same problem)

The docs tantalizingly say, “The other thing to `fake’ is the document root”, but then spin around at the end of the paragraph to declare, “there isn’t any way to change DOCUMENT_ROOT dynamically”.

Maybe I’ll have to try to get a fix put into Apache. Anyone have any experience with doing that? :)