因需要尝试在CentOS上使用花生壳服务器,因此找到了下面这个web,特转载如下.
一、安装说明(以CentOS 5为例)
1、安装必要的开发包
[root@localhost ~]# yum install gcc gcc-c++ autoconf automake
2、下载phddns-2.0.2.16556.tar.gz到某一个目录
[root@localhost ~]# wget http://download.oray.com/peanuthull/phddns-2.0.2.16556.tar.gz
3、解压所有文件
[root@localhost ~]# tar zxvf phddns-2.0.2.16556.tar.gz
4、进入目录并编译
[root@localhost ~]# cd phddns-2.0.2.16556
[root@localhost phddns-2.0.2.16556]# aclocal
[root@localhost phddns-2.0.2.16556]# autoconf
[root@localhost phddns-2.0.2.16556]# automake
[root@localhost phddns-2.0.2.16556]# ./configure
[root@localhost phddns-2.0.2.16556]# make
[root@localhost phddns-2.0.2.16556]# cd src
[root@localhost src]# ls -l phddns
-rwxr-xr-x 1 root root 80968 Aug 2 11:18 phddns
5、执行编译好的程序并配置(默认使用/etc/phlinux.conf,如果不存在这个文件则自动进入交互配置)
[root@localhost src]# ./phddns
输入服务器地址,如无特殊情况可使用默认值
Enter server address(press ENTER use phlinux3.oray.net):
输入您的Oray帐号名称
Enter your Oray account:
对应的Oray帐号密码
Password:
选择帮定的网卡,如无特殊,默认即可
Network interface(s):
eth0:192.168.141.18
lo:127.0.0.1
Choose one(default eth0):
选择日志保存到哪个文件
Log to use(default /var/log/phddns.log):
保存配置文件,选择yes则直接保存到/etc/phlinux.conf,输入other可以指定文件
Save to configuration file (/etc/phlinux.conf)?(yes/no/other):
接下来程序将已交互模式开始运行
192.168.141.18
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
8、退出花生壳
查看进程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
二、Linux花生壳本命令行参数说明
[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.
启动交互模式
--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 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文件,对登陆用户名及密码进行修改。
花生壳日志保存路径
/var/log/phddns.log
为什么花生壳无法登陆?
花生壳使用的通信端口是TCP:6060和UDP:6060(方向:OUT),请确认防火墙没有把这几个通信端口封掉。
如何查看花生壳当前运行状态?
查看日志:
[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
如何在其他平台(非X86)编译运行?
交叉编译mips cpu版本方法:
1、安装交叉工具并配置环境
........
2、配置参数
./configure --host=i386-linux --target=mipsel-linux --build=mipsel-linux CXX=mipsel-linux-gcc CC=mipsel-linux-gcc LD=mipsel-linux-ld
3、make
4、最后静态链接下
mipsel-linux-gcc -g -O2 -o phlinux -s main.o phupdate.o PHGlobal.o PHSocket.o md5.o log.o generate.o coder.o blowfish.o bitstream.o base64.o ConvertUTF.o CCmdParser.o PhClient.o PhUpdater.o /opt/openwrt/mipsel-linux/lib/librt.a /opt/openwrt/mipsel-linux/lib/libstdc++.a //opt/openwrt/mipsel-linux/lib/libc.a
5、压缩下(好放到路由器的小空间)
upx -o phlinux2 phlinux
相关推荐
安装和使用Linux花生壳(公网版).docx
linux安装花生壳.docx
linux安装花生壳的教程.pdf
花生壳也有Linux版本,确实是一个选择,但是它相当于是把你的ip publish到网上的,假设你自己对自己的安全不是很放心,而且你的目的也只是小范围使用的话,那么这个动态ip完全可以通过个人邮件的方式来传播,本文...
花生壳教程花生壳新手教程.pdf
使用花生壳+海康威视搭建远程视频监控服务整理.pdf
通过花生壳协助搭建邮件服务器.pdf
考察了pH值、温度、Cr(VI)初始浓度、改性花生壳投加量和吸附时间对铬离子吸附效果的影响。结果表明,最佳吸附条件为pH=1,温度为50℃,铬离子浓度为50 mg/L,吸附剂投加量为10 g/L,吸附时间为140 min.通过考察反应动力学...
花生壳教程.pdf
当您安装并注册花生壳动态域名解析软件,无论您在任何地点、任何时间、使用任何线路,均可利用这一服务建立拥有固定域名和最大自主权的互联网主机。“花生壳动态域名解析软件”支持的线路包括普通电话线、ISDN、ADSL...
花生壳连接服务器失败 新花生壳连接服务器失败怎么办.docx
以花生壳为原料,经Na OH化学改性,对改性前后的花生壳吸附性能进行对比,研究了吸附时间、吸附剂用量、吸附质浓度、废水pH值和温度等因素对改性花生壳吸附Pb2+的影响。研究结果表明:经Na OH改性后,花生壳的表面变得多...
真实解决案例,涉及力控7.0、新花生壳、宏电DTU,解决了通过内网IP搭建服务平台,同时宏电DTU借助于花生壳绑定的域名与服务平台相互交流数据。百分之百成功,无虚假!
实现类似花生壳内网穿透服务 server.exe 放到阿里云或者云平台等服务器上 ,打开端口 client.exe 放在应用软件同一个电脑或者同一个局域网内 该软件有两个配置信息 服务器:填写server.exe所在电脑的的ip:端口 应用...
内网虚拟机用花生壳建立WEB服务器.rar
花生壳搭建ftp服务器_怎么用花生壳搭建ftp服务器.docx
用花生壳搭建服务器【用花生壳如何搭建FTP服务器】.docx
用花生壳发布FTP和mail服务器-单网卡部署WEB+Mail+FTP+ISA服务器之五实用.pdf
花生壳搭建ftp服务器【花生壳如何搭建ftp服务器】.docx