1. 修改uhttpd端口
#vi /etc/config/uhttpd
list listen_http 0.0.0.0:80 --> list listen_http 0.0.0.0:8081
保存,重启uhttpd
#/etc/init.d/uhttpd restart
2. 安装lighttpd及cgi模块
root@OpenWrt:/xutest# opkg update
Downloading
Updated list of available packages in /var/opkg-lists/snapshots
root@OpenWrt:/xutest# opkg install lighttpd
Installing lighttpd (1.4.30-2) to root...
Downloading
Installing libopenssl (1.0.1e-1) to root...
Downloading
Installing zlib (1.2.7-1) to root...
Downloading
Installing libpcre (8.11-2) to root...
Downloading
Installing libpthread (0.9.33.2-1) to root...
Downloading
Configuring libpthread.
Configuring libpcre.
Configuring zlib.
Configuring libopenssl.
Configuring lighttpd.
root@OpenWrt:/xutest# opkg install lighttpd-mod-cgi
Installing lighttpd-mod-cgi (1.4.30-2) to root...
Downloading
Configuring lighttpd-mod-cgi
3. 配置 lighttpd
#vi /etc/lighttpd/lighttpd.conf
#server.modules = (
# "mod_rewrite",
# "mod_redirect",
# "mod_alias",
# "mod_auth",
# "mod_status",
# "mod_setenv",
# "mod_fastcgi",
# "mod_proxy",
# "mod_simple_vhost",
# "mod_cgi",
# "mod_ssi",
# "mod_usertrack",
# "mod_expire",
# "mod_webdav"
#)
红色#号删除
#### CGI module
#cgi.assign = ( ".pl" => "/usr/bin/perl", ".cgi" => "/usr/bin/perl" )
cgi.assign = ("cgi-bin/luci" => "")
#添加红色部分
4. 重启lighttpd并加入自启动
root@OpenWrt:/tmp# /etc/init.d/lighttpd restart
root@OpenWrt:/tmp# 2011-09-08 17:39:01: (log.c.166) server started
root@OpenWrt:/tmp# /etc/init.d/lighttpd enable
6. 此时浏览器端输入如下都可以看到界面了
192.168.1.1
192.168.1.1:8081
7. 64M内存下, 执行top命令, lighttpd大约占用VSZ为6%, 而原先的uhttpd占用为2%
Mem: 24636K used, 37176K free, 0K shrd, 1996K buff, 9468K cached
CPU: 8% usr 5% sys 0% nic 86% idle 0% io 0% irq 0% sirq
Load average: 0.71 0.26 0.16 2/49 18109
PID PPID USER STAT VSZ %VSZ %CPU COMMAND
573 1 root S 876 1% 0% /sbin/ubusd
17398 1 root S 3684 6% 0% /usr/sbin/lighttpd -f /etc/lighttpd/l
865 1 root S 1580 3% 0% hostapd -P /var/run/wifi-phy0.pid -B
17631 13714 root R 1508 2% 0% top
13703 999 root S 1216 2% 0% /usr/sbin/dropbear -P /var/run/dropbe
18107 17398 root R 2920 5% 0% /usr/bin/lua /www/cgi-bin/luci.lua
979 1 root S 1520 2% 0% /usr/sbin/crond -c /etc/crontabs -l 5
554 1 root S 1516 2% 0% /sbin/syslogd -C16
664 583 root S 1516 2% 0% udhcpc -p /var/run/udhcpc-eth0.pid -s
1 0 root S 1512 2% 0% init
13714 13703 root S 1512 2% 0% -ash
424 1 root S 1512 2% 0% init
1159 1 root S 1508 2% 0% /usr/sbin/ntpd -n -p 0.openwrt.pool.n
680 1 root S 1508 2% 0% /sbin/watchdog -t 5 /dev/watchdog
16662 16651 root S 1504 2% 0% -ash
12805 12789 root S 1504 2% 0% -ash
556 1 root S 1496 2% 0% /sbin/klogd
583 1 root S 1476 2% 0% /sbin/netifd
16651 999 root S 1216 2% 0% /usr/sbin/dropbear -P /var/run/dropbe
C789 999 root S 1216 2% 0% /usr/sbin/dropbear -P /var/run/dropbe
阅读(4255) | 评论(0) | 转发(0) |