###Install
opkg install lighttpd lighttpd-mod-cgi
###Configgure
修改/etc/lighttpd/lighttpd.conf
-
行
static-file.exclude-extensions = (".php", ".pl", ".fcgi")
改成static-file.exclude-extensions = (".php", ".pl", ".fcgi", ".lua")
-
配置文件最后加上服务器配置
$SERVER["socket"] == ":80" {
server.document-root = "/www/"
cgi.assign = ( "luci" => "/usr/bin/lua")
}
3.启用cgi(注意server前面的注释):
server.modules = (
# "mod_rewrite",
# "mod_redirect",
# "mod_alias",
# "mod_auth",
# "mod_status",
# "mad_fastcgi",
# "mod_proxy",
# "mod_simple_vhost",
"mod_cgi"
# "mod_ssi",
# "mod_usertrack",
# "mod_expire",
# "mod_webdav"
)
- 使用lighttpd替换uhttpd
/etc/init.d/uhttpd stop
/etc/init.d/uhttpd disable
/etc/init.d/lighttpd enable
/etc/init.d/lighttpd start
###参考资料
- MapleZhou, openwrt下安装lighttpd/webdav模块及改变安装目录
- lighttpd, Module mod_dirlisting - Directory Listings
- OpenWrt WIKI, LuCI on lighttpd