You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Seth Stone <se...@gmail.com> on 2009/10/30 23:15:58 UTC

[users@httpd] IfModule behavior inside VirtualHost stanza

I'm running Apache 2.2.3-31 on RHEL 5.4 and am running into an issue
with using an <IfModule> block inside of a VirtualHost stanza. If my
VirtualHosts are defined in my main config file
(/etc/httpd/conf/httpd.conf) the IfModule test works fine.  However, I
prefer to store VirtualHost configuration in
/etc/httpd/conf.d/vhosts.conf - by simply moving the config from the
main file to the vhosts.conf file the behavior of the IfModule
changes.

Specifically I'm trying to test the presence of the jrun_module, like so:

LoadModule jrun_module /opt/jrun4/lib/wsconfig/1/mod_jrun22.so

<VirtualHost>
        :
        <IfModule mod_jrun22.c>
                # JRun Settings
                JRunConfig Verbose false
                JRunConfig Apialloc false
                JRunConfig Serverstore
/opt/jrun4/lib/wsconfig/2/jrunserver.store
                JRunConfig Bootstrap 127.0.0.1:51000
        </IfModule>
</VirtualHost>

When the VirtualHost definition above appears in the main config file
the IfModule test returns true.  If I leave the LoadModule in the main
config and move the VirtualHost definition to
/etc/httpd/conf.d/vhosts.conf the IfModule test fails for some reason.
 Testing a different module such as mod_alias succeeds as expected.

Any ideas?

Thanks,
Seth

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] IfModule behavior inside VirtualHost stanza

Posted by Seth Stone <se...@gmail.com>.
Well I'm basically carrying on a practice that was started by the JRun
web server connector tool that is using IfModule to prevent total
Apache startup failure if for some reason JRun/ColdFusion were to get
misconfigured or uninstalled.

In any case you were exactly right - the web server connector placed
the LoadModule directive for the jrun_module below the Include
directive for the conf.d/* directory.  Moving it higher in the config
allowed the IfModule test in my separate vhosts.conf file to succeed.

Thanks for the help.

Seth


On Fri, Oct 30, 2009 at 5:27 PM, Nick Kew <ni...@webthing.com> wrote:
> Seth Stone wrote:
>>
>> I'm running Apache 2.2.3-31 on RHEL 5.4 and am running into an issue
>> with using an <IfModule> block inside of a VirtualHost stanza. If my
>
> 1.  Why are you using <IfModule> ?  Unless you're constructing a
> distribution whose management tools rely on it, there's absolutely
> no reason to use it.
>
> 2.  What you describe may depend on lexical order.  Nothing more.
>
> --
> Nick Kew
>
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>  "   from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>
>

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] IfModule behavior inside VirtualHost stanza

Posted by Nick Kew <ni...@webthing.com>.
Seth Stone wrote:
> I'm running Apache 2.2.3-31 on RHEL 5.4 and am running into an issue
> with using an <IfModule> block inside of a VirtualHost stanza. If my

1.  Why are you using <IfModule> ?  Unless you're constructing a
distribution whose management tools rely on it, there's absolutely
no reason to use it.

2.  What you describe may depend on lexical order.  Nothing more.

-- 
Nick Kew

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org