views:

34

answers:

1

I'm trying to share a single httpd.conf file across multiple OS X machines. I'm using Dropbox to manage the file and make it available to both machines. The problem I'm having is that the httpd.conf file has to load virtual host config files from a location within my home directory and the path is different on each machine.

I tried referencing the ${HOME} variable, but, while it works when starting Apache manually, that variable isn't available when Apache tries to boot at startup. I learned that by asking this question.

As a next step, I created ~/.MacOSX/environment.plist and created a new environment variable I called HTTPD_CONF_BASE_PATH that points to the proper home directory on each machine (e.g. /Users/rwilkerson). Unfortunately, Apache doesn't seem to like my custom variable. It's recognized by the system--I can echo it just fine--but Apache will not start at boot or manually if that value is being referenced.

Is Apache that sensitive to which environment variables it will acknowledge? Do I have any other options here? I'm out of things that I can think to try.

+1  A: 

The problem is that apache isn't running as "you" so it has no way of knowing which home folder you mean.

Your best bet is to keep the config files at the same path on both machines. If the files absolutely have to live in your home folder, you can use a symbolic link to point from somewhere common.

Andrew Neelands
Okay. I guess I was hoping to catch the boot cycle somewhere between knowing enough about me to know what directory to look in, but before environment variables were set. You've given me a perspective, though, that clearly shows this to be tenuous at best.
Rob Wilkerson