"can readily distinguish between them..." - I would build a very simple independent mod_perl based utility that returns a simple 'PRODUCTION'|'PILOT'|'DEVELOPMENT' and servername combination upon invocation in XML|Plain Text|JSON
formats (depending upon input variables) and deploy on all of my servers. If you really want to get smart you can add more stuff like for production -- you could give a list of associated pilot and development systems but then you could be creating a maintenance nightmare for yourself if not careful.
A single body of code can be deployed, without change, and it will run appropriately in each case.. - Sorry, can't help you with the 'run appropriately'...stuff is always going to break. It is the law of the jungle. You can, depending on the standard, predictable results from your web service, fork the code to do different things. I fully understand how this can be necessary. For instance, if you have an application that notifies administrators when something happens you DON'T want it to send 1K e-mails from some darn pilot instance.
... complicated <VirtualHost> file tweaks... - Yeah, as I said, make your own webservice and make it read from something uber-reliable like DBM or something.
Celebrate Intellectual Diversity
Comment on Re: Best practices for distinguishing "development" from "production?"