Apache2 Won't Start on Startup

Dan Poirier poirier at pobox.com
Thu Feb 4 18:30:02 PST 2010


On Thu, Feb  4, 2010, at 09:07:14 PM, Ryan Schmidt <ryandesign at macports.org> wrote:

> On Feb 4, 2010, at 20:01, Dan Poirier wrote:
>
>> ${ENVVAR} is the syntax.  Let me try it...  yes, if I put this in my
>> httpd.conf:
>> 
>> ServerAdmin ${USER}@example.com
>> 
>> I get my username in error documents.  It seems to work for ${PATH} too.
>
> Ok, I see that, but I cannot get it to work for environment variables I have set myself with
>
> SetEnv MYVAR myvalue

Oh, good point.  That documentation probably needs to be improved.

SetEnv in the httpd.conf file doesn't define the environment variable
soon enough for the configuration file parsing to be able to use it. For
${ENV} in the config file, the environment variable needs to be set
before Apache is started.  One easy way is to edit
/opt/local/apache2/bin/envvars, which gets read by the apachectl script
before spawning the server.

Dan



More information about the macports-users mailing list