You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Darryl Philip Baker <da...@northwestern.edu> on 2016/05/31 19:32:23 UTC

[users@httpd] Rookie Question on Define and Testing the value

I'm trying to do some conditional configuration settings. I know that I can use "Define variable value" to set up a variable. I know that "<IfDefine [!}variable>" can be used to test to see if a variable is set or not. I looked at "<If expression>" as a possibility but since what I am setting are really configuration change and "If" is a runtime directive. Using "If" is going to add runtime overhead for something that will not change for the life of the daemon. Is there initialization directive to use to see if a variable set using "Define" matches a particular value and what is that directive if it exists?

If it matters this is RHEL7 and the supplied Apache 2.4.

Darryl Baker
Sr. System Administrator
Distributed Application Platform Services (DAPS)
Project Management Office and Enabling Technologies (PMOET)
Northwestern | Information Technology (Formerly NUIT)
1800 Sherman Ave., Suite 600
Evanston, IL  60201-3715
(847) 467-6674
www.it.northwestern.edu


RE: [users@httpd] Rookie Question on Define and Testing the value

Posted by Darryl Philip Baker <da...@northwestern.edu>.
Rick said:
      I currently specify the variables I want to check as flags from whatever logic I want external to the httpd binary, then test for the existence of the appropriate flag using IfDefine.  For example, I replaced apachectl with a custom version that can determine which datacenter I'm running in and adds the appropriate -D definitions to the httpd startup, etc.

I'm planning on doing a similar thing but using a file I will include that has the unique defines per host. I wanted to do some of the custom defines based on the data center of the host rather than creating more host unique variables. Ce la vie.


Darryl Baker
Sr. System Administrator
Distributed Application Platform Services (DAPS)
Project Management Office and Enabling Technologies (PMOET)
Northwestern | Information Technology (Formerly NUIT)
1800 Sherman Ave., Suite 600
Evanston, IL  60201-3715
(847) 467-6674
www.it.northwestern.edu
-----Original Message-----



> -----Original Message-----
> From: Eric Covener [mailto:covener@gmail.com]
> Sent: Tuesday, May 31, 2016 15:38
> To: users@httpd.apache.org<ma...@httpd.apache.org>
> Subject: Re: [users@httpd] Rookie Question on Define and Testing the
> value
>
> On Tue, May 31, 2016 at 3:32 PM, Darryl Philip Baker
> <da...@northwestern.edu>> wrote:
> > I’m trying to do some conditional configuration settings. I know
> > that I can use “Define variable value” to set up a variable. I know
> > that “<IfDefine [!}variable>” can be used to test to see if a
> > variable is set or not. I looked at “<If expression>” as a
> > possibility but since what I am setting are really configuration
> > change and “If” is a runtime directive. Using “If” is going to add
> > runtime overhead for something that will not change for the life of
> > the daemon. Is there initialization directive to use to see if a
> > variable set using “Define” matches a particular value and what is that directive if it exists?
>
> I don't think you can test against their values in something like
> <IfDefine -- you can only currently do a boolean <ifDefine> and inside
> get at the value with ${VAR}.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org<ma...@httpd.apache.org>
> For additional commands, e-mail: users-help@httpd.apache.org<ma...@httpd.apache.org>

B KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKCB  [  X  ܚX KK[XZ[ \ \  ][  X  ܚX P
 \X K ܙ B  ܈Y][ۘ[  [X[  K[XZ[ \ \  Z[
 \X K ܙ B


RE: [users@httpd] Rookie Question on Define and Testing the value

Posted by "Houser, Rick" <ri...@jackson.com>.
I currently specify the variables I want to check as flags from whatever logic I want external to the httpd binary, then test for the existence of the appropriate flag using IfDefine.  For example, I replaced apachectl with a custom version that can determine which datacenter I'm running in and adds the appropriate -D definitions to the httpd startup, etc. 


Rick Houser
Web Administration
(517)367-3516


> -----Original Message-----
> From: Eric Covener [mailto:covener@gmail.com]
> Sent: Tuesday, May 31, 2016 15:38
> To: users@httpd.apache.org
> Subject: Re: [users@httpd] Rookie Question on Define and Testing the value
> 
> On Tue, May 31, 2016 at 3:32 PM, Darryl Philip Baker
> <da...@northwestern.edu> wrote:
> > I’m trying to do some conditional configuration settings. I know that I can
> > use “Define variable value” to set up a variable. I know that “<IfDefine
> > [!}variable>” can be used to test to see if a variable is set or not. I
> > looked at “<If expression>” as a possibility but since what I am setting are
> > really configuration change and “If” is a runtime directive. Using “If” is
> > going to add runtime overhead for something that will not change for the
> > life of the daemon. Is there initialization directive to use to see if a
> > variable set using “Define” matches a particular value and what is that
> > directive if it exists?
> 
> I don't think you can test against their values in something like
> <IfDefine -- you can only currently do a boolean <ifDefine> and inside
> get at the value with ${VAR}.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Rookie Question on Define and Testing the value

Posted by Eric Covener <co...@gmail.com>.
On Tue, May 31, 2016 at 3:32 PM, Darryl Philip Baker
<da...@northwestern.edu> wrote:
> I’m trying to do some conditional configuration settings. I know that I can
> use “Define variable value” to set up a variable. I know that “<IfDefine
> [!}variable>” can be used to test to see if a variable is set or not. I
> looked at “<If expression>” as a possibility but since what I am setting are
> really configuration change and “If” is a runtime directive. Using “If” is
> going to add runtime overhead for something that will not change for the
> life of the daemon. Is there initialization directive to use to see if a
> variable set using “Define” matches a particular value and what is that
> directive if it exists?

I don't think you can test against their values in something like
<IfDefine -- you can only currently do a boolean <ifDefine> and inside
get at the value with ${VAR}.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org