You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by "Salim Abdul -X (salimabd - HCL TECHNOLOGIES LIMITED at Cisco)" <sa...@cisco.com> on 2019/11/03 17:24:22 UTC

[users@httpd] Apache 2.4.41 checking env variable error

Hi Apache experts,

We are in the process of upgrading apache for linux from 2.2 to 2.4.41.
We have a SSLRequire access control directive in the httpd configuration file as below
<Directory />
    Options FollowSymLinks
    AllowOverride None
    SSLRequire %{XYZ} == "SUCCESS" || %{REQUEST_URI} == "/xyz/register/register.rq"
</Directory>

The above works fine with 2.2. After upgrade to 2.4, getting error message "SSLRequire: Variable 'XYZ' does not exist"
As SSLRequire is deprecated in 2.4, I have replaced "SSLRequire" with "Require" as below.
<Directory />
    Options FollowSymLinks
    AllowOverride None
    Require env XYZ || (expr %{REQUEST_URI} == "/xyz/register/register.rq")
</Directory>

The above works. But the "env" allows to check the existence of environment variable, it does not support checking the value.
What is the syntax to check the value of environment variable in "Require".

Thanks in advance,

Regards,
Salim

Re: [users@httpd] Apache 2.4.41 checking env variable error

Posted by Antony Stone <An...@apache.open.source.it>.
On Sunday 03 November 2019 at 18:24:22, Salim Abdul -X wrote:

> We are in the process of upgrading apache for linux from 2.2 to 2.4.41.

> After upgrade to 2.4, getting error message "SSLRequire: Variable 'XYZ' does
> not exist" As SSLRequire is deprecated in
> 2.4, I have replaced "SSLRequire" with "Require"

> But the "env" allows to check the existence of environment variable, it does
> not support checking the value. What is the syntax to check the value of
> environment variable in "Require".

Try osenv('XYZ').

https://httpd.apache.org/docs/2.4/expr.html#functions


Antony.

-- 
There are 10 types of people in the world:
those who understand binary notation,
and those who don't.

                                                   Please reply to the list;
                                                         please *don't* CC me.

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