On Tue, Feb 18, 2014 at 5:55 AM, Adrian Lester <a...@ajltech.co.uk> wrote:
> Please accept my apologies for popping up on the list with an immediate
> question, and even more so if it turns out that I am being stupid, but
> this one really does have me confused. I have read the manuals and
> searched and searched, but can't seem to find any reference to anyone else
> having the same problem, or any related bug reports.
>
> I am using Apache 2.4.7 (full details below).
>
> The machine has two network interfaces with separate IP addresses, and I
> want to use a conditional statement in the conf file of the default
> virtual host to handle traffic coming in via the two IP's differently
> using SERVER_ADDR to identify them. What I expected to be the complicated
> bit all works fine, but this construct:
>      <If "%{SERVER_ADDR} == '<ip address of 2nd interface>'">
>            .......
>      </If>
>      <Else>
>            .......
>      </Else>
> results in this:
>
> root@mymachine:apache2# ./bin/apachectl restart
> AH00526: Syntax error on line 118 of
> /usr/local/apache2/conf/extra/configfile.conf:
> Cannot parse condition clause: Variable 'SERVER_ADDR' does not exist
> root@mymachine:apache2#

That syntax is not for environment variables.  See the real variables
and the "reqenv" function:

http://httpd.apache.org/docs/2.4/expr.html

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

Reply via email to