Skip to content

Instantly share code, notes, and snippets.

@lanceliao
Last active February 26, 2020 15:43
Show Gist options
  • Save lanceliao/5e94edf99e688e2bd157 to your computer and use it in GitHub Desktop.
Save lanceliao/5e94edf99e688e2bd157 to your computer and use it in GitHub Desktop.
Configure LUCI on lighttpd

###Install

opkg install lighttpd lighttpd-mod-cgi

###Configgure

修改/etc/lighttpd/lighttpd.conf

  1. static-file.exclude-extensions = (".php", ".pl", ".fcgi")改成static-file.exclude-extensions = (".php", ".pl", ".fcgi", ".lua")

  2. 配置文件最后加上服务器配置

$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"
)
  1. 使用lighttpd替换uhttpd
/etc/init.d/uhttpd stop
/etc/init.d/uhttpd disable
/etc/init.d/lighttpd enable
/etc/init.d/lighttpd start

###参考资料

  1. MapleZhou, openwrt下安装lighttpd/webdav模块及改变安装目录
  2. lighttpd, Module mod_dirlisting - Directory Listings
  3. OpenWrt WIKI, LuCI on lighttpd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment