lua-users home
lua-l archive

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


Hi all:

I am try to install sputnik with nginx using fastcgi mode:

I following:  Option 2c: Just Unpack the Lua Code

http://sputnik.freewisdom.org/en/Custom_Installation

1) my nginx config like below:

location ~ ^(.+\.lua)(.*)$ {
              root /usr/share/nginx/html;
              fastcgi_pass   127.0.0.1:8000;
              fastcgi_index  sputnik.lua;
              fastcgi_split_path_info ^(.+\.lua)(.*)$;
              fastcgi_param PATH_INFO $fastcgi_path_info;
              fastcgi_param SCRIPT_FILENAME  $document_root$fastcgi_script_
name;
              include fastcgi_params;
        }

2) I start fastcgi using:

spawn-fcgi -F 4 -U nginx -p 8000 -P /tmp/wsapi-fcgi.pid -- /usr/lib/lua/wsapi/wsapi.fcgi

3) I copy all unpacked sputnik "lua" data to /usr/share/nginx/html, and rename sputnik.cgi to sputnik.lua
it's:

#! /usr/bin/lua
pcall(require, "luarocks.require")
require('sputnik.wsapi_app')
local my_app = sputnik.wsapi_app.new{
   VERSIUM_PARAMS = { '/usr/share/nginx/html/wiki-data/' },
   BASE_URL       = '/sputnik.lua',
   PASSWORD_SALT  = 'mekCbtB9JMwrktsyHQazLN5yJOTlgVMtZWV1gm0P',
   TOKEN_SALT     = 'Ym69Gpxe5xDGbz5KdOVjzyDpkogrB66pi3oPiLTd',
   SHOW_STACK_TRACE = true,
}

--require("wsapi.cgi")
--wsapi.cgi.run(my_app)
return my_app

when I put URL is http://localhost/sputnik.lua, I got below error:

Sputnik ran but failed due to an unexpected error.


Error details:
/usr/share/lua/5.1//coxpcall.lua:41: attempt to call upvalue 'f' (a nil value)
stack traceback:
/usr/share/lua/5.1//coxpcall.lua:41: in function </usr/share/lua/5.1//coxpcall.lua:41>

Can anyone give some suggestion for this error? Or it's a bug of sputnik?



--
Refer to: http://blog.microsuncn.com

RHCEr 1100110100011010001100011011101010

Best Regards

Alan Zheng