You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Benjamin <be...@netyantra.com> on 2005/03/15 10:29:38 UTC

Re: [users@httpd] conditional listen???

Wot is the default directory into which this IfDefine directive will 
look for the said script.

I tried all combinations under /home/user/apache/ , 
/home/user/apache/conf, /home/user/apache/bin/ or the directory from 
where I call httpd.
the directive inside httpd.conf looks somethign like this:

<IfDefine IPAvailable>
Listen 12.34.56.89:80
</IfDefine>

Unless i specify the complete path in the IfDefine like :
<IfDefine /home/user/apache/IPavailable>
Listen 12.34.56.89:80
</IfDefine>

and also along with the -D option for httpd
ie. httpd -D /home/user/apache/IPavailable

it duz not seem to work.

Shud the script be under the ServerRoot , which is /home/user/apache/ for me.





Joshua Slive wrote:

>On Thu, 10 Mar 2005 15:21:46 +0530, Benjamin <be...@netyantra.com> wrote:
>  
>
>>Is there any way to tell apache to check the existence of the IP, if not
>>do something else.
>>    
>>
>
>Not that I know of.  I would simply write a simple script that checked
>if the IP was available and started apache with, for example
>"apachectl -D IPAvailable".  Then you can include in your config an
><IfDefine IPAvailable> section that will only be used in that case.
>
>Joshua.
>
>---------------------------------------------------------------------
>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
>
>  
>

-- 

Benjamin Jacob.

Disclaimer :
------------------------------------------------------------------------------
If you are not the intended recipient of this transmission to whom it is
addressed, or have received this transmission in error, you are hereby
notified that any dissemination, distribution or copying of this transmission
is strictly prohibited. Please notify us immediately and delete this e-mail
from your system. The sender does not accept liability for any errors or
omissions in the contents of this message which arise as a result of e-mail
transmission, which cannot be guaranteed to be secure or error-free as
information could be intercepted, corrupted, lost, destroyed, arrive late or
incomplete, arrive at wrong address or contain viruses. If verification
is required please request a hard-copy version.  This e-mail contains only the
personal opinions of the sender and does not represent an official
communication from NetYantra of any manner.
------------------------------------------------------------------------------


Re: [users@httpd] conditional listen???

Posted by Benjamin <be...@netyantra.com>.
oopps !!!
i sure was confused.

but somehow.. it did seem to work.. i wonder how.
If i specify the path of the script both in httpd.conf and with the -D 
option.. it did work.

Neway.. thanx again for the help.


Joshua Slive wrote:

>On Tue, 15 Mar 2005 14:59:38 +0530, Benjamin <be...@netyantra.com> wrote:
>  
>
>> Wot is the default directory into which this IfDefine directive will look
>>for the said script.
>> 
>> I tried all combinations under /home/user/apache/ , /home/user/apache/conf,
>>/home/user/apache/bin/ or the directory from where I call httpd.
>> the directive inside httpd.conf looks somethign like this:
>> <IfDefine IPAvailable> Listen 12.34.56.89:80 </IfDefine> Unless i specify
>>the complete path in the IfDefine like : <IfDefine
>>/home/user/apache/IPavailable> Listen 12.34.56.89:80 </IfDefine> and also
>>along with the -D option for httpd ie. httpd -D
>>/home/user/apache/IPavailable it duz not seem to work. Shud the script be
>>under the ServerRoot , which is /home/user/apache/ for me. 
>>    
>>
>
>I think you are a little confused.
>
>You need to write a script that checks to see whether the IP address
>is available.  Then at the end of this script, you start apache as
>follows (using pseudo-code):
>
>if the IP address is available
>  apachectl -D IPavailable
>else
>  apachectl
>end
>
>The <IfDefine IPavailable> block does not run a script.  It simply
>checks to see whether a particular variable (IPavailable) was passed
>on the command line when apache was started.  It is your
>responsibility to pass that variable conditional on the availability
>of the IP address.
>
>Joshua.
>
>---------------------------------------------------------------------
>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
>
>  
>

-- 

Benjamin Jacob.

Disclaimer :
------------------------------------------------------------------------------
If you are not the intended recipient of this transmission to whom it is
addressed, or have received this transmission in error, you are hereby
notified that any dissemination, distribution or copying of this transmission
is strictly prohibited. Please notify us immediately and delete this e-mail
from your system. The sender does not accept liability for any errors or
omissions in the contents of this message which arise as a result of e-mail
transmission, which cannot be guaranteed to be secure or error-free as
information could be intercepted, corrupted, lost, destroyed, arrive late or
incomplete, arrive at wrong address or contain viruses. If verification
is required please request a hard-copy version.  This e-mail contains only the
personal opinions of the sender and does not represent an official
communication from NetYantra of any manner.
------------------------------------------------------------------------------


Re: [users@httpd] conditional listen???

Posted by Joshua Slive <js...@gmail.com>.
On Tue, 15 Mar 2005 14:59:38 +0530, Benjamin <be...@netyantra.com> wrote:
>  Wot is the default directory into which this IfDefine directive will look
> for the said script.
>  
>  I tried all combinations under /home/user/apache/ , /home/user/apache/conf,
> /home/user/apache/bin/ or the directory from where I call httpd.
>  the directive inside httpd.conf looks somethign like this:
>  <IfDefine IPAvailable> Listen 12.34.56.89:80 </IfDefine> Unless i specify
> the complete path in the IfDefine like : <IfDefine
> /home/user/apache/IPavailable> Listen 12.34.56.89:80 </IfDefine> and also
> along with the -D option for httpd ie. httpd -D
> /home/user/apache/IPavailable it duz not seem to work. Shud the script be
> under the ServerRoot , which is /home/user/apache/ for me. 

I think you are a little confused.

You need to write a script that checks to see whether the IP address
is available.  Then at the end of this script, you start apache as
follows (using pseudo-code):

if the IP address is available
  apachectl -D IPavailable
else
  apachectl
end

The <IfDefine IPavailable> block does not run a script.  It simply
checks to see whether a particular variable (IPavailable) was passed
on the command line when apache was started.  It is your
responsibility to pass that variable conditional on the availability
of the IP address.

Joshua.

---------------------------------------------------------------------
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