Linux下配置花生壳(实用)

来源:互联网 发布:owncloud源码下载 编辑:程序博客网 时间:2024/06/11 08:06

先安装必要的工具

[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
 
二、花生壳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.
 
启动交互模式
  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.
  www.2cto.com  
三、常见问题
 
如何手动修改登陆的用户名及密码?
 
您可以直接编辑/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
原创粉丝点击