首页 » SSH » 正文

rtty_服务端_centos6.9_安装文档(测试通过)

#简介:
#一个反向代理WebTTY,它由客户端和服务端组成,服务端采用GO语言实现,以及使用了vue+iview,你可以基于你设置的设备ID(不设置则为设备的MAC地址)通过Web浏览器访问你的任意一台终端。
#rtty非常适合远程维护你的或者你公司的部署在全球各地的成千上万的Linux设备。
#参考地址:
#https://gitee.com/zhaojh329/rtty
#http://blog.csdn.net/wh211212/article/details/53523457
#https://superuser.com/questions/823757/update-rc-d-equivalent-on-centos
#特性:
#1.部署简单,使用方便
#2.反向代理
#3.根据你设置的ID连接你的设备
#4.基于Xterm.js的全功能终端
#5.支持SSL: openssl, mbedtls, CyaSSl(wolfssl)
#6.支持上传文件到设备
#7.支持从设备下载文件
#8.跨平台: macOS, Linux, FreeBSD/OpenBSD, OpenWrt/LEDE

#客户端依赖:
#1.libubox-用于OpenWrt的C工具函数库,但也可以用于其他Linux系统中.参考
#2.libuwsc-一个轻量的针对嵌入式Linux的基于libubox的WebSocket客户端C库。
#3.ustream-ssl-如果你需要支持SSL
#4.mbedtls-如果你选择mbedtls作为你的SSL后端
#5.CyaSSl(wolfssl)-如果你选择wolfssl作为你的SSL后端
#6.openssl-如果你选择openssl作为你的SSL后端

#服务端系统环境:
[root@admin ~]# uname -a
Linux admin 2.6.32-696.el6.x86_64 #1 SMP Tue Mar 21 19:29:05 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
[root@admin ~]# cat /etc/issue
CentOS release 6.9 (Final)
Kernel \r on an \m

[root@admin ~]# lsb_release -a
LSB Version: :base-4.0-amd64:base-4.0-noarch:core-4.0-amd64:core-4.0-noarch:graphics-4.0-amd64:graphics-4.0-noarch:printing-4.0-amd64:printing-4.0-noarch
Distributor ID: CentOS
Description: CentOS release 6.9 (Final)
Release: 6.9
Codename: Final
[root@admin ~]# cat /proc/version
Linux version 2.6.32-696.el6.x86_64 (mockbuild@c1bm.rdu2.centos.org) (gcc version 4.4.7 20120313 (Red Hat 4.4.7-18) (GCC) ) #1 SMP Tue Mar 21 19:29:05 UTC 2017
[root@admin ~]#

#安装GO语言环境(如果您还未安装)
# For centos
[root@admin ~]# yum install epel-release -y
已加载插件:fastestmirror, refresh-packagekit, security
设置安装进程
Loading mirror speeds from cached hostfile
* base: mirrors.aliyun.com
* extras: mirrors.aliyun.com
* updates: mirror.bit.edu.cn
解决依赖关系
–> 执行事务检查
—> Package epel-release.noarch 0:6-8 will be 安装
–> 完成依赖关系计算

依赖关系解决

===================================================================================================================
软件包 架构 版本 仓库 大小
===================================================================================================================
正在安装:
epel-release noarch 6-8 extras 14 k

事务概要
===================================================================================================================
Install 1 Package(s)

总下载量:14 k
Installed size: 22 k
下载软件包:
epel-release-6-8.noarch.rpm | 14 kB 00:00
warning: rpmts_HdrFromFdno: Header V3 RSA/SHA1 Signature, key ID c105b9de: NOKEY
Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
Importing GPG key 0xC105B9DE:
Userid : CentOS-6 Key (CentOS 6 Official Signing Key) <centos-6-key@centos.org>
Package: centos-release-6-9.el6.12.3.x86_64 (@anaconda-CentOS-201703281317.x86_64/6.9)
From : /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
运行 rpm_check_debug
执行事务测试
事务测试成功
执行事务
正在安装 : epel-release-6-8.noarch 1/1
Verifying : epel-release-6-8.noarch 1/1

已安装:
epel-release.noarch 0:6-8

完毕!

[root@admin ~]# yum install golang -y
已加载插件:fastestmirror, refresh-packagekit, security
设置安装进程
Loading mirror speeds from cached hostfile
* base: mirrors.aliyun.com
* epel: mirror01.idc.hinet.net
* extras: mirrors.aliyun.com
* updates: mirror.bit.edu.cn
解决依赖关系
–> 执行事务检查
—> Package golang.x86_64 0:1.9.2-1.el6 will be 安装
–> 处理依赖关系 golang-src = 1.9.2-1.el6,它被软件包 golang-1.9.2-1.el6.x86_64 需要
–> 处理依赖关系 golang-bin,它被软件包 golang-1.9.2-1.el6.x86_64 需要
–> 执行事务检查
—> Package golang-bin.x86_64 0:1.9.2-1.el6 will be 安装
–> 处理依赖关系 gcc,它被软件包 golang-bin-1.9.2-1.el6.x86_64 需要
—> Package golang-src.noarch 0:1.9.2-1.el6 will be 安装
–> 执行事务检查
—> Package gcc.x86_64 0:4.4.7-18.el6 will be 安装
–> 处理依赖关系 cpp = 4.4.7-18.el6,它被软件包 gcc-4.4.7-18.el6.x86_64 需要
–> 处理依赖关系 cloog-ppl >= 0.15,它被软件包 gcc-4.4.7-18.el6.x86_64 需要
–> 执行事务检查
—> Package cloog-ppl.x86_64 0:0.15.7-1.2.el6 will be 安装
–> 处理依赖关系 libppl_c.so.2()(64bit),它被软件包 cloog-ppl-0.15.7-1.2.el6.x86_64 需要
–> 处理依赖关系 libppl.so.7()(64bit),它被软件包 cloog-ppl-0.15.7-1.2.el6.x86_64 需要
—> Package cpp.x86_64 0:4.4.7-18.el6 will be 安装
–> 处理依赖关系 libmpfr.so.1()(64bit),它被软件包 cpp-4.4.7-18.el6.x86_64 需要
–> 执行事务检查
—> Package mpfr.x86_64 0:2.4.1-6.el6 will be 安装
—> Package ppl.x86_64 0:0.10.2-11.el6 will be 安装
–> 完成依赖关系计算

依赖关系解决

===================================================================================================================
软件包 架构 版本 仓库 大小
===================================================================================================================
正在安装:
golang x86_64 1.9.2-1.el6 epel 634 k
为依赖而安装:
cloog-ppl x86_64 0.15.7-1.2.el6 base 93 k
cpp x86_64 4.4.7-18.el6 base 3.7 M
gcc x86_64 4.4.7-18.el6 base 10 M
golang-bin x86_64 1.9.2-1.el6 epel 49 M
golang-src noarch 1.9.2-1.el6 epel 5.3 M
mpfr x86_64 2.4.1-6.el6 base 157 k
ppl x86_64 0.10.2-11.el6 base 1.3 M

事务概要
===================================================================================================================
Install 8 Package(s)

总下载量:71 M
Installed size: 255 M
下载软件包:
(1/8): cloog-ppl-0.15.7-1.2.el6.x86_64.rpm | 93 kB 00:00
(2/8): cpp-4.4.7-18.el6.x86_64.rpm | 3.7 MB 00:01
(3/8): gcc-4.4.7-18.el6.x86_64.rpm | 10 MB 00:02
(4/8): golang-1.9.2-1.el6.x86_64.rpm | 634 kB 00:00
(5/8): golang-bin-1.9.2-1.el6.x86_64.rpm | 49 MB 00:15
(6/8): golang-src-1.9.2-1.el6.noarch.rpm | 5.3 MB 00:01
(7/8): mpfr-2.4.1-6.el6.x86_64.rpm | 157 kB 00:00
(8/8): ppl-0.10.2-11.el6.x86_64.rpm | 1.3 MB 00:00
——————————————————————————————————————-
总计 3.1 MB/s | 71 MB 00:22
warning: rpmts_HdrFromFdno: Header V3 RSA/SHA256 Signature, key ID 0608b895: NOKEY
Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6
Importing GPG key 0x0608B895:
Userid : EPEL (6) <epel@fedoraproject.org>
Package: epel-release-6-8.noarch (@extras)
From : /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6
运行 rpm_check_debug
执行事务测试
事务测试成功
执行事务
正在安装 : ppl-0.10.2-11.el6.x86_64 1/8
正在安装 : cloog-ppl-0.15.7-1.2.el6.x86_64 2/8
正在安装 : mpfr-2.4.1-6.el6.x86_64 3/8
正在安装 : cpp-4.4.7-18.el6.x86_64 4/8
正在安装 : gcc-4.4.7-18.el6.x86_64 5/8
正在安装 : golang-src-1.9.2-1.el6.noarch 6/8
正在安装 : golang-bin-1.9.2-1.el6.x86_64 7/8
正在安装 : golang-1.9.2-1.el6.x86_64 8/8
Verifying : golang-src-1.9.2-1.el6.noarch 1/8
Verifying : cpp-4.4.7-18.el6.x86_64 2/8
Verifying : mpfr-2.4.1-6.el6.x86_64 3/8
Verifying : golang-bin-1.9.2-1.el6.x86_64 4/8
Verifying : gcc-4.4.7-18.el6.x86_64 5/8
Verifying : golang-1.9.2-1.el6.x86_64 6/8
Verifying : ppl-0.10.2-11.el6.x86_64 7/8
Verifying : cloog-ppl-0.15.7-1.2.el6.x86_64 8/8

