You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Andy Lester <an...@petdance.com> on 2002/06/17 19:00:35 UTC
Re: Environment vars in httpd.conf
> I can't recall how to use environment vars inside an httpd.conf file. I
> need to have the ServerName value set to $HOSTNAME (the httpd.conf is
> shared by multiple machines via CVS, so this value is different on each
> developers machine).
As far as I can tell, you can't. You can only have -D defines inside,
and that's a big pain in the ass.
If there IS a way, I'd love to hear it.
xoox,
Andy
--
'Andy Lester andy@petdance.com
Programmer/author petdance.com
Daddy parsley.org/quinn Jk'=~/.+/s;print((split//,$&)
[unpack'C*',"n2]3%+>\"34.'%&.'^%4+!o.'"])
Re: Environment vars in httpd.conf
Posted by Jon Robison <jr...@uniphied.com>.
At the point in httpd.conf where it sets the hostname,
<Perl>
$ServerName = `hostname`;
</Perl>
Worked like a charm.
--Jon R.
P.S. Many thanks to Darren Chamberlain for this answer
Andy Lester wrote:
>
> > I can't recall how to use environment vars inside an httpd.conf file. I
> > need to have the ServerName value set to $HOSTNAME (the httpd.conf is
> > shared by multiple machines via CVS, so this value is different on each
> > developers machine).
>
> As far as I can tell, you can't. You can only have -D defines inside,
> and that's a big pain in the ass.
>
> If there IS a way, I'd love to hear it.
>
> xoox,
> Andy
>
> --
> 'Andy Lester andy@petdance.com
> Programmer/author petdance.com
> Daddy parsley.org/quinn Jk'=~/.+/s;print((split//,$&)
> [unpack'C*',"n2]3%+>\"34.'%&.'^%4+!o.'"])
Re: Environment vars in httpd.conf
Posted by si...@siberian.org.
The way we handle this is a 'configapache' script that
each developer can run. Basically it sets the vars in the
ENV and then runs a template ( . httpd.conf ) that parses
the vars into itself and then outputs to disk in the
proper location.
Works well and we keep the defaults in a .apachedefs file
we create when the shell script runs so whenever this
shell script is executed the user just hits enter a bunch
of times and then HUPS their local apache.
Works well for us and allows us to keep all of our configs
in CVS as well.
John-
On Mon, 17 Jun 2002 12:00:35 -0500
Andy Lester <an...@petdance.com> wrote:
>> I can't recall how to use environment vars inside an
>>httpd.conf file. I
>> need to have the ServerName value set to $HOSTNAME (the
>>httpd.conf is
>> shared by multiple machines via CVS, so this value is
>>different on each
>> developers machine).
>
>As far as I can tell, you can't. You can only have -D
>defines inside,
>and that's a big pain in the ass.
>
>If there IS a way, I'd love to hear it.
>
>xoox,
>Andy
>
>--
>'Andy Lester andy@petdance.com
> Programmer/author petdance.com
> Daddy parsley.org/quinn
> Jk'=~/.+/s;print((split//,$&)
> [unpack'C*',"n2]3%+>\"34.'%&.'^%4+!o.'"])