Anyhow, what your requesting already exists inside of Zope. Zope uses an environment variable called INSTANCE_HOME to determine where the var/ directory is. So for example if you set INSTANCE_HOME = /tmp then run Zope it would expect the object database to be in /tmp/var.
What you can do next is to combine this with apache's <VirtualHost> and SetEnv directives to have the server launch one process per site. For example in your httpd.conf try this:
<VirtualHost localhost> RewriteEngine on RewriteOptions inherit SetEnv INSTANCE_HOME /home/localhost SetEnv PCGI_SOCKET_FILE /home/localhost/var/pcgi.soc SetEnv PCGI_PID_FILE /home/localhost/var/pcgi.pid </VirtualHost>
Make sure you have the latest version of pcgi_wrapper. When we first started to do this, there was a bug in pcgi_wrapper that caused it not to read the environment variables. We fixed it, and the patch has since been applied, but just so you know, if it doesn't seem to work, make sure you have the latest version.