openwrt 中 附带的http Server是比较多的,uhttpd本身是不支持php功能的,如果要使用php功能可以选择lighttpd。
而选择lighttpd后对原来的luci支持不太好,这里对lighttpd配置做了一点修改,可以实现对luci的支持。
1. 配置编译openwrt:
make menuconfig
NetWork --->
Web Servers/Proxies--->
<*> lighttpd --->
<*> lighttpd-mod-cgi
Luci--->
Themes --->
<*> luci-theme-openwrt
Translations --->
<*> luci-i18n-english
<*> luci-i18n-chinese
<*> luci-i18n-german
make V=99 -j8
2. 修改lighttpd.conf
a. server.modules= ("mod_cgi", ...)
b. static-file.exclude-extensions= (".lua", ...)
c. cgi.assign = ( ".lua"=>"/usr/bin/lua",...)
3.
修改/www/index.html中URL=/cgi-bin/luci 为URL=/cgi-bin/luci.lua
4
. 将/www/cgi-bin/luci文件改名为/www/cgi-bin/luci.lua或使用链接,如下:
ln -s /www/cgi-bin/luci /www/cgi-bin/luci.lua