欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  科技

Linux中安装oray服务的步骤分享

程序员文章站 2022-04-03 16:44:36
家里面的路由器ddns经常不能用,索性在系统中直接安了一个oray的客户端。具体安装步骤如下... 12-10-16...

1、首先安装必要的开发包

[root@wangheng.org ~] apt-get install gcc g++ automake autoconf

2、下载phddns-2.0.2.16556.tar.gz到某一个目录

[root@wangheng.org ~]# wget http://download.oray.com/peanuthull/phddns-2.0.2.16556.tar.gz

3、解压所有文件

[root@wangheng.org ~]# tar zxvf phddns-2.0.2.16556.tar.gz

4、进入目录并编译
[root@wangheng.org ~]# cd phddns-2.0.2.16556
[root@wangheng.org phddns-2.0.2.16556]# aclocal
[root@wangheng.org phddns-2.0.2.16556]# autoconf
[root@wangheng.org phddns-2.0.2.16556]# automake
[root@wangheng.org phddns-2.0.2.16556]# ./configure
[root@wangheng.org phddns-2.0.2.16556]# make
[root@wangheng.org phddns-2.0.2.16556]# cd src
[root@wangheng.org src]# ls -l phddns
-rwxr-xr-x 1 root root 80968 aug 2 11:18 phddns

5、执行编译好的程序并配置(默认使用/etc/phlinux.conf,如果不存在这个文件则自动进入交互配置)

[root@wangheng.org 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@wangheng.org src]# cp phddns /usr/bin/

7、以后台模式启动花生壳并检查运行情况

[root@wangheng.org ~]# /usr/bin/phddns -c /etc/phlinux.conf -d
phlinux started as daemon!
[root@wangheng.org ~]# 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.***.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.***.123.96

8、退出花生壳

查看进程id
[root@wangheng.org ~]# ps -a | grep phddns
13731 ? 00:00:00 phlinux
让后台进程退出
[root@wangheng.org ~]# kill -9 13731

9、将花生壳加到系统启动时运行
[root@wangheng.org ~]# vi /etc/rc.local
在文件的末尾加上一行:/usr/bin/phddns -c /etc/phlinux.conf -d

二、花生壳linux版本命令行参数说明

[root@wangheng.org ~]# /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.

转载自王恒的博客