參考:
http://www.szchehang.com/news/10602.html
我們登錄的路由器主界面就是通過這個軟件指定了80端口來訪問的。我們要添加自己額外的網站服務,那只需要重新定義一個端口即可。我定義了一個88端口作為網站端口。找到uhttpd的配置文件添加以下文字即可
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、配置文件修改
在配置文件中增加:
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文件
<?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
/etc/init.d/uhttpd restart