On Wed, Jul 14, 2010 at 12:52 PM, Thijs Koerselman
<thijskoersel...@gmail.com> wrote:
> Hi all,
>
> I'm trying to get wsapi to work on OSX with Apache.  I have a problem
> that seems to be related to environment variables.
>
> All lua modules are installed with LuaRocks on a user basis, so my
> scripts and executables are located in ~/.luarocks/bin. This path is
> added to my users $PATH.
>
> I have my httpd.conf configured so that Apache uses me as the process
> owner. When I run printenv however Apache reports:
> PATH="/usr/bin:/bin:/usr/sbin:/sbin"
>
> Therefor if I try to execute hello.lua in my document root I get the
> following error:
>
> [Wed Jul 14 13:41:31 2010] [error] [client ::1] env: wsapi.cgi: No
> such file or directory
> [Wed Jul 14 13:41:31 2010] [error] [client ::1] Premature end of
> script headers: hello.lua

This seems to indicate to me that whatever launcher script you are
using has #! /usr/bin/env wsapi.cgi and is unable to find the
wsapi.cgi script to execute hello.lua. Your web server environment is
going to have a different environment and won't have access to your
wsapi.cgi script unless you tell it where it is.

> Next I edited hello.lua to point to the absolute path of the wsapi.cgi
> in my luarocks bin folder. The file is found, but there seems to be a
> problem with the lua paths:
>
> [Wed Jul 14 12:34:57 2010] [error] [client ::1] /usr/local/bin/lua:
> /usr/local/share/lua/5.1/luarocks/require.lua:250: module
> 'wsapi.common' not found:
>
> If I execute wsapi.cgi with hello.lua directly from the commandline it works 
> ok:
>
> $ wsapi.cgi ~/Sites/luatesting/hello.lua
> Status: 200 OK
> Content-type: text/html
>
> <html><body><p>Hello Wsapi!</p><p>PATH_INFO: /</p><p>SCRIPT_NAME:
> </p></body></html>
>
>
> If I check the lua path variables in wsapi.cgi they seem to be the
> same as my user environment variables:
>
> LUA_PATH="/usr/local/share/lua/5.1/?.lua;/usr/local/etc/luarocks/?.lua;/Users/thijskoerselman/Documents/Projects/IM3I/svn/bintje/audiomodule/luamodules/?.lua;;$LUA_PATH"
> LUA_CPATH="./?.so;/usr/local/lib/lua/5.1/?.so;/usr/local/lib/lua/5.1/loadall.so;$LUA_CPATH"
> export LUA_PATH LUA_CPATH
> exec "/usr/local/bin/lua" -lluarocks.require
> "/Users/thijskoerselman/.luarocks//rocks/wsapi/1.3.4-1/bin/wsapi.cgi"
> "$@"
>
>
> I have no idea what the problem is here. How can I make Apache work
> with my LuaRocks modules?
>
> Cheers,
> Thijs
>
> _______________________________________________
> Kepler-Project mailing list
> Kepler-Project@lists.luaforge.net
> http://lists.luaforge.net/cgi-bin/mailman/listinfo/kepler-project
> http://www.keplerproject.org/
>

_______________________________________________
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