安装和使用花生壳(linux)

一、安装说明(以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 <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文件,对登陆用户名及密码进行修改。

花生壳日志保存路径

/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)的更多相关文章

  1. ubuntu 12.04 安装和使用花生壳

    1.安装必要的开发包 [root@localhost ~]# apt-get install gcc g++ autoconf automake 2.下载phddns到某一个目录 http://www ...

  2. 树莓派4B踩坑指南 - (11)免费搭建网站(宝塔,花生壳)

    目录 宝塔 安装宝塔面板 登录及初始化设置 安装网站 花生壳 安装花生壳 设置花生壳 测试 问题(未解决但不影响使用) 网站统计 树莓派这么低的功耗,不用来当服务器总感觉有点浪费...完成效果:htt ...

  3. 安装和使用Linux花生壳(公网版)

    一.安装说明 1.下载相应的安装包,安装程序 2.运行程序.配置程序(默认使用/etc/phlinux.conf,如果不存在这个文件则自动进入交互配置) [root@localhost -]# phd ...

  4. centos 7.0安装花生壳

    没有wget 先下载get  命令 yum -y install wget 下载位置/usr/local/src 解压目录 /usr/local/bin/phddns-2.0.6.x86_64 1.下 ...

  5. ubuntu下安装花生壳

    下载地址:http://hsk.oray.com/download/#type=linux 官方的文档: 花生壳(公网版) for linux的安装以及使用 Linux花生壳(公网版)将大大简化大家的 ...

  6. Linux花生壳使用篇

    1. 下载花生壳     2. 找到Linux版本的进行下载       3.安装,Linux版本的新版本是采用SN码的形式     4. 这个是花生壳的启动命令相关的     注释:如果有使用之前的 ...

  7. paip.花生壳 服务启动失败 以及不能安装服务,权限失败的解决

    paip.花生壳 服务启动失败 以及不能安装服务,权限失败的解决 系统win7 NewPhDDNS_1.0.0.30166.exe  作者Attilax  艾龙,  EMAIL:1466519819@ ...

  8. 树莓派加入定时任务实现花生壳定时重启(linux的定时任务)

    由于花生壳在linux下不稳定,联系开机一个星期左右会挂掉,所以要使用定时任务实现每小时刷新一次/启动一次. 使用的是linux下的定时任务crontab去实现. 实现步骤: 1.编辑/etc/cro ...

  9. ubuntu 安装花生壳

    由于无线路由的IP总是变换,所以想在机器上装一个花生壳,然后通过域名来访问这个机器,这样就算IP变了也没有关系.我的机器的系统是ubuntu 12.04 desktop  cd 到一个目录,我用的是D ...

随机推荐

  1. 简单描述一下XIB与Storyboards,简述它们的优缺点。

    参考答案: 我倾向于纯代码开发,因此所提供的参考答案可能具有一定的个人感情,不过还是给大家说说自己的想法. 优点: XIB:在编译前就提供了可视化界面,可以直接拖控件,也可以直接给控件添加约束,更直观 ...

  2. OpenGL ES 2.0 卷绕和背面剪裁

    基本知识 背面剪裁是指渲染管线在对构成立体物体的三角形图元进行绘制时,仅当摄像机观察点位于三角形正面的情况下才绘制三角形. OpenGL ES中规定若三角形中的3个顶点的卷绕顺序是逆时针则摄像机观察其 ...

  3. Light oj 1030 概率DP

    D - Discovering Gold Crawling in process... Crawling failed Time Limit:2000MS     Memory Limit:32768 ...

  4. shell中的case表达式

    语法格式 case var in pattern1 | patter2) command1 command2;; pattern3) command1 command2;; *) default co ...

  5. shell中的双括号表达式

    语法格式 (( expression )) expression可以是任何数学表达式,可以包含的操作符有: +  加 - 减 * 乘(无需转义) / 除 % 取余 ** 指数 == 等于 != 不等 ...

  6. WDCP LNMPA和LNMP 504 Gateway time-out错误的解决方法

    Nginx的特点是处理静态很给力,Apache的特点是处理动态很稳定,两者结合起来便是LNMPA,nginx处理前端,apache处理后端,这样处理静态会很快,处理动态会很稳定.当我以为安装完成以后便 ...

  7. 使用grid++report打印选中行

    接上一篇<hibernate+spring+mvc+Easyui框架模式下使用grid++report的总结>对grid++report做进一步开发 先写一下实现流程: 1.默认为全部载入 ...

  8. hdu 1245 Saving James Bond

    http://acm.hdu.edu.cn/showproblem.php?pid=1245 #include <cstdio> #include <cstring> #inc ...

  9. poj3480--John

    题意:n堆石子,两人轮流操作,每次操作只能选定其中一堆,并取走若干个(>=1个).谁取走最后一个谁输.给定一个状态,问先取的赢还是后取的赢. 整个游戏反过来,如果sg为0先手必胜,不为0必败.( ...

  10. MLC固态硬盘,与入量是3000次P/E

    固态硬盘是什么,固态硬盘寿命有多长 SSD泛指使用闪存芯片组成的SSD固态硬盘,是使用FLASH闪存颗粒作为存储单元,不再使用传统的机械存储方法,使用模拟的方式虚拟出传统 硬盘存取方式和扇区等,也可以 ...