已安装:
golang.x86_64 0:1.9.2-1.el6

作为依赖被安装:
cloog-ppl.x86_64 0:0.15.7-1.2.el6 cpp.x86_64 0:4.4.7-18.el6 gcc.x86_64 0:4.4.7-18.el6
golang-bin.x86_64 0:1.9.2-1.el6 golang-src.noarch 0:1.9.2-1.el6 mpfr.x86_64 0:2.4.1-6.el6
ppl.x86_64 0:0.10.2-11.el6

完毕!

#设置环境变量GOPATH(如果您未设置)(从Go 1.8开始,默认为$HOME/go)
[root@admin ~]# export GOPATH=$HOME/go
[root@admin ~]# echo $GOPATH
/root/go
[root@admin ~]# mkdir /home/app
[root@admin ~]# cd /home/app/
[root@admin app]#

#安装git
[root@admin app]# yum install git -y
已加载插件:fastestmirror, refresh-packagekit, security
设置安装进程
Loading mirror speeds from cached hostfile
* base: mirrors.aliyun.com
* epel: mirror01.idc.hinet.net
* extras: mirrors.aliyun.com
* updates: mirror.bit.edu.cn
解决依赖关系
–> 执行事务检查
—> Package git.x86_64 0:1.7.1-9.el6_9 will be 安装
–> 处理依赖关系 perl-Git = 1.7.1-9.el6_9,它被软件包 git-1.7.1-9.el6_9.x86_64 需要
–> 处理依赖关系 perl(Git),它被软件包 git-1.7.1-9.el6_9.x86_64 需要
–> 处理依赖关系 perl(Error),它被软件包 git-1.7.1-9.el6_9.x86_64 需要
–> 执行事务检查
—> Package perl-Error.noarch 1:0.17015-4.el6 will be 安装
—> Package perl-Git.noarch 0:1.7.1-9.el6_9 will be 安装
–> 完成依赖关系计算

依赖关系解决

===================================================================================================================
软件包 架构 版本 仓库 大小
===================================================================================================================
正在安装:
git x86_64 1.7.1-9.el6_9 updates 4.6 M
为依赖而安装:
perl-Error noarch 1:0.17015-4.el6 base 29 k
perl-Git noarch 1.7.1-9.el6_9 updates 29 k

事务概要
===================================================================================================================
Install 3 Package(s)

总下载量:4.7 M
Installed size: 15 M
下载软件包:
(1/3): git-1.7.1-9.el6_9.x86_64.rpm | 4.6 MB 00:01
(2/3): perl-Error-0.17015-4.el6.noarch.rpm | 29 kB 00:00
(3/3): perl-Git-1.7.1-9.el6_9.noarch.rpm | 29 kB 00:00
——————————————————————————————————————-
总计 2.5 MB/s | 4.7 MB 00:01
运行 rpm_check_debug
执行事务测试
事务测试成功
执行事务
正在安装 : 1:perl-Error-0.17015-4.el6.noarch 1/3
正在安装 : git-1.7.1-9.el6_9.x86_64 2/3
正在安装 : perl-Git-1.7.1-9.el6_9.noarch 3/3
Verifying : 1:perl-Error-0.17015-4.el6.noarch 1/3
Verifying : git-1.7.1-9.el6_9.x86_64 2/3
Verifying : perl-Git-1.7.1-9.el6_9.noarch 3/3

已安装:
git.x86_64 0:1.7.1-9.el6_9

作为依赖被安装:
perl-Error.noarch 1:0.17015-4.el6 perl-Git.noarch 0:1.7.1-9.el6_9

完毕!

#安装rtty server
[root@admin app]# go get -u github.com/zhaojh329/rttys

#手动运行
[root@admin app]# echo $GOPATH
/root/go
[root@admin app]# $GOPATH/bin/rttys -port 5912
2018/03/08 20:23:33 Listen on: 5912 SSL off

#安装自启动脚本,后台运行(centos)
[root@admin app]# cd /root/go/src/github.com/zhaojh329/rttys/
[root@admin rttys]# ./install.sh
./install.sh: line 3: update-rc.d: command not found
which: no rttys in (/usr/lib64/qt-3.3/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin)
./install.sh: line 8: update-rc.d: command not found

#由于脚本是用在debian/ubuntu系统上的,所以需要修改安装脚本
#原安装脚本内容如下
[root@admin rttys]# cat install.sh
#!/bin/sh

update-rc.d rttys remove

which rttys > /dev/null && rm `which rttys`
cp ../../../../bin/rttys /usr/local/sbin/
cp rttys.init /etc/init.d/rttys
update-rc.d rttys defaults

[root@admin rttys]# cp install.sh install.sh20180308

#修改之后的内容
[root@admin rttys]# cat install.sh
#!/bin/sh

#update-rc.d rttys remove
chkconfig –del rttys

which rttys > /dev/null && rm `which rttys`
cp ../../../../bin/rttys /usr/local/sbin/
cp rttys.init /etc/init.d/rttys
#开机自启动
#update-rc.d rttys defaults
chkconfig –level 2345 rttys on

[root@admin rttys]# ./install.sh
[root@admin rttys]#

[root@admin rttys]# /etc/init.d/rttys start
/etc/init.d/rttys: line 20: start-stop-daemon: command not found
[root@admin rttys]#

#start-stop-daemon是一个Debian体系里的一个守护进程管理软件,可以用指定的用户启停软件。
#start-stop-daemon使用:http://man7.org/linux/man-pages/man8/start-stop-daemon.8.html
#在centos上安装start-stop-daemon
[root@admin rttys]# mkdir /home/tools
[root@admin rttys]# cd /home/tools/
[root@admin tools]# wget http://ftp.de.debian.org/debian/pool/main/d/dpkg/dpkg_1.16.18.tar.xz
–2018-03-08 20:36:18– http://ftp.de.debian.org/debian/pool/main/d/dpkg/dpkg_1.16.18.tar.xz
正在解析主机 ftp.de.debian.org… 141.76.2.4
正在连接 ftp.de.debian.org|141.76.2.4|:80… 已连接。
已发出 HTTP 请求,正在等待回应… 200 OK
长度:4557428 (4.3M) [application/x-xz]
正在保存至: “dpkg_1.16.18.tar.xz”

