Re: conditional configuration

Giganews Newsgroups
Subject: Re: conditional configuration
Posted by:  Jim (jim@nowhere.invalid)
Date: Mon, 26 Jul 2010

On Sun, 25 Jul 2010 11:51:38 -0400, in alt.apache.configuration, William
Gill <nospam@domain.invalid> wrote:

>Is there a simple way to have httpd.config skip or include directives
>based on some external condition.  Specifically, I have development
>servers on my network and on my notebook.  When I am working on
>something new I frequently have to copy things back and forth or to a
>flash drive.  To make keeping track easier I want to create a virtual
>host on a flash drive and have httpd.config test for the presence of the
>flash drive to determine whether or not to include the <VirtualHost>
>Directive.  Can this be done, and if so can it be done simply?

You can modify your apachectl to check whatever you want and add/remove
-D<name> from your command line to start apache.  Then you can use
<IfDefine <name>>
in your config files.  I've been doing this for years as I have configs
that have to work under various conditions.



In response to

conditional configuration posted by William Gill on Sun, 25 Jul 2010