Project

General

Profile

[UE] mod_magent - undefined symbol: lua_gettop

Added by vlrk about 1 month ago

Hi All,

I am trying to use lighttpd with lua CGI working.

My enviroment is as below.

Centos 7
lighttpd-1.4.66
lua 5.4.4 

export LUA_CFLAGS=-I/usr/local/include
export LUA_LIBS=-L/usr/local/lib
./configure --without-pcre2 --with-lua=5.4

my lighttpd.conf is as below

#cat /home/labuser/nginx/lighttpd.conf
server.document-root = "/usr/local/nginx/html" 

server.port = 3000

server.modules = (
        "mod_magnet" 
)

mimetype.assign = (
  ".html" => "text/html",
  ".txt" => "text/plain",
  ".jpg" => "image/jpeg",
  ".png" => "image/png" 
)

Now when I try to verify config , it shows error as below

# /home/labuser/nginx/lighttpd-1.4.66/src/lighttpd -tt -f /home/labuser/nginx/lighttpd.conf
2022-08-25 01:29:54: (plugin.c.202) dlopen() failed for: /usr/local/lib/mod_magnet.so /usr/local/lib/mod_magnet.so: undefined symbol: lua_gettop
2022-08-25 01:29:54: (server.c.1285) loading plugins finally failed

Any help / direction to overcome will be very helpfull.

Thanks


Replies (5)

RE: mod_magent - undefined symbol: lua_gettop - Added by stbuehler about 1 month ago

I think our build system only tests lua5.3, so I recommend using that for now. I also assume you should have seen some warnings about this in the build logs.

RE: mod_magent - undefined symbol: lua_gettop - Added by vlrk about 1 month ago

thanks stbuehler,

I am beginner with lighttpd and lua , trying to get some basic lua page working.

I am trying get lua working with mod_magnet and fastcgi binary magnet.

I tried two magent.c varient one from jan.kneschke.de/downloads/lua/ and other from

https://github.com/blitmap/lua-magnet/

Both results with 500 internal error

my lighttpd.conf looks as below.

var.log_root    = "/var/log/lighttpd" 
var.server_root = "/var/www" 
var.state_dir   = "/var/run" 
var.home_dir    = "/var/lib/lighttpd" 
var.conf_dir    = "/etc/lighttpd" 

server.pid-file = state_dir + "/lighttpd.pid" 
server.errorlog = log_root + "/error.log" 

server.document-root = "/usr/local/nginx/html" 

debug.log-file-not-found = "enable" 
debug.log-request-header = "enable" 
debug.log-request-handling = "enable" 
debug.log-response-header = "enable" 
debug.log-condition-cache = "enable" 
debug.log-condition-handling = "enable" 
debug.log-request-header-on-error = "enable" 
debug.log-state-handling = "enable" 
debug.log-timing = "enable" 

server.port = 3000

fastcgi.debug = 1

server.modules = (
        "mod_indexfile",
        "mod_access",
        "mod_alias",
        "mod_redirect",
        "mod_magnet",
        "mod_auth",
        "mod_cgi",
        "mod_fastcgi",
        "mod_accesslog",
)

mimetype.assign = (
  ".html" => "text/html",
  ".lua" => "text/html",
  ".txt" => "text/plain",
  ".jpg" => "image/jpeg",
  ".png" => "image/png" 
)

fastcgi.server = (
        ".lua" => (
                ("socket" => "/tmp/lua-fcgi.socket",
                "bin-path" => "/usr/local/bin/magnet",
                "max-procs" => 8 )
        )
)

and my hello.lua file looks as below

print([[Status: 200
Content-Type: text/html
<html>
<head>
<title>
Congratulations!
</title>
</head>
<body>
Lua appears to work.
</body></html>]])

where as if I remove fastcgi.server section from conf , instead of running the print comamnd as lua script it display as plain text with all the file content in browser.

If any other simple way (rather than this) , where I can make simple lua script working with lighttpd also would be great.

any inputs/pointers would be highly appreciated.

Thanks

RE: mod_magent - undefined symbol: lua_gettop - Added by stbuehler about 1 month ago

vlrk wrote in RE: mod_magent - undefined symbol: lua_gettop:

I am trying get lua working with mod_magnet and fastcgi binary magnet.

Pick one or the other, not both. None of the following shows that you tried anything with mod_magnet, and what you do in your FastCGI backend is rather off topic here.

I tried two magent.c varient one from jan.kneschke.de/downloads/lua/ and other from

https://github.com/blitmap/lua-magnet/

The first is more a "proof-of-concept" and really old and the latter even says "dead". Why would you use these?...

and my hello.lua file looks as below

[...]

You really need a blank line between HTTP/CGI headers and the body.

And did you even take a look at the log files?

RE: mod_magent - undefined symbol: lua_gettop - Added by vlrk about 1 month ago

Thanks for reply,

I sticked with mod_magnet . Basic lua page is working fine.

    (1-5/5)