I’ve working on getting Lucee up and running to match our ACF configuration and I’m having issues with the CGI.SERVER_ADDR and CGI.LOCAL_ADDR variables.
In ACF, this returns the address of the Apache host serving the site. However, in Lucee this is returning 127.0.0.1 for CGI.LOCAL_ADDR and an empty string for CGI.SERVER_ADDR.
I’m using Lucee 184.108.40.206 w/Apache 2.4 mod_cfml and mod_jk.
In my Apache configuration, I have:
SetEnvIfNoCase SERVER_ADDR "(.*)" LOCAL_ADDR=$1 <IfModule jk_module> JkEnvVar SERVER_ADDR JkEnvVar LOCAL_ADDR </IfModule>
This works properly in ACF.
If I use getPageContext().getRequest().getAttribute(“SERVER_ADDR”) or getPageContext().getRequest().getAttribute(“LOCAL_ADDR”) I get the value I expect.
From all I’ve read, it seems like mod_jk should be reporting to Tomcat the correct address so that InetAddress.getLocalHost() would return the Apache hostname (which is what the code in CgiImpl is using), but it doesn’t seem to be working.
What am I missing?