先安裝必要的工具
[root@hlblog ~]# yum install gcc gcc-c++ autoconf automake
這裡可能會出錯,報的錯是什麼you could try running:package-cleanup--problems,就是要清理包的意思,隻要打 yum clean all就可以了。
接下來解壓縮
[root@hlblog ~]# tar -zxvf phddns-2.0.5.19225.tar.gz
進入目錄進行編譯,下面的指令一個個的打,不要拼錯。
[root@hlblog ~]# cd phddns-2.0.5.19225
[root@hlblog phddns-2.0.5.19225]# aclocal
[root@hlblog phddns-2.0.5.19225]# autoconf
[root@hlblog phddns-2.0.5.19225]# automake
[root@hlblog phddns-2.0.5.19225]# ./configure
然後能看到一大堆的CHECKING.......YES啊什麼的。
到這個就說明沒有問題,最後一步,編譯它
[root@hlblog phddns-2.0.5.19225]# make
此時,花生殼已經編譯完成
[root@hlblog phddns-2.0.5.19225]# cd src
[root@hlblog src]# ./phddns
接下來配置花生殼
Enter server address(press ENTER use phlinux3.oray.net):<—直接回車
對應的Oray帳号密碼
Enter your Oray account:hlblog <—輸入帳号
回車 必需事先在ORAY網站中注冊護照和密碼,然後就那個寫在這裡
Password:<—輸入密碼 回車
Network interface(s):
[eth0] = [IP:192.168.1.103]
[lo] = [IP:127.0.0.1]
Choose one(default eth0):<—選擇網卡
回車
Log to use(default /var/log/phddns.log):<—日志檔案存放地點
/var/log/phddns.log
Save to configuration file (/etc/phlinux.conf)?(yes/no/other):yes:<—配置檔案存放地點
這樣花生殼就配置好了。
如果需要改使用者名和密碼,就到/etc/phlinux.conf下去改。
接下來程式将已互動模式開始運作
192.168.1.103
NIC bind success
OnStatusChanged okConnecting
OnStatusChanged okDomainListed
OnDomainRegistered skyvense22.gicp.net
OnStatusChanged okDomainsRegistered
UserType: 0
看到上面這些就表示登入成功,這個時候可以按ctrl+c先退出程式.如果出現認證失敗的英文,就說明你的使用者名和賬号沒有和官網上注冊的對上。
6、将phddns拷貝到你希望的位置
[root@localhost src]# cp phddns /usr/bin/
7、以背景模式啟動花生殼并檢查運作情況
[root@localhost ~]# /usr/bin/phddns -c /etc/phlinux.conf -d
phlinux started as daemon!
[root@localhost ~]# tail /var/log/phddns.log
2011/08/02 11:28:58.256| ExecuteUpdate OK, BeginKeepAlive!
2011/08/02 11:29:59.354| SendKeepAlive() 8208
2011/08/02 11:30:00.355| RecvKeepaliveResponse() Data comes, OPCODE:8272
2011/08/02 11:30:00.356| Keepalive response received, client ip: 116.231.123.96
2011/08/02 11:31:00.447| SendKeepAlive() 8208
2011/08/02 11:31:01.450| RecvKeepaliveResponse() Data comes, OPCODE:8272
2011/08/02 11:31:01.450| Keepalive response received, client ip: 116.231.123.96
花生殼給了你一個公網的位址
退出花生殼
檢視程序ID
[root@localhost ~]# ps -A | grep phddns
13731 ? 00:00:00 phlinux
讓背景程序退出
[root@localhost ~]# kill -9 13731
9、将花生殼加到系統啟動時運作
[root@localhost ~]# vi /etc/rc.local
在檔案的末尾加上一行:/usr/bin/phddns -c /etc/phlinux.conf -d
[root@localhost ~]# /usr/bin/phlinux -h
Peanuthull Linux-core 2.0 by oray.com, copyright 2011
Peanuthull Linux-core Help
--first-run
-f, run for the first time
用于首次啟動時配置參數
--interact
-i, run as interactive mode
program will request for necessary parameters.
this mode will automatically enabled at first running,
or your configuration file has been lost.
啟動互動模式
www.2cto.com
--daemon
-d, run as a daemon
program will quit after put itself to background,
and continue running even you logout,
you can use kill -9 <PID> to terminate.
背景模式
--config
-c, run with configuration file
program will run with the file
指定使用哪一個配置檔案
--user
-u, run as the user
program will run as the user
以指定使用者啟動背景程序
--help
-h, print this screen.
Please visit http://www.oray.com for detail.
三、常見問題
如何手動修改登陸的使用者名及密碼?
您可以直接編輯/etc/phlinux.conf檔案,對登陸使用者名及密碼進行修改。
花生殼日志儲存路徑
為什麼花生殼無法登陸?
花生殼使用的通信端口是TCP:6060和UDP:6060(方向:OUT),請确認防火牆沒有把這幾個通信端口封掉。
如何檢視花生殼目前運作狀态?
檢視日志: