WL500g 因為使用自由軟體開發, ASUS 也很夠意思的公佈了原始碼.
這位 OLEG 先生開發了新版本的韌體. 增加了一些功能. 其中一項就是拿來當 WEB SERVER 用. 有人甚至加了 PHP 的功能.
這位 ALPHA5 先生在試用成功之後, 做了以下的教學.
我也有一台 WL500g , 我試過一次, 沒有成功. 不過放心, 也沒有毀掉我的 WL-500g 就是了.
抛磚引玉, 簡單翻譯一下, 如有錯誤, 請多見諒,
如果有人成功, 請指導一下. 大家多多討論.
http://wl500g.info/showthread.php?t=1457
內容是翻自上面這個連結的教學
務必要記得要先更新 OLEG 修改過的韌體.
( 更新過就變成英文版了.. 要三思啊 )
okay, new year, new firmware, new howto
新年新韌體.
Since few days i´m using 1.9.2.7-2 from Oleg.
幾天前, 他說他開始用 OLEG 開發的 1.9.2.7-2 版本韌體.
Like in changelogs promised there are some changes in iptables since 1.6.x.x.
IPTABLES 有一些和 1.6.X.X 版本不同的改變,
These changes are effecting on my last howto about the wan webserver.
這會影響到上一次的教學. 所以. 現在再教一次.
So lets start:
開始.
At first you need "webspace" f.e. a usb memory stick, or an usb harddisk.
第一, 因為需要有網頁空間, 所以須要有隨身碟,或是外接硬碟 來當網頁的空間.
How to install this is explained in your asus manual.
依 ASUS 手冊裝上隨身碟 或 外接硬碟
If there are problems with it, use the search function of this forum!
如果有問題, 搜尋討論區
Optional you can use a service like "dyndns.org" to be aviable allways under the same hostname on internet. F.e. ernstl.dyndns.org. To update your ip on connect use the internal updating client. (see asus manual)
你也可以用動態 DNS 的服務, ( 就是浮動 IP 架站啦 ) ( 例如 DYNDNS.ORG )
If not done yet, connect to your aus device with a telnetclient of your choise, and login with username and password.
連上你的外接裝置. 用 TELNET 方法 連接你的裝置. 輸入你的 USERNAME PASSWORD登入.
( 我是直接在 DOS 畫面輸入 TELNET 192.168.0.1 就會要你輸入 USERNAME, PASSWORD , 輸入後就會看到類似 UNIX 的 TERMINAL 畫面了 )
So far... After installing the usb memory device will be mounted as /tmp/harddisk on your asus device.
裝上外接 USB 裝置後, 裝置會在 ASUS MOUNT 成 /TMP/HARDDISK
Now you should creat a seperated directory for your web files with this command:
應該要在外接裝置建一個子目錄來當網頁空間, 如果還沒有做的話., 用以下指令建立一個子目錄
Code:
mkdir /tmp/usbmount/web
If not allready exist,
create the post-boot and post-firewall scripts:
用下面指令建一個 POST-BOOT 和 POST-FIREWALL 的 SCRIPTS
Code:
touch /usr/local/sbin/post-firewall
touch /usr/local/sbin/post-boot
( TOUCH 指令應該是指要建這兩個檔吧 ? )
Now open the vi editor by typing
用 VI , 打這個指令, 編輯 POST-BOOT 這個檔
"vi /usr/local/sbin/post-boot".
In vi press "i" to enter a simple insert mode.
在 VI , 用 I 進入插入模式.
Type ore paste in the following lines,
輸入或是貼上下面幾行
to make busybox_httpd automaticly started, and mount usb device bevore:
來使 BUSYBOX_HTTPD 在開機就自動 MOUNT 你的 USB 外接裝置..
( BUSYBOX_HTTPD , 據我爬文的結果應該是 OLEG 先生新改的韌體一開機時自動執行的指令, )
Code:
mount /dev/discs/disc0/part1 /tmp/harddisk -t vfat
busybox_httpd -p 81 -h /tmp/harddisk/web
Press "ESC" to leave inser mode.
在 VI 按 ESC 結束插入模式
Now type ":wq!" followed by "return" to write changes and quit vi.
打 :WQ! 然後 RETURN , 用 VI 寫入檔案, 離開
( 這些是 vI 的操作, 主要就是加指令進入 POST-BOOt 這個檔案 ,)
Now open the post-firewall file with vi (vi /usr/local/sbin/post-firewall).
Press "i" and fill in the following line
一樣, 這次是加東西進入 POST-FIREWALL 這個檔案
打下面這些東西
Code:
iptables -D INPUT -j DROP
iptables -A INPUT -p tcp --dport 81 -j ACCEPT
iptables -A INPUT -p tcp --dport 80 -j ACCEPT
iptables -t nat -A PREROUTING -i ppp0 -p tcp --dport 80 -j DNAT --to-destination 192.168.1.1:81
iptables -A INPUT -j DROP
Then "ESC" and ":wq!". Files should now be saved.
(這也是 VI 的指令, 存檔離開的意思 )
To vertify the the files are filled with our informations "cat" the files with the command "cat [filename]".
可以用 CAT POST-FIREWALL 和 CAT POST-BOOT 來看有沒有加進去成功.
To store changes in flash enter the following commands in your shell:
用下面這些修改存到 FLASH 記憶體
Code:
flashfs enable
flashfs save
flashfs commit
Necesarry!!!
重要, 上面這些是必要的.
After reboot busybox_httpd should be startet automaticly on port 81,
重開機. BUSYBOX_HTTPD 會自動開在 PORT 81.
by the post-boot. Iptables makes it aviable on port 80 for wan site.
因為 POST-BOOT 的設定, IPTABLES 會讓 WAN 用 PORT 80 進入網頁空間.
To access the webserver from lan site, you need to connect on port 80. F.e.:
要進入你的WL500g 設定, 要用 PORT 81. ( 原文是說 80 , 我想是他筆誤 )
http://192.168.1.1:81
在 IE 進入管理畫面用的指令
If you have problems do not hesitate to message me or post in Q&A forum!
有問題到討論發問.