本文介绍在CentOS 7操作系统中从源码安装RTPProxy的方法,按照以下步骤操作即可成功。
在CentOS 7.x上安装RTPProxy 1、将目录更改为/usr/src: [root@kamailio-cloud ~]# cd /usr/src/ 2、Clone rtpproxy源码: [root@kamailio-cloud src]# git clone https://github.com/sippy/rtpproxy.git Cloning into 'rtpproxy'... remote: Counting objects: 8581, done. remote: Total 8581 (delta 0), reused 0 (delta 0), pack-reused 8581 Receiving objects: 100% (8581/8581), 3.82 MiB | 561.00 KiB/s, done. Resolving deltas: 100% (6205/6205), done. [root@kamailio-cloud src]# 3、cd进入rtpproxy源代码tree: [root@kamailio-cloud src]# cd rtpproxy/ 4.配置源tree以安装rtpproxy: [root@kamailio-cloud rtpproxy]# ./configure 5、编译rtpproxy: [root@kamailio-cloud rtpproxy]# make 6、安装Rtpproxy: [root@kamailio-cloud rtpproxy]# make install 7、将init.d脚本复制到/etc/rc.d/init.d目录: [root@kamailio-cloud rtpproxy]# cp rpm/rtpproxy.init /etc/rc.d/init.d/rtpproxy 8、使文件可执行: [root@kamailio-cloud rtpproxy]# chmod +x /etc/rc.d/init.d/rtpproxy 9、添加将运行该程序的用户,我将添加名为rtpproxy的用户和名为rtpproxy的组: [root@kamailio-cloud rtpproxy]# mkdir -p /var/run/rtpproxy [root@kamailio-cloud rtpproxy]# groupadd -g 8002 rtpproxy [root@kamailio-cloud rtpproxy]# useradd -u 8002 -g 8002 -d /var/run/rtpproxy -M -s /bin/false rtpproxy [root@kamailio-cloud rtpproxy]# chown rtpproxy:rtpproxy -R /var/run/rtpproxy/ 10、检查rtpproxy可执行文件的位置: [root@kamailio-cloud rtpproxy]# which rtpproxy 11、将rtpproxy=/usr/bin/rtpproxy更改为/usr/local/bin/rtpproxy,/etc/rc.d/init.d/tpproxy文件中的pidfile: [root@kamailio-cloud rtpproxy]# nano /etc/rc.d/init.d/rtpproxy 示例输出如下所示: # Source function library. . /etc/rc.d/init.d/functionsopy prog=rtpproxy rtpproxy=/usr/local/bin/$prog user=rtpproxy lockfile=/var/lock/subsys/$prog pidfile=/var/run/$prog.pid 12、你可以包含其它选项,例如: OPTIONS=" -l 192.168.1.60 -s unix:/var/run/rtpproxy.sock" Rtpproxy将侦听ip:192.168.1.60,控制套接字为unix:/var/run/rtpproxy.sock, 要使其在UDP套接字上侦听,请添加选项: CONTROL_SOCK=udp:127.0.0.1:7722 13、重新加载并启动rtpproxy: [root@kamailio-cloud rtpproxy]# systemctl daemon-reload [root@kamailio-cloud rtpproxy]# /etc/init.d/rtpproxy start 14、要设置为在启动时运行,请输入: [root@kamailio-cloud rtpproxy]# chkconfig rtpproxy on 至此,你已完成所有的安装步骤。
相关主题 |