Cenos 下花生壳的安装与使用(已经通过测试)
ADSL 的 IP 经常会变来变去,有没有办法可以随意获得IP地址呢?那就是使用 花生壳.
?
在安装花生壳之前,得先做以下几个事情:
?
1.?访问? www.oray.com?,注册一个护照用户名:比如test,密码为123456
2. 登录用户?test,然后申请一个免费的域名,比如? http://test.vicp.net
3. 开放一下 udp的 6060 端口
??? vi /etc/sysconfig/system-config-securitylevel
???
????在最后加入: --port=6060:udp
??
??? 然后执行一下: system-config-network-tui
?
??? 再重启一下iptables : service iptables restart 就可以了。
?
?
?
?
?
然后安装:
?
phlinux 软件,软件在附件中
?
使用 tar -zxvf phlinux10all.tar.gz
?
然后进入 phlinux10all/phlinux_package 可以看到有很多的版本,Centos 用的是 redhat 的版本的
?
phlinux-1.0-install.fc5.tar.gz????????? phlinux-1.0-install.redhat.tar.gz
phlinux-1.0-install.freebsd.4.1.tar.gz? phlinux-1.0-install.suse9.0.tar.gz
phlinux-1.0-install.freebsd.5.4.tar.gz? phlinux-1.1-install.ubuntu.8.04.tar.gz
phlinux-1.0-install.freebsd.6.0.tar.gz?
?
然后我们再解压?,redhat 的版本就可以了
?
tar -zxvf phlinux-1.0-install.redhat.tar.gz
?
得到一个文件夹 phlinux_install
?
进入 phlinux_install 看到如下文件:
?
install.sh? phlinux? phlinux.conf? webadmin
然后执行 ./install.sh 进行安装,很有可能会出现:
?
安装时可能提示错误: “ error while loading shared libraries: libstdc++.so.5”
解决方法:yum install libstdc++.so.5
?
然后继续安装
?
执行安装脚本后,将自动以互动配置模式的phlinux程序
?
Runing phlinux for first configuration...
Peanuthull Linux-core 1.0 by oray.net, copyright 2005
No user configuration found, entering interactive mode automatically!
Peanuthull Linux-core Interactive startup.
Please input service address(press ENTER use phservice2.oray.net):? 按默认的就可以了。
输入花生壳服务器地址,直接回车
Please input server address(press ENTER use PH031.Oray.Net):??? 按默认的就可以了。
?
此处提示输入您的花生护照登陆名
Please input username(press ENTER use ):?? 之前申请的 test
此处提供输入花生护照登陆密码?
Please input password:?????????????????? 之前申请的 123456
系统提示是否保存配置文件,在这里输入yes回车.
Save to configuration file (/etc/phlinux.conf)?(yes/no):
?
开始连接:
?
2011/08/04 16:27:56.323| RESULT_NODE: ClientIP, 202.105.77.219, PID: 2
2011/08/04 16:27:56.323| RESULT_NODE: PHServer, PhLinux3.Oray.Net, PID: 2
2011/08/04 16:27:56.323| RESULT_NODE: ADPageUrl, Http://www.oray.cn/, PID: 2
2011/08/04 16:27:56.323| RESULT_NODE: PeanutBaPageUrl, Http://www.oray.cn/, PID:???????????????????????????????????????????????????????????????????????????????????????? 2
2011/08/04 16:27:56.323| RESULT_NODE: NoticePageUrl, Http://www.oray.cn/, PID: 2
2011/08/04 16:27:56.323| RESULT_NODE: UserType, 0, PID: 2
2011/08/04 16:27:56.323| RESULT_NODE: EnableCnChildAdd, 0, PID: 2
2011/08/04 16:27:56.323| RESULT_NODE: CnAddChildPrompt, 由于域名管理机构的原因,??????????????????????????????????????????????????????????????????????????????????????? 中文子域名还不能支持域名解析, PID: 2
2011/08/04 16:27:56.323| RESULT_NODE: DomainQueryUrl, http://goto.oray.net/domai??????????????????????????????????????????????????????????????????????????????????????? n/ph31.php, PID: 2
2011/08/04 16:27:56.323| RESULT_NODE: WebServiceVersion, 3.0.0, PID: 2
2011/08/04 16:27:56.323| ExecuteUpdate Connecting PhLinux3.Oray.Net.
2011/08/04 16:27:56.582| SEND AUTH REQUEST COMMAND...2011/08/04 16:27:56.582| OK??????????????????????????????????????????????????????????????????????????????????????? .
2011/08/04 16:27:56.614| SERVER SIDE KEY "334 ymlN28PCU1c6TlS6X67TEQ==" RECEIVED??????????????????????????????????????????????????????????????????????????????????????? .
2011/08/04 16:27:56.614| SEND AUTH DATA...2011/08/04 16:27:56.614| OK
2011/08/04 16:27:56.757| ExecuteUpdate domain "test.gicp.net"
2011/08/04 16:27:56.757| ExecuteUpdate domain "test.vicp.net"
2011/08/04 16:27:56.757| ExecuteUpdate domain "."
2011/08/04 16:27:56.757| SEND CNFM DATA...2011/08/04 16:27:56.757| OK
2011/08/04 16:27:56.789| ExecuteUpdate 250 Register successfully
2011/08/04 16:27:56.858| ExecuteUpdate 250 Register successfully
2011/08/04 16:27:56.858| 250 6423463 133728492
2011/08/04 16:27:56.858| ExecuteUpdate nChatID:6423463, nStartID:133728492
2011/08/04 16:27:56.858| SEND QUIT COMMAND...2011/08/04 16:27:56.858| OK.
2011/08/04 16:27:56.890| 221 Good bye
2011/08/04 16:27:56.890| ExecuteUpdate OK, BeginKeepAlive!
?
?
如果出现 ExecuteUpdate OK, BeginKeepAlive!
表示已经连接成功。
?
?
可以看到这里会有信息不停的更新,这是一种模式。
?
phlinux 有两种模式,种是前台模式,一种是 后台守护模式
?
可以执行? /usr/local/phlinux/phlinux -help 进行查看
?
如下信息:
[root@localhost phlinux]# /usr/local/phlinux/phlinux -help
Peanuthull Linux-core 1.0 by oray.net, copyright 2005
Peanuthull Linux-core Help
??????? --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.
??????? --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.
??????? --help
???????? -h, print this screen.
Please visit http://www.oray.net for detail.
如果不想以前台的模式运行,我们可以直接Ctrl + c 终止。
我们也可以使用 ps -aux | grep phlinux 查看pid,?
然后 kill -9 pid编号
?
然后执行? /usr/local/phlinux/phlinux -d 以后台守护的模式运行。
?
如果想以后开机自动启动也可以在:
/etc/rc.d/rc.local 文件中加入一行内容 /usr/local/phlinux/phlinux -d
?
然后在windows 运行打开 cmd 命令行,执行
?
nslookup test.vicp.net test
?
即是 nslookup 申请的域名 护照用户名
?
得到 IP 地址
?
?
?
?
?
?
?
?
?