lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On Thu, Jul 22, 2010 at 3:21 PM, Florian Weimer <fw@deneb.enyo.de> wrote:

>> Thanks Florian, os.getenv seems to access OS environment variables but
>> not Apache environment variables set by other Apache modules. The
>> error message I got was:
>
> Are those also called environment variables?  Oh well.
>
> I think you need an APR/Apache binding for that, or mod_wombat.

Sadly, I think I made a horrible mistake pulling mod_wombat into httpd
core (as mod_lua), and need to unwind that some so it can be used by
folks today :-(

But, assuming you are using httpd 2.3 (unstable) series, you can
access the CGI variables through the subprocess_env table on the
request, so for a typical handler:

function handle(r)
  local remote_addy = r.subprocess_env["'REMOTE_ADDRESS"]
  -- do stuff
end

-Brian