httplua is the Lua CGI handler for the httpd web server on classic MVS 3.8j. It embeds the lua370 Lua 5.4 engine and runs Lua scripts from the UFS in response to HTTP requests — so you can write dynamic web endpoints in Lua on a Hercules-emulated MVS system.
It was extracted from httpd (mvslovers/httpd#61) into a standalone project and builds a single load module, HTTPLUA.
- Lua 5.4 scripting for HTTP requests (via the embedded lua370 engine)
- Scripts served from the UFS (ufsd), addressed by path
- EBCDIC-aware — Lua source and output are EBCDIC; httpd handles the wire codepage
httplua uses mbt 3 — a host build with the
cc370 toolchain. MVS is only touched by mbt deploy.
- The cc370 host toolchain (it also provides the libc370 sysroot)
- mbt 3 on your
PATH(mbt doctorchecks the toolchain too) - An MVS 3.8j system reachable over IP (for
mbt deploy), set up once per machine as an mbt target (mbt target import .env --name <name>, see mbt'sdocs/MIGRATION.md)
git clone https://github.com/mvslovers/httplua.git
cd httplua
mbt deps # stage lua370, httpd, ufsd
mbt build # build/HTTPLUA (on the host)
mbt deploy # -> HTTPLUA.DEV.LINKLIBDependencies (mbt.toml): lua370 (the Lua engine, statically linked),
httpd (CGI interface), ufsd (UFS access). libc370 is the cc370 sysroot.
- Copy the
HTTPLUAmember from the deploy LINKLIB into httpd's load library (e.g.HTTPD.LINKLIBT). - Configure routing + the script root in the httpd parmlib member (
DD:HTTPPRM):UFS=1 DOCROOT=/www MOD=HTTPLUA *.lua - Restart httpd (it loads
MOD=modules at startup).
A script at UFS /www/hello.lua:
print("Hello, World!")is then reachable at http://host:port/hello.lua.
Built on httpd and the lua370 Lua port (originally by Michael Dean Rayborn) for the MVS 3.8j community. Lua is by Roberto Ierusalimschy, Waldemar Celes, and Luiz Henrique de Figueiredo (PUC-Rio).