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

1) my nginx config like below:

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

2) I start fastcgi using:

spawn-fcgi -F 4 -U nginx -p 8000 -P /tmp/ -- /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

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

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:

RHCEr 1100110100011010001100011011101010

Best Regards

Alan Zheng