Hi, I'm on mac os x. I installed kepler using kepler-install-1.1.1-2 and I followed the getting-started on the kepler project's website "Configuring CGI on a mac", but I kept getting an error called "Resource /cgi-bin/cgilua.cgi/htdocs/test.lp not found!", which shows the cgilua.cgi was run correctly but it failed because it couldn't find the test.lp I copied, as per instructions on the getting-started guide.

I started looking through common.lua in the kepler/rocks/wsapi/1.1-2/ lua/wsapi and found this function at line 228, after some testing, to have been the cause:

[[
local function not_compatible(wsapi_env, filename)
  local script_name = wsapi_env.SCRIPT_NAME
  if not filename:gsub("\\","/"):find(script_name, 1, true) then
    -- more IIS madness, down into the rabbit hole...
    local path_info = wsapi_env.PATH_INFO:gsub("/", "\\")
    wsapi_env.DOCUMENT_ROOT = filename:sub(1, #filename-#path_info)
    return true
  end
end
]]

typing error(path_info) in the function gives, after reloading http://localhost/cgi-bin/cgilua.cgi/htdocs/test.lp , ".../Eric/kepler/rocks//wsapi/1.1-2/lua/wsapi/common.lua:233: \htdocs \test.lp"

When I place
        "error(filename)"
just before the
        "wsapi_env.DOCUMENT_ROOT = filename:sub(1, #filename-#path_info)"
line, I get:
".../Eric/kepler/rocks//wsapi/1.1-2/lua/wsapi/common.lua:233: / Library/WebServer/CGI-Executables/cgilua.cgi"

and then, when I place
        "error(wsapi_env.DOCUMENT_ROOT)"
just after the
        "wsapi_env.DOCUMENT_ROOT = filename:sub(1, #filename-#path_info)"
line, I get:
".../Eric/kepler/rocks//wsapi/1.1-2/lua/wsapi/common.lua:234: / Library/WebServer/CGI-Executa"

Yet, my document's folder should actually be "/Library/WebServer/ Documents/, rather than "/Library/WebServer/CGI-Executables/", or "/ Library/WebServer/CGI-Executa", for that matter.

As soon as I commented out "wsapi_env.DOCUMENT_ROOT = filename:sub(1, #filename-#path_info)" in the function, http://localhost/cgi-bin/cgilua.cgi/htdocs/test.lp loaded correctly, and I could then run the tests on the page.

Is it okay for me to do that? or did I just break something?

_______________________________________________
Kepler-Project mailing list
Kepler-Project@lists.luaforge.net
http://lists.luaforge.net/cgi-bin/mailman/listinfo/kepler-project
http://www.keplerproject.org/

Reply via email to