So I'm trying to emulate AND with SetEnvIf to block/allow httpd access based on country and city. This is my block in my httpd conf:
SetEnvIf RemoteHost "^" AllowEntry=0
SetEnvIf GEOIP_COUNTRY_CODE US AllowEntry=1
SetEnvIf GEOIP_REGION MA AllowEntry=AllowEntry+1
SetEnvIf AllowEntry 2 AllowEntry2
Order deny,allow
Deny from all
Allow from env=AllowEntry2
But it doesn't work, line 3 will assign the value "AllowEntry+1" to the variable AllowEntry instead of 2.
It doesn't need to be 2 as in the math operation, the string "1+1" would work as well.
Any ideas? Is it possible?
PS: would still like to know if it's possible but for now I solve my requirement with:
SetEnvIfExpr "%{ENV:GEOIP_COUNTRY_CODE} == 'US' && %{ENV:GEOIP_REGION} == 'MA'" AllowEntry