Milí majitelé routerů Turris,
toto fórum bylo 9. 12. 2016 zmrazeno a nahrazeno naším novým Turris fórem. Ještě chvíli bude dostupné k prohlížení, ale již zde není možné přispívat. Více informací naleznete v oznámení o uzavření fóra.
Dear Turris routers users,
this forum has been frozen on Dec 9th, 2016 and replaced by our new Turris forum. It will be read-only accessible for some time after. For more information, read the announcement about closing the forum.
#### CGI module
#cgi.assign = ( ".pl" => "/usr/bin/perl", ".cgi" => "/usr/bin/perl" )
cgi.assign = ( ".lua" => "/usr/bin/lua", ".cgi" => "/usr/bin/lua" )
root@turris:/etc/lighttpd/conf.d# cat test.conf
# lighttpd include file for lua tests
## Set CGI paths
cgi.assign += (
".lua" => "/usr/bin/lua"
)
## Set aliases to LuCI install directory
#alias.url += (
# "/cgi-bin/" => "/www/cgi-bin/"
#)
root@turris:/etc/lighttpd/conf.d# /etc/init.d/lighttpd restart
Syntax OK
/usr/lib/lighttpd/mod_alias.so
/usr/lib/lighttpd/mod_cgi.so
root@turris:/www/cgi-bin# cat test.lua
#!/usr/bin/lua
print("Test print")
root@turris:/www/cgi-bin# ls -l
-rwxr-xr-x 1 root root 135 Nov 10 17:01 luci
-rwxr-xr-x 1 root root 36 Nov 8 12:29 test.lua
root@turris:/etc/lighttpd# cat lighttpd.conf
server.modules = (
)
server.document-root = "/www"
server.upload-dirs = ( "/tmp" )
server.errorlog = "/var/log/lighttpd/error.log"
server.pid-file = "/var/run/lighttpd.pid"
#server.username = "http"
#server.groupname = "www-data"
index-file.names = ( "index.php", "index.html",
"index.htm", "default.htm",
"index.lighttpd.html" )
static-file.exclude-extensions = ( ".php", ".pl", ".fcgi", ".lua" )
### Options that are useful but not always necessary:
#server.chroot = "/"
#server.port = 81
#server.bind = "localhost"
#server.tag = "lighttpd"
#server.errorlog-use-syslog = "enable"
#server.network-backend = "write"
# listen on IPv6
$SERVER["socket"] == "[::]:80" { }
### Use IPv6 if available
#include_shell "/usr/share/lighttpd/use-ipv6.pl"
#dir-listing.encoding = "utf-8"
#server.dir-listing = "enable"
include "/etc/lighttpd/mime.conf"
include_shell "cat /etc/lighttpd/modules.d/*.load"
include_shell "cat /etc/lighttpd/conf.d/*.conf"
root@turris:/etc/lighttpd/conf.d# cat luci.conf
# lighttpd include file for LuCI
## Set CGI paths
cgi.assign += (
"/cgi-bin/luci" => ""
)
## Set aliases to LuCI install directory
alias.url += (
"/cgi-bin/" => "/www/cgi-bin/",
"/luci-static/" => "/www/luci-static/"
)
root@turris:/etc/lighttpd/conf.d# cat foris.conf
# lighttpd include file for Foris - it just calls the script
# that generates lighttpd config from UCI settings
include_shell "sh /usr/share/foris/lighttpd-dynamic-conf"
root@turris:/etc/lighttpd/modules.d# cat 30-cgi.load
server.modules += ( "mod_cgi" )
root@turris:/tmp/log/lighttpd# cat error.log
2015-11-27 12:55:55: (server.c.1567) server stopped by UID = 0 PID = 9764
2015-11-27 12:55:55: (log.c.194) server started
2015-11-27 12:57:21: (server.c.1567) server stopped by UID = 0 PID = 10154
2015-11-27 12:57:21: (log.c.194) server started
2015-11-27 13:03:01: (server.c.1567) server stopped by UID = 0 PID = 11705
2015-11-27 13:03:02: (log.c.194) server started
2015-11-27 13:16:54: (server.c.1567) server stopped by UID = 0 PID = 16151
2015-11-27 13:16:55: (log.c.194) server started
2015-11-27 13:18:11: (server.c.1567) server stopped by UID = 0 PID = 16618
2015-11-27 13:18:12: (log.c.194) server started
2015-11-27 13:24:51: (server.c.1567) server stopped by UID = 0 PID = 4523
2015-11-27 13:24:51: (log.c.194) server started
Powered by mwForum 2.29.3 © 1999-2013 Markus Wichitill