7% [====> ] 348,507 101K/s eta(英国中部时 9% [=====> ] 427,883 110K/s eta(英国中部时 9% [======> ] 444,267 103K/s eta(英国中部时11% [=======> ] 533,187 108K/s eta(英国中部时12% [========> ] 578,331 110K/s eta(英国中部时15% [==========> ] 705,587 126K/s eta(英国中部时17% [============> ] 808,627 133K/s eta(英国中部时20% [==============> ] 943,619 147K/s eta(英国中部时23% [================> ] 1,087,227 160K/s eta(英国中部时27% [==================> ] 1,230,867 170K/s eta(英国中部时30% [=====================> ] 1,374,507 180K/s eta(英国中部时33% [=======================> ] 1,518,147 188K/s eta(英国中部时34% [========================> ] 1,549,611 186K/s eta(英国中部时37% [==========================> ] 1,716,507 203K/s eta(英国中部时40% [============================> ] 1,830,051 213K/s eta(英国中部时42% [==============================> ] 1,943,595 209K/s eta(英国中部时45% [================================> ] 2,055,771 217K/s eta(英国中部时47% [==================================> ] 2,165,243 227K/s eta(英国中部时49% [===================================> ] 2,256,899 236K/s eta(英国中部时51% [=====================================> ] 2,362,203 243K/s eta(英国中部时53% [======================================> ] 2,444,315 246K/s eta(英国中部时55% [========================================> ] 2,537,339 248K/s eta(英国中部时56% [========================================> ] 2,553,723 248K/s eta(英国中部时58% [==========================================> ] 2,676,843 262K/s eta(英国中部时60% [===========================================> ] 2,752,083 264K/s eta(英国中部时62% [============================================> ] 2,827,323 257K/s eta(英国中部时62% [=============================================> ] 2,865,627 253K/s eta(英国中部时64% [==============================================> ] 2,949,107 246K/s eta(英国中部时66% [===============================================> ] 3,010,667 238K/s eta(英国中部时66% [================================================> ] 3,027,051 224K/s eta(英国中部时68% [=================================================> ] 3,122,811 219K/s eta(英国中部时69% [==================================================> ] 3,163,883 209K/s eta(英国中部时70% [===================================================> ] 3,209,027 213K/s eta(英国中部时71% [===================================================> ] 3,262,347 199K/s eta(英国中部时72% [====================================================> ] 3,308,859 191K/s eta(英国中部时73% [=====================================================> ] 3,355,371 192K/s eta(英国中部时74% [======================================================> ] 3,401,883 183K/s eta(英国中部时75% [======================================================> ] 3,436,115 173K/s eta(英国中部时76% [=======================================================> ] 3,496,275 168K/s eta(英国中部时77% [========================================================> ] 3,534,611 159K/s eta(英国中部时78% [=========================================================> ] 3,592,035 155K/s eta(英国中部时79% [==========================================================> ] 3,639,915 148K/s eta(英国中部时80% [==========================================================> ] 3,687,795 154K/s eta(英国中部时81% [===========================================================> ] 3,712,451 140K/s eta(英国中部时81% [===========================================================> ] 3,728,835 131K/s eta(英国中部时83% [============================================================> ] 3,812,283 126K/s eta(英国中部时84% [=============================================================> ] 3,835,571 124K/s eta(英国中部时85% [=============================================================> ] 3,873,875 119K/s eta(英国中部时86% [==============================================================> ] 3,928,563 117K/s eta(英国中部时87% [===============================================================> ] 3,968,235 120K/s eta(英国中部时87% [================================================================> ] 4,007,907 113K/s eta(英国中部时88% [================================================================> ] 4,033,931 111K/s eta(英国中部时88% [================================================================> ] 4,050,315 107K/s eta(英国中部时89% [=================================================================> ] 4,098,227 107K/s eta(英国中部时90% [==================================================================> ] 4,143,339 108K/s eta(英国中部时91% [==================================================================> ] 4,174,803 107K/s eta(英国中部时92% [===================================================================> ] 4,195,355 104K/s eta(英国中部时92% [===================================================================> ] 4,224,083 104K/s eta(英国中部时93% [====================================================================> ] 4,256,915 101K/s eta(英国中部时94% [====================================================================> ] 4,292,451 100K/s eta(英国中部时94% [=====================================================================> ] 4,314,371 96.5K/s eta(英国中部时95% [=====================================================================> ] 4,340,363 94.4K/s eta(英国中部时95% [=====================================================================> ] 4,366,355 91.5K/s eta(英国中部时96% [======================================================================> ] 4,392,347 92.3K/s eta(英国中部时96% [======================================================================> ] 4,418,339 94.6K/s eta(英国中部时97% [=======================================================================> ] 4,459,347 93.5K/s eta(英国中部时98% [=======================================================================> ] 4,486,707 92.6K/s eta(英国中部时98% [========================================================================> ] 4,500,419 89.0K/s eta(英国中部时99% [========================================================================> ] 4,527,779 86.0K/s eta(英国中部时100%[=========================================================================>] 4,557,428 84.7K/s eta(英国中部时100%[=========================================================================>] 4,557,428 84.7K/s in 29s

2018-03-08 20:36:48 (151 KB/s) – 已保存 “dpkg_1.16.18.tar.xz” [4557428/4557428])

[root@admin tools]# tar -xf dpkg_1.16.18.tar.xz
[root@admin tools]# ls
dpkg-1.16.18 dpkg_1.16.18.tar.xz
[root@admin tools]# cd dpkg-1.16.18/
[root@admin dpkg-1.16.18]# yum install ncurses-devel -y
已加载插件:fastestmirror, refresh-packagekit, security
设置安装进程
Loading mirror speeds from cached hostfile
* base: mirrors.aliyun.com
* epel: mirror01.idc.hinet.net
* extras: mirrors.aliyun.com
* updates: mirror.bit.edu.cn
解决依赖关系
–> 执行事务检查
—> Package ncurses-devel.x86_64 0:5.7-4.20090207.el6 will be 安装
–> 完成依赖关系计算

依赖关系解决

===================================================================================================================
软件包 架构 版本 仓库 大小
===================================================================================================================
正在安装:
ncurses-devel x86_64 5.7-4.20090207.el6 base 641 k

事务概要
===================================================================================================================
Install 1 Package(s)

总下载量:641 k
Installed size: 1.7 M
下载软件包:
ncurses-devel-5.7-4.20090207.el6.x86_64.rpm | 641 kB 00:00
运行 rpm_check_debug
执行事务测试
事务测试成功
执行事务
正在安装 : ncurses-devel-5.7-4.20090207.el6.x86_64 1/1
Verifying : ncurses-devel-5.7-4.20090207.el6.x86_64 1/1

已安装:
ncurses-devel.x86_64 0:5.7-4.20090207.el6

完毕!

[root@admin dpkg-1.16.18]# ./configure
checking for gcc… gcc
checking whether the C compiler works… yes
checking for C compiler default output file name… a.out
checking for suffix of executables…
checking whether we are cross compiling… no
checking for suffix of object files… o
checking whether we are using the GNU C compiler… yes
checking whether gcc accepts -g… yes
checking for gcc option to accept ISO C89… none needed
checking whether gcc understands -c and -o together… yes
checking how to run the C preprocessor… gcc -E
checking for grep that handles long lines and -e… /bin/grep
checking for egrep… /bin/grep -E
checking for ANSI C header files… yes
checking for sys/types.h… yes
checking for sys/stat.h… yes
checking for stdlib.h… yes
checking for string.h… yes
checking for memory.h… yes
checking for strings.h… yes
checking for inttypes.h… yes
checking for stdint.h… yes
checking for unistd.h… yes
checking minix/config.h usability… no
checking minix/config.h presence… no
checking for minix/config.h… no
checking whether it is safe to define __EXTENSIONS__… yes
checking for a BSD-compatible install… /usr/bin/install -c
checking whether build environment is sane… yes
checking for a thread-safe mkdir -p… /bin/mkdir -p
checking for gawk… gawk
checking whether make sets $(MAKE)… yes
checking for style of include used by make… GNU
checking whether make supports nested variables… yes
checking dependency style of gcc… gcc3
checking whether make supports nested variables… (cached) yes
checking for a sed that does not truncate output… /bin/sed
checking whether NLS is requested… yes
checking for msgfmt… /usr/bin/msgfmt
checking for gmsgfmt… /usr/bin/msgfmt
checking for xgettext… /usr/bin/xgettext
checking for msgmerge… /usr/bin/msgmerge
checking build system type… x86_64-pc-linux-gnu
checking host system type… x86_64-pc-linux-gnu
checking for ld used by gcc… /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld… yes
checking for shared library run path origin… done
checking for CFPreferencesCopyAppValue… no
checking for CFLocaleCopyCurrent… no
checking for GNU gettext in libc… yes
checking whether to use NLS… yes
checking where the gettext function comes from… libc
checking for ar… ar
checking the archiver (ar) interface… ar
checking how to print strings… printf
checking for a sed that does not truncate output… (cached) /bin/sed
checking for fgrep… /bin/grep -F
checking for ld used by gcc… /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld… yes
checking for BSD- or MS-compatible name lister (nm)… /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface… BSD nm
checking whether ln -s works… yes
checking the maximum length of command line arguments… 1966080
checking how to convert x86_64-pc-linux-gnu file names to x86_64-pc-linux-gnu format… func_convert_file_noop
checking how to convert x86_64-pc-linux-gnu file names to toolchain format… func_convert_file_noop
checking for /usr/bin/ld option to reload object files… -r
checking for objdump… objdump
checking how to recognize dependent libraries… pass_all
checking for dlltool… no
checking how to associate runtime and link libraries… printf %s\n
checking for archiver @FILE support… @
checking for strip… strip
checking for ranlib… ranlib
checking command to parse /usr/bin/nm -B output from gcc object… ok
checking for sysroot… no
checking for a working dd… /bin/dd
checking how to truncate binary pipes… /bin/dd bs=4096 count=1
checking for mt… no
checking if : is a manifest tool… no
checking for dlfcn.h… yes
checking for objdir… .libs
checking if gcc supports -fno-rtti -fno-exceptions… no
checking for gcc option to produce PIC… -fPIC -DPIC
checking if gcc PIC flag -fPIC -DPIC works… yes
checking if gcc static flag -static works… no
checking if gcc supports -c -o file.o… yes
checking if gcc supports -c -o file.o… (cached) yes
checking whether the gcc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries… yes
checking dynamic linker characteristics… GNU/Linux ld.so
checking how to hardcode library paths into programs… immediate
checking whether stripping libraries is possible… yes
checking if libtool supports shared libraries… yes
checking whether to build shared libraries… no
checking whether to build static libraries… yes
checking for –as-needed linker flag… yes
checking for –version-script linker flag… yes
checking whether to build dselect… yes
checking whether to build start-stop-daemon… yes
checking whether to build update-alternatives… yes
checking for perl >= 5.20.2… configure: error: cannot find perl >= 5.20.2

[root@admin dpkg-1.16.18]# perl -v

This is perl, v5.10.1 (*) built for x86_64-linux-thread-multi

Copyright 1987-2009, Larry Wall

Perl may be copied only under the terms of either the Artistic License or the
GNU General Public License, which may be found in the Perl 5 source kit.

Complete documentation for Perl, including FAQ lists, should be found on
this system using “man perl” or “perldoc perl”. If you have access to the
Internet, point your browser at http://www.perl.org/, the Perl Home Page.

[root@admin dpkg-1.16.18]# cd /home/tools/
[root@admin tools]# wget http://www.cpan.org/src/5.0/perl-5.22.4.tar.gz
#由于下载速度较慢,所以建议使用迅雷下载好以后在上传到服务器上。
[root@admin tools]# pwd
/home/tools
[root@admin tools]# ll
总用量 23792
drwxr-xr-x. 15 root root 4096 3月 8 21:09 dpkg-1.16.18
-rwxr-xr-x. 1 root root 3806456 3月 8 21:08 dpkg_1.16.18.tar.xz
-rwxr-xr-x. 1 root root 15971824 3月 8 20:46 perl-5.22.4.tar.gz

#查看perl的安装路径
[root@admin tools]# whereis perl
perl: /usr/bin/perl /usr/share/man/man1/perl.1.gz
[root@admin tools]#
#真实安装路径为:/usr/bin/perl

[root@admin tools]# tar -xf perl-5.22.4.tar.gz
[root@admin tools]# cd perl-5.22.4
[root@admin perl-5.22.4]# ./Configure -des -Dprefix=/usr
[root@admin perl-5.22.4]# make
[root@admin perl-5.22.4]# make install
[root@admin perl-5.22.4]# perl -version

This is perl 5, version 22, subversion 4 (v5.22.4) built for x86_64-linux

Copyright 1987-2017, Larry Wall

Perl may be copied only under the terms of either the Artistic License or the
GNU General Public License, which may be found in the Perl 5 source kit.

Complete documentation for Perl, including FAQ lists, should be found on
this system using “man perl” or “perldoc perl”. If you have access to the
Internet, point your browser at http://www.perl.org/, the Perl Home Page.

[root@admin perl-5.22.4]# cd /home/tools/dpkg-1.16.18/
[root@admin dpkg-1.16.18]# ./configure
checking for gcc… gcc
checking whether the C compiler works… yes
checking for C compiler default output file name… a.out
checking for suffix of executables…
checking whether we are cross compiling… no
checking for suffix of object files… o
checking whether we are using the GNU C compiler… yes
checking whether gcc accepts -g… yes
checking for gcc option to accept ISO C89… none needed
checking how to run the C preprocessor… gcc -E
checking for grep that handles long lines and -e… /bin/grep
checking for egrep… /bin/grep -E
checking for ANSI C header files… yes
checking for sys/types.h… yes
checking for sys/stat.h… yes
checking for stdlib.h… yes
checking for string.h… yes
checking for memory.h… yes
checking for strings.h… yes
checking for inttypes.h… yes
checking for stdint.h… yes
checking for unistd.h… yes
checking minix/config.h usability… no
checking minix/config.h presence… no
checking for minix/config.h… no
checking whether it is safe to define __EXTENSIONS__… yes
checking for a BSD-compatible install… /usr/bin/install -c
checking whether build environment is sane… yes
checking for a thread-safe mkdir -p… /bin/mkdir -p
checking for gawk… gawk
checking whether make sets $(MAKE)… yes
checking for style of include used by make… GNU
checking dependency style of gcc… gcc3
checking whether make supports nested variables… yes
checking whether NLS is requested… yes
checking for msgfmt… /usr/bin/msgfmt
checking for gmsgfmt… /usr/bin/msgfmt
checking for xgettext… /usr/bin/xgettext
checking for msgmerge… /usr/bin/msgmerge
checking build system type… x86_64-unknown-linux-gnu
checking host system type… x86_64-unknown-linux-gnu
checking for ld used by GCC… /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld… yes
checking for shared library run path origin… done
checking for CFPreferencesCopyAppValue… no
checking for CFLocaleCopyCurrent… no
checking for GNU gettext in libc… yes
checking whether to use NLS… yes
checking where the gettext function comes from… libc
checking whether to build dselect… yes
checking whether to build start-stop-daemon… yes
checking whether to build update-alternatives… yes
checking whether to build install-info… yes
configure: using directory admindir = ‘${prefix}/var/lib/dpkg’
configure: using directory logdir = ‘${prefix}/var/log’
checking for gcc… (cached) gcc
checking whether we are using the GNU C compiler… (cached) yes
checking whether gcc accepts -g… (cached) yes
checking for gcc option to accept ISO C89… (cached) none needed
checking for g++… no
checking for c++… no
checking for gpp… no
checking for aCC… no
checking for CC… no
checking for cxx… no
checking for cc++… no
checking for cl.exe… no
checking for FCC… no
checking for KCC… no
checking for RCC… no
checking for xlC_r… no
checking for xlC… no
checking whether we are using the GNU C++ compiler… no
checking whether g++ accepts -g… no
checking dependency style of g++… none
checking for flex… no
checking for lex… no
checking for ranlib… ranlib
checking for doxygen… no
checking for dot… NO
checking for po4a… no
checking for perl… /usr/bin/perl
checking for pod2man… pod2man
checking whether to build with code coverage… no
checking for special C compiler options needed for large files… no
checking for _FILE_OFFSET_BITS value needed for large files… no
checking for gzdopen in -lz… no
checking zlib.h usability… no
checking zlib.h presence… no
checking for zlib.h… no
checking for BZ2_bzdopen in -lbz2… no
checking bzlib.h usability… no
checking bzlib.h presence… no
checking for bzlib.h… no
checking for lzma_alone_decoder in -llzma… no
checking lzma.h usability… no
checking lzma.h presence… no
checking for lzma.h… no
checking for pkg-config… /usr/bin/pkg-config
checking pkg-config is at least version 0.9.0… yes
checking for is_selinux_enabled in -lselinux… no
checking selinux/selinux.h usability… no
checking selinux/selinux.h presence… no
checking for selinux/selinux.h… no
checking whether Unicode is requested… yes
checking ncurses/ncurses.h usability… yes
checking ncurses/ncurses.h presence… yes
checking for ncurses/ncurses.h… yes
checking ncurses.h usability… yes
checking ncurses.h presence… yes
checking for ncurses.h… yes
checking curses.h usability… yes
checking curses.h presence… yes
checking for curses.h… yes
checking ncurses/term.h usability… yes
checking ncurses/term.h presence… yes
checking for ncurses/term.h… yes
checking term.h usability… yes
checking term.h presence… yes
checking for term.h… yes
checking ncursesw/ncurses.h usability… yes
checking ncursesw/ncurses.h presence… yes
checking for ncursesw/ncurses.h… yes
checking ncursesw/term.h usability… yes
checking ncursesw/term.h presence… yes
checking for ncursesw/term.h… yes
checking for initscr in -lncursesw… yes
checking for ihash_create in -lihash… no
checking for proc_stat_list_create in -lps… no
checking for fmt_past_time in -lshouldbeinlibc… no
checking for kvm_openfiles in -lkvm… no
checking for ANSI C header files… (cached) yes
checking stddef.h usability… yes
checking stddef.h presence… yes
checking for stddef.h… yes
checking error.h usability… yes
checking error.h presence… yes
checking for error.h… yes
checking locale.h usability… yes
checking locale.h presence… yes
checking for locale.h… yes
checking libintl.h usability… yes
checking libintl.h presence… yes
checking for libintl.h… yes
checking kvm.h usability… no
checking kvm.h presence… no
checking for kvm.h… no
checking sys/syscall.h usability… yes
checking sys/syscall.h presence… yes
checking for sys/syscall.h… yes
checking linux/fiemap.h usability… yes
checking linux/fiemap.h presence… yes
checking for linux/fiemap.h… yes
checking whether byte ordering is bigendian… no
checking for an ANSI C-conforming const… yes
checking for inline… inline
checking for working volatile… yes
checking whether compiler supports C99 features… yes
checking for mode_t… yes
checking for pid_t… yes
checking for size_t… yes
checking for u_int8_t… yes
checking for u_int16_t… yes
checking for u_int32_t… yes
checking for u_int64_t… yes
checking for ptrdiff_t… yes
checking size of unsigned int… 4
checking size of unsigned long… 8
checking for unistd.h… (cached) yes
checking whether sys_siglist is declared… yes
checking for va_copy… yes
checking for C99 snprintf functions… yes
checking whether offsetof is declared… yes
checking whether WCOREDUMP is declared… yes
checking whether TIOCNOTTY is declared… yes
checking whether O_NOFOLLOW is declared… yes
checking for program_invocation_short_name… yes
checking for __progname… yes
checking for getopt… yes
checking for getopt_long… yes
checking for obstack_free… yes
checking for strnlen… yes
checking for strndup… yes
checking for strerror… yes
checking for strsignal… yes
checking for asprintf… yes
checking for scandir… yes
checking for alphasort… yes
checking for unsetenv… yes
checking whether strnlen is declared… yes
checking for memcpy… yes
checking for lchown… yes
checking for strtoimax… yes
checking for isascii… yes
checking for setsid… yes
checking for getdtablesize… yes
checking for getprogname… no
checking for getexecname… no
checking for lutimes… yes
checking for posix_fadvise… yes
checking dpkg cpu type… amd64
checking dpkg operating system type… linux
checking dpkg architecture name… amd64
configure: creating ./config.status
config.status: creating Makefile
config.status: creating dpkg-deb/Makefile
config.status: creating dpkg-split/Makefile
config.status: creating dselect/Makefile
config.status: creating dselect/methods/Makefile
config.status: creating dselect/po/Makefile.in
config.status: creating lib/Makefile
config.status: creating lib/compat/Makefile
config.status: creating lib/dpkg/Makefile
config.status: creating lib/dpkg/libdpkg.pc
config.status: creating lib/dpkg/test/Makefile
config.status: creating doc/Doxyfile
config.status: creating man/Makefile
config.status: creating po/Makefile.in
config.status: creating scripts/Makefile
config.status: creating scripts/mk/Makefile
config.status: creating scripts/po/Makefile.in
config.status: creating src/Makefile
config.status: creating utils/Makefile
config.status: creating config.h
config.status: executing depfiles commands
config.status: executing po-directories commands
config.status: creating dselect/po/POTFILES
config.status: creating dselect/po/Makefile
config.status: creating po/POTFILES
config.status: creating po/Makefile
config.status: creating scripts/po/POTFILES
config.status: creating scripts/po/Makefile

[root@admin dpkg-1.16.18]# yum install gcc-c++
已加载插件:fastestmirror, refresh-packagekit, security
设置安装进程
Loading mirror speeds from cached hostfile
* base: mirrors.aliyun.com
* epel: mirror01.idc.hinet.net
* extras: mirrors.aliyun.com
* updates: mirror.bit.edu.cn
解决依赖关系
–> 执行事务检查
—> Package gcc-c++.x86_64 0:4.4.7-18.el6 will be 安装
–> 处理依赖关系 libstdc++-devel = 4.4.7-18.el6,它被软件包 gcc-c++-4.4.7-18.el6.x86_64 需要
–> 执行事务检查
—> Package libstdc++-devel.x86_64 0:4.4.7-18.el6 will be 安装
–> 完成依赖关系计算

依赖关系解决

===================================================================================================================
软件包 架构 版本 仓库 大小
===================================================================================================================
正在安装:
gcc-c++ x86_64 4.4.7-18.el6 base 4.7 M
为依赖而安装:
libstdc++-devel x86_64 4.4.7-18.el6 base 1.6 M

事务概要
===================================================================================================================
Install 2 Package(s)

总下载量:6.3 M
Installed size: 20 M
确定吗?[y/N]:y
下载软件包:
(1/2): gcc-c++-4.4.7-18.el6.x86_64.rpm | 4.7 MB 00:01
(2/2): libstdc++-devel-4.4.7-18.el6.x86_64.rpm | 1.6 MB 00:00
——————————————————————————————————————-
总计 3.4 MB/s | 6.3 MB 00:01
运行 rpm_check_debug
执行事务测试
事务测试成功
执行事务
正在安装 : libstdc++-devel-4.4.7-18.el6.x86_64 1/2
正在安装 : gcc-c++-4.4.7-18.el6.x86_64 2/2
Verifying : gcc-c++-4.4.7-18.el6.x86_64 1/2
Verifying : libstdc++-devel-4.4.7-18.el6.x86_64 2/2

已安装:
gcc-c++.x86_64 0:4.4.7-18.el6

作为依赖被安装:
libstdc++-devel.x86_64 0:4.4.7-18.el6

完毕!

[root@admin dpkg-1.16.18]# make
make all-recursive
make[1]: Entering directory `/home/tools/dpkg-1.16.18′
Making all in lib
make[2]: Entering directory `/home/tools/dpkg-1.16.18/lib’
Making all in compat
make[3]: Entering directory `/home/tools/dpkg-1.16.18/lib/compat’
make[3]: Nothing to be done for `all’.
make[3]: Leaving directory `/home/tools/dpkg-1.16.18/lib/compat’
Making all in dpkg
make[3]: Entering directory `/home/tools/dpkg-1.16.18/lib/dpkg’
Making all in .
make[4]: Entering directory `/home/tools/dpkg-1.16.18/lib/dpkg’
make[4]: Nothing to be done for `all-am’.
make[4]: Leaving directory `/home/tools/dpkg-1.16.18/lib/dpkg’
Making all in test
make[4]: Entering directory `/home/tools/dpkg-1.16.18/lib/dpkg/test’
make[4]: Nothing to be done for `all’.
make[4]: Leaving directory `/home/tools/dpkg-1.16.18/lib/dpkg/test’
make[3]: Leaving directory `/home/tools/dpkg-1.16.18/lib/dpkg’
make[3]: Entering directory `/home/tools/dpkg-1.16.18/lib’
make[3]: Nothing to be done for `all-am’.
make[3]: Leaving directory `/home/tools/dpkg-1.16.18/lib’
make[2]: Leaving directory `/home/tools/dpkg-1.16.18/lib’
Making all in dpkg-deb
make[2]: Entering directory `/home/tools/dpkg-1.16.18/dpkg-deb’
make[2]: Nothing to be done for `all’.
make[2]: Leaving directory `/home/tools/dpkg-1.16.18/dpkg-deb’
Making all in dpkg-split
make[2]: Entering directory `/home/tools/dpkg-1.16.18/dpkg-split’
make[2]: Nothing to be done for `all’.
make[2]: Leaving directory `/home/tools/dpkg-1.16.18/dpkg-split’
Making all in src
make[2]: Entering directory `/home/tools/dpkg-1.16.18/src’
make[2]: Nothing to be done for `all’.
make[2]: Leaving directory `/home/tools/dpkg-1.16.18/src’
Making all in utils
make[2]: Entering directory `/home/tools/dpkg-1.16.18/utils’
make[2]: Nothing to be done for `all’.
make[2]: Leaving directory `/home/tools/dpkg-1.16.18/utils’
Making all in dselect
make[2]: Entering directory `/home/tools/dpkg-1.16.18/dselect’
Making all in methods
make[3]: Entering directory `/home/tools/dpkg-1.16.18/dselect/methods’
make[3]: Nothing to be done for `all’.
make[3]: Leaving directory `/home/tools/dpkg-1.16.18/dselect/methods’
Making all in po
make[3]: Entering directory `/home/tools/dpkg-1.16.18/dselect/po’
make[3]: Leaving directory `/home/tools/dpkg-1.16.18/dselect/po’
make[3]: Entering directory `/home/tools/dpkg-1.16.18/dselect’
CXX basecmds.o
CXX baselist.o
CXX basetop.o
CXX bindings.o
GEN curkeys.h
CXX curkeys.o
CXX helpmsgs.o
CXX main.o
main.cc: In function ‘void curseson()’:
main.cc:324: 警告:不建议使用从字符串常量到‘char*’的转换
main.cc:325: 警告:不建议使用从字符串常量到‘char*’的转换
CXX methkeys.o
CXX methlist.o
CXX method.o
CXX methparse.o
CXX pkgcmds.o
CXX pkgdepcon.o
CXX pkgdisplay.o
CXX pkginfo.o
CXX pkgkeys.o
CXX pkglist.o
CXX pkgsublist.o
CXX pkgtop.o
CXXLD dselect
make[3]: Leaving directory `/home/tools/dpkg-1.16.18/dselect’
make[2]: Leaving directory `/home/tools/dpkg-1.16.18/dselect’
Making all in scripts
make[2]: Entering directory `/home/tools/dpkg-1.16.18/scripts’
Making all in mk
make[3]: Entering directory `/home/tools/dpkg-1.16.18/scripts/mk’
make[3]: Nothing to be done for `all’.
make[3]: Leaving directory `/home/tools/dpkg-1.16.18/scripts/mk’
Making all in po
make[3]: Entering directory `/home/tools/dpkg-1.16.18/scripts/po’
make[3]: Leaving directory `/home/tools/dpkg-1.16.18/scripts/po’
make[3]: Entering directory `/home/tools/dpkg-1.16.18/scripts’
GEN dpkg-architecture
GEN dpkg-buildflags
GEN dpkg-buildpackage
GEN dpkg-checkbuilddeps
GEN dpkg-distaddfile
GEN dpkg-genchanges
GEN dpkg-gencontrol
GEN dpkg-gensymbols
GEN dpkg-maintscript-helper
GEN dpkg-mergechangelogs
GEN dpkg-name
GEN dpkg-parsechangelog
GEN dpkg-scanpackages
GEN dpkg-scansources
GEN dpkg-shlibdeps
GEN dpkg-source
GEN dpkg-vendor
GEN changelog/debian
make[3]: Leaving directory `/home/tools/dpkg-1.16.18/scripts’
make[2]: Leaving directory `/home/tools/dpkg-1.16.18/scripts’
Making all in po
make[2]: Entering directory `/home/tools/dpkg-1.16.18/po’
make[2]: Leaving directory `/home/tools/dpkg-1.16.18/po’
Making all in man
make[2]: Entering directory `/home/tools/dpkg-1.16.18/man’
make[2]: Nothing to be done for `all’.
make[2]: Leaving directory `/home/tools/dpkg-1.16.18/man’
make[2]: Entering directory `/home/tools/dpkg-1.16.18′
make[2]: Leaving directory `/home/tools/dpkg-1.16.18′
make[1]: Leaving directory `/home/tools/dpkg-1.16.18′

#查看start-stop-daemon位置
[root@admin dpkg-1.16.18]# find / -name start-stop-daemon
/home/tools/dpkg-1.16.18/utils/start-stop-daemon
[root@admin dpkg-1.16.18]# cp /home/tools/dpkg-1.16.18/utils/start-stop-daemon
start-stop-daemon start-stop-daemon.c start-stop-daemon.o
[root@admin dpkg-1.16.18]# cp /home/tools/dpkg-1.16.18/utils/start-stop-daemon /usr/bin/

#关闭防火墙
[root@admin dpkg-1.16.18]# service iptables stop

#启动服务
[root@admin dpkg-1.16.18]# /etc/init.d/rttys start
[root@admin dpkg-1.16.18]# ps -ef |grep rttys
root 57653 1 0 21:22 ? 00:00:00 /usr/local/sbin/rttys -port 5912
root 57657 3759 0 21:22 pts/1 00:00:00 grep rttys

[root@admin dpkg-1.16.18]# netstat -antlp |grep 5912
tcp 0 0 :::5912 :::* LISTEN 57653/rttys
tcp 0 0 ::ffff:192.168.1.104:5912 ::ffff:192.168.1.108:51731 ESTABLISHED 57653/rttys
tcp 0 0 ::ffff:192.168.1.104:5912 ::ffff:192.168.1.108:51729 ESTABLISHED 57653/rttys
tcp 0 0 ::ffff:192.168.1.104:5912 ::ffff:192.168.1.108:51730 ESTABLISHED 57653/rttys
tcp 0 0 ::ffff:192.168.1.104:5912 ::ffff:192.168.1.108:51728 ESTABLISHED 57653/rttys

#修改启动端口
[root@admin dpkg-1.16.18]# vim /etc/init.d/rttys
#修改第17行的数字
PORT=80

#重新启动
[root@admin dpkg-1.16.18]# /etc/init.d/rttys stop
[root@admin dpkg-1.16.18]# /etc/init.d/rttys start
[root@admin dpkg-1.16.18]#

#客户端部署(以centos为例)
#如何编译和安装rtty客户端
#针对Linux发行版,例如Ubuntu和Centos
#安装编译工具
# For Ubuntu
sudo apt install gcc cmake git
# For Centos
[root@admin ~]# yum install gcc cmake git -y
已加载插件:fastestmirror, refresh-packagekit, security
设置安装进程
Determining fastest mirrors
* base: mirror.bit.edu.cn
* extras: mirrors.aliyun.com
* updates: mirror.bit.edu.cn
base | 3.7 kB 00:00
extras | 3.4 kB 00:00
updates | 3.4 kB 00:00
解决依赖关系
–> 执行事务检查
—> Package cmake.x86_64 0:2.8.12.2-4.el6 will be 安装
—> Package gcc.x86_64 0:4.4.7-18.el6 will be 安装
–> 处理依赖关系 cpp = 4.4.7-18.el6,它被软件包 gcc-4.4.7-18.el6.x86_64 需要
–> 处理依赖关系 cloog-ppl >= 0.15,它被软件包 gcc-4.4.7-18.el6.x86_64 需要
—> Package git.x86_64 0:1.7.1-9.el6_9 will be 安装
–> 处理依赖关系 perl-Git = 1.7.1-9.el6_9,它被软件包 git-1.7.1-9.el6_9.x86_64 需要
–> 处理依赖关系 perl(Git),它被软件包 git-1.7.1-9.el6_9.x86_64 需要
–> 处理依赖关系 perl(Error),它被软件包 git-1.7.1-9.el6_9.x86_64 需要
–> 执行事务检查
—> Package cloog-ppl.x86_64 0:0.15.7-1.2.el6 will be 安装
–> 处理依赖关系 libppl_c.so.2()(64bit),它被软件包 cloog-ppl-0.15.7-1.2.el6.x86_64 需要
–> 处理依赖关系 libppl.so.7()(64bit),它被软件包 cloog-ppl-0.15.7-1.2.el6.x86_64 需要
—> Package cpp.x86_64 0:4.4.7-18.el6 will be 安装
–> 处理依赖关系 libmpfr.so.1()(64bit),它被软件包 cpp-4.4.7-18.el6.x86_64 需要
—> Package perl-Error.noarch 1:0.17015-4.el6 will be 安装
—> Package perl-Git.noarch 0:1.7.1-9.el6_9 will be 安装
–> 执行事务检查
—> Package mpfr.x86_64 0:2.4.1-6.el6 will be 安装
—> Package ppl.x86_64 0:0.10.2-11.el6 will be 安装
–> 完成依赖关系计算

依赖关系解决

======================================================================================================================
软件包 架构 版本 仓库 大小
======================================================================================================================
正在安装:
cmake x86_64 2.8.12.2-4.el6 base 8.0 M
gcc x86_64 4.4.7-18.el6 base 10 M
git x86_64 1.7.1-9.el6_9 updates 4.6 M
为依赖而安装:
cloog-ppl x86_64 0.15.7-1.2.el6 base 93 k
cpp x86_64 4.4.7-18.el6 base 3.7 M
mpfr x86_64 2.4.1-6.el6 base 157 k
perl-Error noarch 1:0.17015-4.el6 base 29 k
perl-Git noarch 1.7.1-9.el6_9 updates 29 k
ppl x86_64 0.10.2-11.el6 base 1.3 M

事务概要
======================================================================================================================
Install 9 Package(s)

总下载量:28 M
Installed size: 76 M
下载软件包:
(1/9): cloog-ppl-0.15.7-1.2.el6.x86_64.rpm | 93 kB 00:00
(2/9): cmake-2.8.12.2-4.el6.x86_64.rpm | 8.0 MB 00:04
(3/9): cpp-4.4.7-18.el6.x86_64.rpm | 3.7 MB 00:02
(4/9): gcc-4.4.7-18.el6.x86_64.rpm | 10 MB 00:11
(5/9): git-1.7.1-9.el6_9.x86_64.rpm | 4.6 MB 00:06
(6/9): mpfr-2.4.1-6.el6.x86_64.rpm | 157 kB 00:00
(7/9): perl-Error-0.17015-4.el6.noarch.rpm | 29 kB 00:00
(8/9): perl-Git-1.7.1-9.el6_9.noarch.rpm | 29 kB 00:00
(9/9): ppl-0.10.2-11.el6.x86_64.rpm | 1.3 MB 00:01
———————————————————————————————————————-
总计 1.1 MB/s | 28 MB 00:26
warning: rpmts_HdrFromFdno: Header V3 RSA/SHA256 Signature, key ID c105b9de: NOKEY
Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
Importing GPG key 0xC105B9DE:
Userid : CentOS-6 Key (CentOS 6 Official Signing Key) <centos-6-key@centos.org>
Package: centos-release-6-9.el6.12.3.x86_64 (@anaconda-CentOS-201703281317.x86_64/6.9)
From : /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
运行 rpm_check_debug
执行事务测试
事务测试成功
执行事务
正在安装 : 1:perl-Error-0.17015-4.el6.noarch 1/9
正在安装 : perl-Git-1.7.1-9.el6_9.noarch 2/9
正在安装 : git-1.7.1-9.el6_9.x86_64 3/9
正在安装 : ppl-0.10.2-11.el6.x86_64 4/9
正在安装 : cloog-ppl-0.15.7-1.2.el6.x86_64 5/9
正在安装 : mpfr-2.4.1-6.el6.x86_64 6/9
正在安装 : cpp-4.4.7-18.el6.x86_64 7/9
正在安装 : gcc-4.4.7-18.el6.x86_64 8/9
正在安装 : cmake-2.8.12.2-4.el6.x86_64 9/9
Verifying : 1:perl-Error-0.17015-4.el6.noarch 1/9
Verifying : perl-Git-1.7.1-9.el6_9.noarch 2/9
Verifying : cpp-4.4.7-18.el6.x86_64 3/9
Verifying : mpfr-2.4.1-6.el6.x86_64 4/9
Verifying : cmake-2.8.12.2-4.el6.x86_64 5/9
Verifying : gcc-4.4.7-18.el6.x86_64 6/9
Verifying : git-1.7.1-9.el6_9.x86_64 7/9
Verifying : ppl-0.10.2-11.el6.x86_64 8/9
Verifying : cloog-ppl-0.15.7-1.2.el6.x86_64 9/9

已安装:
cmake.x86_64 0:2.8.12.2-4.el6 gcc.x86_64 0:4.4.7-18.el6 git.x86_64 0:1.7.1-9.el6_9

作为依赖被安装:
cloog-ppl.x86_64 0:0.15.7-1.2.el6 cpp.x86_64 0:4.4.7-18.el6 mpfr.x86_64 0:2.4.1-6.el6
perl-Error.noarch 1:0.17015-4.el6 perl-Git.noarch 0:1.7.1-9.el6_9 ppl.x86_64 0:0.10.2-11.el6

完毕!

[root@admin ~]# yum install epel-release -y
已加载插件:fastestmirror, refresh-packagekit, security
设置安装进程
Loading mirror speeds from cached hostfile
* base: mirror.bit.edu.cn
* extras: mirrors.aliyun.com
* updates: mirror.bit.edu.cn
解决依赖关系
–> 执行事务检查
—> Package epel-release.noarch 0:6-8 will be 安装
–> 完成依赖关系计算

依赖关系解决

======================================================================================================================
软件包 架构 版本 仓库 大小
======================================================================================================================
正在安装:
epel-release noarch 6-8 extras 14 k

事务概要
======================================================================================================================
Install 1 Package(s)

总下载量:14 k
Installed size: 22 k
下载软件包:
epel-release-6-8.noarch.rpm | 14 kB 00:00
运行 rpm_check_debug
执行事务测试
事务测试成功
执行事务
正在安装 : epel-release-6-8.noarch 1/1
Verifying : epel-release-6-8.noarch 1/1

已安装:
epel-release.noarch 0:6-8

完毕!

#编译和安装依赖软件包
# For Ubuntu
sudo apt install libjson-c-dev
# For Centos
yum install json-c-devel -y
yum install libjson* json-c-devel -y

[root@admin ~]# mkdir /home/app
[root@admin ~]# cd /home/app/
[root@admin ~]# git clone https://git.openwrt.org/project/libubox.git
[root@admin app]# cd libubox && cmake -DBUILD_LUA=OFF . && sudo make install
— The C compiler identification is GNU 4.4.7
— Check for working C compiler: /usr/bin/cc
— Check for working C compiler: /usr/bin/cc — works
— Detecting C compiler ABI info
— Detecting C compiler ABI info – done
— Found PkgConfig: /usr/bin/pkg-config (found version “0.23”)
— checking for one of the modules ‘json-c’
— Looking for clock_gettime
— Looking for clock_gettime – not found
— Looking for clock_gettime in rt
— Looking for clock_gettime in rt – found
— checking for one of the modules ‘lua5.1;lua-5.1’
— Configuring done
— Generating done
— Build files have been written to: /home/app/libubox
Scanning dependencies of target ubox
[ 2%] Building C object CMakeFiles/ubox.dir/avl.c.o
[ 5%] Building C object CMakeFiles/ubox.dir/avl-cmp.c.o
[ 7%] Building C object CMakeFiles/ubox.dir/blob.c.o
[ 10%] Building C object CMakeFiles/ubox.dir/blobmsg.c.o
[ 12%] Building C object CMakeFiles/ubox.dir/uloop.c.o
[ 15%] Building C object CMakeFiles/ubox.dir/usock.c.o
[ 17%] Building C object CMakeFiles/ubox.dir/ustream.c.o
[ 20%] Building C object CMakeFiles/ubox.dir/ustream-fd.c.o
[ 22%] Building C object CMakeFiles/ubox.dir/vlist.c.o
[ 25%] Building C object CMakeFiles/ubox.dir/utils.c.o
[ 27%] Building C object CMakeFiles/ubox.dir/safe_list.c.o
[ 30%] Building C object CMakeFiles/ubox.dir/runqueue.c.o
[ 32%] Building C object CMakeFiles/ubox.dir/md5.c.o
[ 35%] Building C object CMakeFiles/ubox.dir/kvlist.c.o
[ 37%] Building C object CMakeFiles/ubox.dir/ulog.c.o
[ 40%] Building C object CMakeFiles/ubox.dir/base64.c.o
Linking C shared library libubox.so
[ 40%] Built target ubox
Scanning dependencies of target blobmsg_json
[ 42%] Building C object CMakeFiles/blobmsg_json.dir/blobmsg_json.c.o
Linking C shared library libblobmsg_json.so
[ 42%] Built target blobmsg_json
Scanning dependencies of target blobmsg_json-static
[ 45%] Building C object CMakeFiles/blobmsg_json-static.dir/blobmsg_json.c.o
Linking C static library libblobmsg_json.a
[ 45%] Built target blobmsg_json-static
Scanning dependencies of target jshn
[ 47%] Building C object CMakeFiles/jshn.dir/jshn.c.o
Linking C executable jshn
[ 47%] Built target jshn
Scanning dependencies of target json_script
[ 50%] Building C object CMakeFiles/json_script.dir/json_script.c.o
Linking C shared library libjson_script.so
[ 50%] Built target json_script
Scanning dependencies of target ubox-static
[ 52%] Building C object CMakeFiles/ubox-static.dir/avl.c.o
[ 55%] Building C object CMakeFiles/ubox-static.dir/avl-cmp.c.o
[ 57%] Building C object CMakeFiles/ubox-static.dir/blob.c.o
[ 60%] Building C object CMakeFiles/ubox-static.dir/blobmsg.c.o
[ 62%] Building C object CMakeFiles/ubox-static.dir/uloop.c.o
[ 65%] Building C object CMakeFiles/ubox-static.dir/usock.c.o
[ 67%] Building C object CMakeFiles/ubox-static.dir/ustream.c.o
[ 70%] Building C object CMakeFiles/ubox-static.dir/ustream-fd.c.o
[ 72%] Building C object CMakeFiles/ubox-static.dir/vlist.c.o
[ 75%] Building C object CMakeFiles/ubox-static.dir/utils.c.o
[ 77%] Building C object CMakeFiles/ubox-static.dir/safe_list.c.o
[ 80%] Building C object CMakeFiles/ubox-static.dir/runqueue.c.o
[ 82%] Building C object CMakeFiles/ubox-static.dir/md5.c.o
[ 85%] Building C object CMakeFiles/ubox-static.dir/kvlist.c.o
[ 87%] Building C object CMakeFiles/ubox-static.dir/ulog.c.o
[ 90%] Building C object CMakeFiles/ubox-static.dir/base64.c.o
Linking C static library libubox.a
[ 90%] Built target ubox-static
Scanning dependencies of target blobmsg-example
[ 92%] Building C object examples/CMakeFiles/blobmsg-example.dir/blobmsg-example.c.o
Linking C executable blobmsg-example
[ 92%] Built target blobmsg-example
Scanning dependencies of target json_script-example
[ 95%] Building C object examples/CMakeFiles/json_script-example.dir/json_script-example.c.o
Linking C executable json_script-example
[ 95%] Built target json_script-example
Scanning dependencies of target runqueue-example
[ 97%] Building C object examples/CMakeFiles/runqueue-example.dir/runqueue-example.c.o
Linking C executable runqueue-example
[ 97%] Built target runqueue-example
Scanning dependencies of target ustream-example
[100%] Building C object examples/CMakeFiles/ustream-example.dir/ustream-example.c.o
Linking C executable ustream-example
[100%] Built target ustream-example
Install the project…
— Install configuration: “”
— Installing: /usr/local/include/libubox/blob.h
— Installing: /usr/local/include/libubox/runqueue.h
— Installing: /usr/local/include/libubox/uloop.h
— Installing: /usr/local/include/libubox/blobmsg_json.h
— Installing: /usr/local/include/libubox/safe_list.h
— Installing: /usr/local/include/libubox/list.h
— Installing: /usr/local/include/libubox/usock.h
— Installing: /usr/local/include/libubox/vlist.h
— Installing: /usr/local/include/libubox/ulog.h
— Installing: /usr/local/include/libubox/utils.h
— Installing: /usr/local/include/libubox/json_script.h
— Installing: /usr/local/include/libubox/ustream.h
— Installing: /usr/local/include/libubox/blobmsg.h
— Installing: /usr/local/include/libubox/md5.h
— Installing: /usr/local/include/libubox/avl-cmp.h
— Installing: /usr/local/include/libubox/avl.h
— Installing: /usr/local/include/libubox/kvlist.h
— Installing: /usr/local/lib/libubox.so
— Installing: /usr/local/lib/libubox.a
— Installing: /usr/local/lib/libblobmsg_json.so
— Removed runtime path from “/usr/local/lib/libblobmsg_json.so”
— Installing: /usr/local/lib/libblobmsg_json.a
— Installing: /usr/local/bin/jshn
— Removed runtime path from “/usr/local/bin/jshn”
— Installing: /usr/local/lib/libjson_script.so
— Removed runtime path from “/usr/local/lib/libjson_script.so”
— Installing: /usr/local/share/libubox/jshn.sh

[root@admin libubox]# cd /home/app/
[root@admin app]# git clone https://github.com/zhaojh329/libuwsc.git
Initialized empty Git repository in /home/app/libuwsc/.git/
remote: Counting objects: 385, done.
remote: Compressing objects: 100% (18/18), done.
remote: Total 385 (delta 10), reused 15 (delta 7), pack-reused 360
Receiving objects: 100% (385/385), 95.55 KiB, done.
Resolving deltas: 100% (255/255), done.
[root@admin app]# cd libuwsc && cmake -DUWSC_SSL_SUPPORT=OFF . && sudo make install
— The C compiler identification is GNU 4.4.7
— Check for working C compiler: /usr/bin/cc
— Check for working C compiler: /usr/bin/cc — works
— Detecting C compiler ABI info
— Detecting C compiler ABI info – done
— Found Libubox: /usr/local/lib/libubox.so

— UWSC_VERSION: 2.0.0
— UWSC_SSL_SUPPORT: OFF

— Configuring done
— Generating done
— Build files have been written to: /home/app/libuwsc
Scanning dependencies of target uwsc
[ 25%] Building C object src/CMakeFiles/uwsc.dir/uwsc.c.o
[ 50%] Building C object src/CMakeFiles/uwsc.dir/log.c.o
[ 75%] Building C object src/CMakeFiles/uwsc.dir/utils.c.o
Linking C shared library libuwsc.so
[ 75%] Built target uwsc
Scanning dependencies of target helloworld
[100%] Building C object example/CMakeFiles/helloworld.dir/helloworld.c.o
Linking C executable helloworld
[100%] Built target helloworld
Install the project…
— Install configuration: “”
— Installing: /usr/local/include/uwsc/config.h
— Installing: /usr/local/include/uwsc/uwsc.h
— Installing: /usr/local/lib/libuwsc.so.2.0.0
— Installing: /usr/local/lib/libuwsc.so
— Removed runtime path from “/usr/local/lib/libuwsc.so.2.0.0”
[root@admin libuwsc]#

#编译和安装RTTY
[root@admin libuwsc]# cd /home/app/
[root@admin app]# git clone https://github.com/zhaojh329/rtty.git
Initialized empty Git repository in /home/app/rtty/.git/
remote: Counting objects: 1324, done.
remote: Compressing objects: 100% (10/10), done.
Receiving objects: 100% (1324/1324), 3.82 MiB | 278 KiB/s, done.
remote: Total 1324 (delta 2), reused 7 (delta 1), pack-reused 1313
Resolving deltas: 100% (839/839), done.
[root@admin app]# cd rtty && cmake . && sudo make install
— The C compiler identification is GNU 4.4.7
— Check for working C compiler: /usr/bin/cc
— Check for working C compiler: /usr/bin/cc — works
— Detecting C compiler ABI info
— Detecting C compiler ABI info – done
— Found Libubox: /usr/local/lib/libubox.so
— Found Libuwsc: /usr/local/lib/libuwsc.so (found suitable version “2.0”, minimum required is “1.2”)
— Configuring done
— Generating done
— Build files have been written to: /home/app/rtty
Scanning dependencies of target rtty
[ 33%] Building C object src/CMakeFiles/rtty.dir/main.c.o
[ 66%] Building C object src/CMakeFiles/rtty.dir/utils.c.o
[100%] Building C object src/CMakeFiles/rtty.dir/protocol.c.o
Linking C executable rtty
[100%] Built target rtty
Install the project…
— Install configuration: “”
— Installing: /usr/local/bin/rtty
— Removed runtime path from “/usr/local/bin/rtty”
[root@admin rtty]#

#运行RTTY将下面的参数替换为你自己的参数(在客户端上操作)
[root@admin rtty]# echo ‘/usr/local/lib’ >>/etc/ld.so.conf

[root@admin rtty]# ldconfig

#设备ID
[root@admin rtty]# rtty -I ‘192_168_1_104’ -h ‘192.168.1.129’ -p 80 -a -v -s -d ‘本地测试’
rtty version 4.0.0
onopen
#说明
rtty -I ‘192_168_1_104’ -h ‘192.168.1.129’ -p 80 -a -v -d ‘本地测试’
[root@admin rtty]# rtty
You must specify the ifname or id
Usage: rtty [option]
-i ifname # Network interface name – Using the MAC address of the interface as the device ID
-I id # Set an ID for the device(Maximum 63 bytes, valid character:letters and numbers and underlines and short lines) – If set, it will cover the MAC address(if you have specify the ifname)
-h host # Server host
-p port # Server port
-P interval # Set ping interval(s)
-a # Auto reconnect to the server
-v # verbose
-d # Adding a description to the device(Maximum 126 bytes)
-s # SSL on

#默认是前台运行这个语句,一旦断开,就连接不上了,可以使用screen后台运行

#查询在线设备列表
[root@admin rtty]# curl http://192.168.1.129/devs
[{“id”:”192_168_1_104″,”uptime”:126,”description”:”本地测试”}]
[root@admin rtty]#

#嵌入式Linux平台,你需要自行交叉编译
#如何在OpenWRT中使用
#安装
opkg update
opkg list | grep rtty
opkg install rtty-nossl
#如果安装失败,你可以自己编译(https://gitee.com/zhaojh329/rtty/blob/master/BUILDOPENWRT_ZH.md)。
#配置服务器参数
uci add rtty rtty # If it’s the first configuration
uci set rtty.@rtty[0].host=’your server host’
uci set rtty.@rtty[0].port=’your server port’
#你可以给你的设备自定义一个ID。如果未指定,RTTY将使用指定的网络接口的MAC地址作为其ID,以MAC地址作为ID的格式为:1A2A3A4A5A6A
uci set rtty.@rtty[0].id=’your-device-id’
#保存配置并应用
uci commit
/etc/init.d/rtty restart

#如何使用
#1.使用你的Web浏览器访问你的服务器:
http://192.168.1.129/,然后点击connect按钮。
#2.你可以非常方便的将RTTY嵌入到你现有的平台(未测试通过):
http://192.168.1.129/?id=192_168_1_104
#3.自动登录(未测试通过):
http://192.168.1.129/?id=192_168_1_104&username=admin&password=123456
#上传文件和下载文件
#使用快捷键打开菜单(登录服务器以后起作用):
Ctrl+Shift+f

发表评论