| 
 1 
2 
3 
4 
 | 
config 'uhttpd' 'webfile'list 'listen_http' '0.0.0.0:88'option 'home' '/mnt/sda1/webfile'option 'cgi_prefix' '/cgi-bin' | 
上面的配置我将网站的主目录指定到了我一盘的第一分区中的webfile文件夹中
这时你需要重启uhttpd程序,那么你的网站服务器就算搭好了。你把你的网站放入webfile文件夹中。直接通过您的域名:88就可以访问了。这个有什么用处呢就看个人发挥啦。网站类型太多了,目前正在搞苹果程序开发,也没时间去捣鼓网站的事情。网站既然搭好了也不能不用吧。直接丢了几首歌曲在里面。
如果直接丢一个网页进去,效果图如下:

具体步骤:
1、配置文件修改
在配置文件中增加:
| 
 1 
2 
3 
4 
 | 
config uhttpd 'webfile'list listen_http '0.0.0.0:88'option home '/root/sda1/webfile'option cgi_prefix '/cgi-bin' | 
2、添加设计好的网页
包括htm文件和同名文件夹,可直接网上下载一个英文网页测试用。
3、添加index.html文件
| 
 1 
2 
3 
4 
5 
6 
7 
8 
9 
10 
 | 
<?xml version="1.0" encoding="utf-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="refresh" content="0; URL=/cgi-bin/luci" /></head><body style="background-color: black"><a style="color: white; text-decoration: none" href="/cgi-bin/luci">LuCI - Lua Configuration Interface</a></body></html> | 
其中,”/cgi-bin/luci”处填写自己要跳转到的网页。例如可以添加
/CCTV%20News%20-%20China,%20World,%20Biz,%20Video,%20Live%20events%20-%20English_CCTV_com.htm
文件包括

4、保存,重启uhttpd
| 
 1 
 | 
/etc/init.d/uhttpd restart | 
本文章由作者:佐须之男 整理编辑,原文地址: OpenWrt的web服务器 uhttpd