luci/libs/sgi-luci/root/usr/bin/luci-httpd
Steven Barth 00aceaf624 * libs/web: Switched from HTTP-Basic-Auth to Session-Auth
* Updated Makefiles for better testing environment integration
* Fixed libs/sgi-luci
2008-06-28 16:03:54 +00:00

31 lines
772 B
Lua
Executable file

#!/usr/bin/lua
require("luci.httpd")
require("luci.httpd.server")
require("luci.httpd.handler.file")
require("luci.httpd.handler.luci")
DOCROOT = "/www"
PORT = 8080
collectgarbage("setpause", 150)
serversocket = luci.httpd.Socket("0.0.0.0", PORT)
server = luci.httpd.server.Server()
vhost = luci.httpd.server.VHost()
server:set_default_vhost(vhost)
filehandler = luci.httpd.handler.file.Simple(DOCROOT)
vhost:set_default_handler(filehandler)
lucihandler = luci.httpd.handler.luci.Luci()
vhost:set_handler("/luci", lucihandler)
io.stderr:write("Starting LuCI HTTPD on port " .. PORT .. "...\n")
io.stderr:write("Point your browser to http://localhost:" .. PORT .. "/luci\n")
luci.httpd.register(serversocket, server:create_daemon_handlers())
luci.httpd.run()