Apache2 Won't Start on Startup
Ryan Schmidt
ryandesign at macports.org
Thu Feb 4 17:08:12 PST 2010
On Feb 4, 2010, at 17:28, Dan Poirier wrote:
> On Thu, Feb 4, 2010, at 03:57:52 PM, Rob Wilkerson wrote:
>
>> I'm trying to share a httpd.conf file across two Macs via Dropbox
>> (with symlinks in each Mac's /opt/local/apache2/conf/ directory).
>> Similarly, I store virtual host conf files individually and include
>> them in my main httpd.conf:
>>
>> Include "${HOME}/Dropbox/Application Support/apache/conf.d.osx/*.conf"
>> Include "${HOME}/Library/Application Support/MacPorts/apache/conf.d/*.conf"
>>
>> Unfortunately, my username on each Mac is different (one is a work
>> machine that I can't change) which is why I'm using the ${HOME}
>> environment variable to tell Apache where to find the conf files. As
>> far as I can tell, that's the root of this problem. Even though the
>> LaunchDaemon is loaded, Apache won't start when I boot up. The system
>> log reports that:
>>
>> Feb 4 07:05:01 robwilkerson org.macports.apache2[55]: httpd: Syntax
>> error on line 512 of /opt/local/apache2/conf/httpd.conf: Include
>> directory '/opt/local/apache2/${HOME}/Dropbox/Application
>> Support/apache/conf.d.osx' not found
>
> Assuming /opt/local is local to each system, you could set HOME (or some
> other variable name) differently in /opt/local/apache2/bin/envvars on
> each system. That will set it in apache when starting.
I tried something similar, but I could not find a way to then use that $HOME variable (or any variable) in the Include statement. I don't think the Apache configuration file syntax supports variable expansion.
More information about the macports-users
mailing list